[ABANDONED] STM32G4 Single Bank mode - option bytes sector flash loader

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

  • [ABANDONED] STM32G4 Single Bank mode - option bytes sector flash loader

    I am trying to use the JLink pro to configure, flash and then protect an STM32G4 microcontroller in single bank mode using a jlink commander cli script. I went to the stm32g4 wiki, but have some questions.

    Regarding the option bits. The note says that all the option bits should be configured at once. Does this have to be done using the loadfile command?

    Also, I configured a jlinkdevices.xml file as described in the wiki.segger.com/STM32G4 page, and used the provided flashloader elf file for single bank mode, but I also wanted to add the 2 option byte sectors to the xml device file. I was wondering if there is a flashloader elf file that could be used for the two option bank sectors. I tried switching between the single bank device setup and dual bank device setup when I needed to program the option bytes, but I am getting RAM errors, and other problems when I try to erase, or adjust the option bytes, and it seems like it would be safer to have it all wrapped into a single device.
  • Just as a follow-up. It seems like I am able to program a device in single bank mode with the inbuilt device type "stm32g473ve" without even having to use the jlinkdevices.xml. Do I even need to use the custom xml?

    Also, the erase command is working even when the write protect option bits are set. I can't quite understand how this is happening. If I use the ST debugging tools, they will throw an error if I try to erase with the write protection on, but somehow the JLink is able to erase anyway.

    I'm using 7.66b on linux and 7.80 on windows.