2026-04-09 3:52 AM
Heyho,
playing with the L073, partitioned the flash for bootloader "BL" (bank 1) and application (bank 2).
No writing of app yet, just testing jumping back and forth.
I just added a no-init variable for communication between BL and app, mainly to tell the BL to not jump back to app if the app requested so.
So far so good...
But when the BL now jumps back to the app, all of a sudden in the app there's a ~ 1 second delay before u32AppRqstBootloader is printed - everything else is working fine - or so I think... (the next printf requested via UART user interface of that variable is quick again).
If it jumps more often back and forth, it behaves the same: BL prints quickly, the app has the 1 s delay.
I don't find that the application is doing anything differently than after the 1st jump.
I cannot debug this via ST-Link / SWD, it seems the debugger has problems with the jumping between the projects.
Any ideas?
PS: here's a copy of the terminal
// 1st start:
**************
* BOOTLOADER *
...
Tick 37
u32AppRqstBootloader 00000000
Tick 39
jump to APP...
џ
// jump okay, now we're in...
***************
* APPLICATION *
...
Tick 37
u32AppRqstBootloader B0072ABB
Tick 40 // <<< quick printf after 1st start / jump
// user input via terminal:
> cw Sboot
jump to BL...
џ
// we're back in...
**************
* BOOTLOADER *
...
Tick 37
u32AppRqstBootloader ABB1B007
Tick 39
// user input to jump back to app
> cw Sjapp
jump to APP...
// and we're back in app:
***************
* APPLICATION *
...
Tick 37
// ###### and HERE is the delay, see tick below #######
u32AppRqstBootloader B0072ABB
Tick 1040
Solved! Go to Solution.
2026-04-09 5:33 AM
"Again what learned" as they say in Germany...
I just took the big hammer and disabled the ADC by setting CR = 0 and disabling the peripheral clock.
Now I found out there's this ADDIS bit to be set and wait for ADEN = 0.
And lo and behold, no more delay!
2026-04-09 4:46 AM
It seems I make the mistake far before the printf... checking stuff between the tick outputs...
Still strange that this only happens after 1st start.
2026-04-09 5:16 AM
Almost got it:
the app's ADC's internal calibration times out.
But why? Let's find out...
The bootloader does not use the ADC, so it has something to do with the ADC de-init when leaving the app.
2026-04-09 5:33 AM
"Again what learned" as they say in Germany...
I just took the big hammer and disabled the ADC by setting CR = 0 and disabling the peripheral clock.
Now I found out there's this ADDIS bit to be set and wait for ADEN = 0.
And lo and behold, no more delay!