2023-08-11 3: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 1:12 PM - edited 2023-08-11 1: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 2:22 PM - edited 2023-08-11 2: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
2025-04-16 10:30 PM
I'm trying to do the same thing and I was hoping you could explain exactly what you did in your program for it to run after the DFU download.
I've put a post here regarding my progress:
Modifying Option Byte Value from Program Running in SRAM and Loaded using dfu-util
and I'm wondering if you could explain what else I should be doing.
Could I have the USB (and other) interrupts active and what is the best way to disable them?
Thanx for any help you can provide.
myke