[SOLVED] Issue with J-Link debugger while working with bootloader on STM32F765

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

  • [SOLVED] Issue with J-Link debugger while working with bootloader on STM32F765

    Hi, I'm using the J-Link EDU and STLink debugger present on the Nucleo boards from ST. For testing, the bootloader code is present at 0x8000000 and just jumps to 0x8020000 where the main app code is present. When I use the Jlink EDU, it can't program the flash at 0x8020000 every time successfully and if i modify the program and start debugging, the Jlink erases the flash but does not program it successfully and after the bootloader makes the jump, the MCU gets HardFault. Now this happens whether I use Jlink or the STLINK (converted to Jlink). Usually I see it stuck at 0xFFFFFFFE. At that point the JLINK has erased the app code but failed to program it.
    The interesting thing is that the STlink debugger when converted back and used with openocd has no issues whatsoever with the bootloader jumping to main app code and debugging from there.
    I also find that if I program the main app code at 0x8020000 by STLink and OpenOCD and then switch to JLINK EDU for debug, it works as long as the JLINK does't reprogram it. If in the log, i see that the JLINK flashes the code, then the ST crashes after jumping from bootloader. So I definitely think it has something to do with how the JLINK is erasing and programming the ST during debug.
    I also tried programming with JLINK commander and that seems to fail as well. Unless I fully erase the chip.
    I'm using System Workbench 2.0 with GNU ARM Eclipse plugin for Jlink debugging with the latest ARM toolchain as of this date and Jlink 616c. I'm using the STM32F765VI with the flash in dual bank configuration.
    I'm also attaching the GDB logs from JLINK and STLINK for clarity. I would like to use JLINK for debugging since I can have SWO console in eclipse whereas its very cumbersome in OpenOCD so would like to resolve it.


    Thanks in advance!
    Files
  • Hi,


    I just gave it a try and could not reproduce it using a STM32F769NI eval board.
    Could you please give resetting the option bytes to factory defaults a try?
    The J-Link software & documentation pack ships with a utility for STM32 MCUs called JLinkSTM32.exe.

    If the issue persists, would it be possible for you to provide us with an example data file and step-by-step instructions in order to reproduce the issue?

    Best regards,
    Niklas
    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.
  • After a few more tests. I believe I've isolated the issue. I'm required to run the program in the DUAL Bank configuration and I think JLINK does not not that. If I configure it to 256-bit Single Bank mode, jumping to main app is no problem. So it has to be related to the Dual Bank configuration done though the option bytes. How do make the JLINK aware of this configuration?
    I also observed that when I erased the controller through Jlink Commander, it would erase it according to the Single Bank sectors. That leads me to be more confident that this is the issue. Any thoughts?
  • Hi,

    sorry for the delay in response.
    Flash programming of the STM32F7 in dual bank mode is not supported out of the box.
    As a work around, the J-Link flash loader can be overwritten by one which supports the dual bank layout of the STM32F7.

    We created a wiki article regarding this issue: wiki.segger.com/STM32F7#Flash_Dual_Bank_Mode

    Does this work for you?

    Best regards,
    Niklas
    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.
  • Hi,

    thanks for the feedback and good to hear that this is working for you!

    Please mark this as solved

    Done.

    Best regards,
    Niklas
    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.