STM32F207IG + Jlink + GDB server + codesourcery debugger => server restarts

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • STM32F207IG + Jlink + GDB server + codesourcery debugger => server restarts

    Hi,

    i have two problem occuring in my project when trying to debug the code.

    1)
    When i continue the program, which only makes copy of two files on SD card, the j-link control panel restarts with following state output:
    (see the image at: 95.168.216.1/download/images/jlink-problem.png)
    [img]http://95.168.216.1/download/images/jlink-problem.png[/img]
    (the j-link control panel restarts and looks as you can see on picture)


    2) The second problem is that sometime from unknow reason the gdb server stops at freeRTOS idle task with SIGTRAP , while there are no set breakpoint for this function or even in that C-file. The dissasembly code looks absolutely normal, no special SVC or any other thumb sets, just infinte while which does nothing just cycle.

    The GDB init looks like:
    monitor speed 1000
    monitor interface SWD
    monitor flash device = STM32F207IG
    monitor endian little
    monitor reg r13 = (0x00000000)
    monitor reg pc = (0x00000004)
    set mem inaccessible-by-default off

    #after load:
    monitor reset
    continue

    Conclusion:
    I cant debug for more than 2 seconds when CPU is running. Some of the above problems still occures.
  • Hi,

    Do you use any low-power modes by using WFI or WFE isntructions?
    If yes, you need to configure the STM32F207 regarding this
    by configuring the
    Debug MCU configuration register (DBGMCU_CR)
    Debug MCU APB1 freeze register (DBGMCU_APB1_FZ)
    Debug MCU APB2 freeze register (DBGMCU_APB2_FZ)
    accordingly.

    Best regards
    Alex
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • low power mode not used

    No i am not using any low power mode, the CPU is running at full speed (120MHz) at 3,3V. The RCC is properly setuped by CMSIS from ST.

    The file copy (in firmware, where the problem occures) is done using the DMA transfer and IRQ request of SDIO peripheral.

    If i run the firmware without the debuging, the program runs just well, the file is copied and CPU is not halted or restarted, so the C-code should be fine.

    The question is why debuger is not stable and gives some bad message about reading the R15 when CPU is running. As you can see the eabi-GDB is not asking for that R15, so why that message comes up.

    The beta version v439a do exactly the same issue.

    If i use ST-LINK v2 i can clearly run the code without any issue/errors, but the download speed is too slow, that's the reason why i bought the jlink.
  • Non zero DMA data transfer

    Jlink fails only at time when SDIO peripheral reads non zero data :!: If the DMA transfers only zeros, its OK, JLINK is stable, but when real data flow occures, JLINK dies and GDB server restarts.

    I also created for you a minimal our implementation for SD card operations, which uses FreeRTOS.

    STM32F207-tests.zip

    So the bug should be reproducable now.
  • The second problem

    via: openocd.sourceforge.net/doc/html/GDB-and-OpenOCD.html
    Another example of useful GDB configuration came from a user who found that single stepping his Cortex-M3 didn't work well with IRQs and an RTOS until he told GDB to disable the IRQs while stepping:
    define hook-step
    mon cortex_m3 maskisr on
    end
    define hookpost-step
    mon cortex_m3 maskisr off
    end
    Thought this might help in finding the problem

    Best of luck, guy