2023-08-11 03:33 AM
Hi,
we try to load a small program to RAM area starting from address 0x20008000 with STMCubeIDE and USB DFU and select start address 0x20008000 ( In debugger we can see that program is load to 0x20008000).
The download is successful, even so setting start address is successful, but the start of program is not successful.
If we download and start the same program with ozone debugger there is no issue. It runs as expected.
Used controller: STM32L45x/L46x, MCU, Flash size 512.
Is there any idea what I can check?
Best Regards,
Claus
Solved! Go to Solution.
2023-08-13 11:48 PM
We found the issue, by using the debugger:
It turns out that USB interrupt and other interrupts still active. We disabled those interrupts first and was able to run the program in RAM
2023-08-11 01:12 PM - edited 2023-08-11 01:14 PM
> with ozone debugger there is no issue. It runs as expected
Debuggers for Cortex-M are smart, they know how to load and run stuff in the RAM (they use this ability for themselves, to program the internal and external flash). The built-in DFU bootloader is not that smart => use a debugger to run your program, or a debugger-like utility such as Segger J-Run.
2023-08-11 02:22 PM - edited 2023-08-11 02:24 PM
Check Watchdog, if the loader started it you'll need to keep kicking it.
Do a simple test, where you startup a UART in Reset_Handler (pins, clocks, peripheral, in assembler), spin in a loop waiting on TXE, kicking watchdog, output characters. See it work, or see how long it runs without kicking the watchdog. Confirm code is running.
2023-08-13 11:48 PM
We found the issue, by using the debugger:
It turns out that USB interrupt and other interrupts still active. We disabled those interrupts first and was able to run the program in RAM