Skip to main content
deep_rune
Associate III
November 23, 2020
Question

How to program final 'release version' of code?

I've been programming my chips via the debug mode in STM32cubeIDE, but the code doesn't seem to run properly when the debugger isn't connected. What is the correct way to program a 'final release' version of my code, that will run independently every time the chip turns on?

This topic has been closed for replies.

9 replies

KnarfB
Super User
November 23, 2020

ideally, there should be no differences betwenn debug and release mode. What are your observations?

And,its not uncommon to ship a debug configuration of the code to be sure that late bugs can be traced accordingly.

Finally: there will never be a final version :)

deep_rune
deep_runeAuthor
Associate III
November 23, 2020

the LEDs (controlled by PWM on the timers) light up, but the main program does nothing - the program runs on interrupts and there seems to be no interrupts. The main loop seems to run as there is an LED indicator which lights up in the main loop, but there is no signal on the external I2C DAC.

If i just connect the programmer (without turning it on) everything starts working fine

Tesla DeLorean
Guru
November 23, 2020

Very odd. Is this a custom board? Did you pull BOOT0 low?

Or it could be that your code is running, and ended up in the HardFault_Handler() or Error_Handler(), or perhaps there is a GPIO clock initialization missing.

Code loaded at 0x08000000 should run out of boot/power-up

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Danish1
Lead III
November 24, 2020

Do you have anything on your board to ensure that Reset is held low as power comes up?

It isn't always necessary but can help, particularly if Vdd rises slowly.

Does it start if you don't connect the full debugger but just momentarily pull Reset down and then release it?

Hope this helps,

Danish

deep_rune
deep_runeAuthor
Associate III
November 24, 2020

exactly, it seems to be the reset pin and it starts if i just connect it momentarily. should i use a pull-down resistor?

KnarfB
Super User
November 24, 2020

The ref. designs use only a 100nF C to gnd, see AN4555 Application note "Getting started with STM32L4 Series and STM32L4+ Series hardware development"

KnarfB