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

Code works on target hardware in debug mode but fails to boot from flash

I understand this is a rudimentary question but it has me stumped. I'm using Keil to generate programs for the STM32G431C8 MCU and I can run the debugger using a SEGGER JTAG pod on the target hardware.

The code is working as designed through the debugger on the target hardware . I just got to the part where I want to flash other boards and it is not working for me.

  1. I built the code with debug information turned off. hex file starts at 0x08000000
  2. I use SEGGER Flasher Lite with the SEGGER JTAG to connect to the MCU and erase the chip.
  3. I then select Program Device and that finishes with verify okay.
  4. When I power cycle the MCU I can not talk through the UART port and the LED is not flashing. This is the same code that runs in the debugger.

I've gone through these steps several time with the same non-result. I can go back to the Keil platform and download debug code and everything runs fine. During this whole process BOOT0 is tied to GND through a 10k. I verified that during the power cycle BOOT0 remains at GND.

Also, in Keil MDK, I can set up to flash using the JLINK debug driver and set it to reset & run. When I launch the flash download in Keil it successfully erases and supposedly writes flash then resets and runs. The code appears to work, the LED is flashing and I can use the UART interface BUT when I power cycle all is dead again 

Please give me some pointers ;) ??