This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

how to set cursor in c file


Debug mode cursor doesn't show in C code file


Hi,everyone,
When i use ST-Link Debugger to debug code,the current cursor show in disassembly code windows.
I want to set cursor show in c code file,what should i do?

i configure Options->Load Application at Startup and Debug Run to main()

Any idea how to do?
Thanks

Parents
  • Perhaps there is no source code associated with the place where it is stopped? Code in assembler or from libraries is not going to display C code, as this is unavailable.

    So where is it actually stopped? What is the code at the disassembly cursor? Scrolling back, or expanding the window, can you see any function names? Addresses?

Reply
  • Perhaps there is no source code associated with the place where it is stopped? Code in assembler or from libraries is not going to display C code, as this is unavailable.

    So where is it actually stopped? What is the code at the disassembly cursor? Scrolling back, or expanding the window, can you see any function names? Addresses?

Children
  • after initialation,program run in while loop,and i get massage from UART3 and analyze the data.

    while (1) {
            ...
            if (USART3_ready_buf_ok){
                    USART_SendChars(USART1,USART3_ready_buf,USART3_ready_buf_len);
                    McuProtocolUnpack(USART3_ready_buf,USART3_ready_buf_len);
                    USART3_ready_buf_ok = 0;
            }
    }
    
    0x08001FD6 2032      MOVS     r0,#0x32
    0x08001FD8 F7FFFADE  BL.W     0x08001598
    0x08001FDC 4814      LDR      r0,[pc,#80]  ; @0x08002030
    0x08001FDE 7800      LDRB     r0,[r0,#0x00]
    0x08001FE0 B168      CBZ      r0,0x08001FFE
    0x08001FE2 4814      LDR      r0,[pc,#80]  ; @0x08002034
    0x08001FE4 8802      LDRH     r2,[r0,#0x00]
    0x08001FE6 4914      LDR      r1,[pc,#80]  ; @0x08002038
    0x08001FE8 4810      LDR      r0,[pc,#64]  ; @0x0800202C
    0x08001FEA F7FFFAB7  BL.W     0x0800155C
    0x08001FEE 4811      LDR      r0,[pc,#68]  ; @0x08002034
    0x08001FF0 8801      LDRH     r1,[r0,#0x00]
    0x08001FF2 4811      LDR      r0,[pc,#68]  ; @0x08002038
    0x08001FF4 F7FEFB94  BL.W     0x08000720
    0x08001FF8 2000      MOVS     r0,#0x00
    0x08001FFA 490D      LDR      r1,[pc,#52]  ; @0x08002030
    0x08001FFC 7008      STRB     r0,[r1,#0x00]
    0x08001FFE E7EA      B        0x08001FD6
    
    
    
    
    

  • Is the USART1 reference a typo?

    It gets stuck in this loop? Or doesn't get there?

    If it is not getting to this loop, then pay attention to where it is getting, and what it might be doing there. Check that clocks are enabled, etc.

  • Before getting in the loop,I sent a msg which can be read bu PC com tool,through USART1.
    After that,it gets stuck in the loop.But the cursor alsways stay in assembler code.