2023-05-17 03:34 AM
I am using STM32F407 and want to use USART interface to flash MCU using bootloader. I have external 25MHz oscillator connected to the MCU.
I've noticed that there is drastic difference in booting delay time I need to implement on different bootloader versions on STM32F407. According to application note 2606
Bootloader V3.1 -
Minimum startup time: 84.59ms
HSE timeout: 0.790ms
Bootloader V9.1 -
Minimum startup time: 74ms
HSE timeout: 96ms
So there is drastic difference in HSE timeout, however it is says in same application notes - "The HSE clock source is used only when the CAN or the DFU (USB FS Device) interfaces are selected."
I could not find any data on whether or not it effects Bootloader timings if CAN or DFU is not used, but USART is used. Please can you clarify that?
2023-05-17 04:31 AM
What is HSE timeout?
OK I see value from Table 156 in AN2606.
> I've noticed that there is drastic difference in booting delay time I need to implement on different bootloader versions on STM32F407.
How drastic? What are those delays, are they different from 74ms/85ms? How exactly do you measure that - do you measure it from the end of reset?
JW
2023-05-17 05:26 AM
How drastic? - Around 300ms.
What are those delays, are they different from 74ms/85ms? - Around 100ms for Bootloader 3.1 and 400ms for Bootloader 9.1.
How exactly do you measure that - do you measure it from the end of reset? - I measure it by trying to establish comms with MCU through UART. Basically sending 0x7F through UART and waiting for ACK response with different time delays. I didn't try higher resolution then 100ms as I am happy that it works, but trying to find exact reason for this behaviour. Nothing like that is mentioned in Datasheets, but its there.
Edit: It's worth mentioning that I haven't checked that 100ms for SysTick is actually equal to real life 100ms
2023-05-17 06:50 AM
> Basically sending 0x7F through UART and waiting for ACK response with different time delays.
I don't understand. Response to 0x7F should be within fraction of milliseconds, see USART connection timing chapter in AN2606.
When and how exactly do you reset the target device?
JW
2023-05-17 06:56 AM
How - I toggle down and up NRST pin.
When - Before I start counting delay)
So for Bootloader 3.1
Reset -> wait 100ms -> send 0x7F through UART -> receive ACK
works fine
for Bootloader 9.1
Reset -> wait 400ms -> send 0x7F through UART -> receive ACK
works fine. If it is less, for instance 300ms, it is not responding.
2023-05-18 12:57 PM
Okay, but these numbers are way higher than those provided in AN2606.
Isn't there activity on other pins related to bootlaoder, which may mislead the bootloader and result in timeouts?
JW
2023-05-19 01:47 AM
Isn't there activity on other pins related to bootloader, which may mislead the bootloader and result in timeouts? -> I do control Boot0 pin, but much earlier in the process of flashing and reseting, it won't effect the bootling time. I also have some peripherals connected to microcontroller but they are in slave mode and MCU has no firmware in Flash memory when it's attempted to be flashed. When I reset it by toggling reset pin, there is no any activities.
The weirdest thing in my opinion is that the same MCU in exact same package, peripherals connected to it, Flashing procedure, PCB has such a different booting time only because of Bootloader and it is not described anywhere.