Strange behaviours of SPI bootloader on STM32F412
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-03-11 01:03 AM
I'm developing a SPI bootloader, using the integrated function of STM32F412, and I found two strange behaviours:
- I must issue two times the reset of MCU with Boot0 high, because after the first reset the MCU seems to be in bootloader mode but doesn't synchronize and a second reset is needed
- When I do the software restart via Go command at 0x08000000, the F412 restarts only after about 33s (yes, 33 seconds!)
Probably, I'm doing something wrong...
Thanks and best regards
*****
- Labels:
-
SPI
-
STM32F4 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-03-11 02:11 AM
I don't think there are many users here who have experience with SPI bootloader.
What is the master?
Can you try this on a "known good" board, e.g. a Nucleo, as both master and target?
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-03-11 03:59 AM
The master is already a Nucleo-F411RE, but using a Nucleo for the slave (target) is not so easy...
Fortunately, the two resets issue is nota a problem and I used the reset for software restart.
Another issue I found is that the Erase Memory command (tried with global mass erase parameter 0xFFFF) doesn't answer with ACK or NACK at the end, but continuosly with 0xA5; however the erase flash operation is succesfully completed.
Thanks and best regards
*****
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-03-11 06:56 AM
> The master is already a Nucleo-F411RE, but using a Nucleo for the slave (target) is not so easy...
I understand. My point is, the first issue (two resets) sounds to be related to bootloader entry, particularly, to possible (?) "false" activation of other peripheral in the bootloader, by activity on one of the - quite many - pins related to the bootloaders. The Nucleo is supposedly "clean" enough to exclude this sort of problems,
IMO it's still a relatively easy thing to try, maybe you can use one of your boards as master, and then the Nucleo may be free to use as the slave. IMO it's worth the hassle to exclude any basic source of error, and I suppose ST support - if any - would ask you to do the same thing anyway.
As for the other problems, which sound genuinely related to the BL itself, I'm afraid it's unlikely you'll receive any reasonable answer here, so you probably want to contact ST directly, through web support form or through FAE.
Please come back with the findings.
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-03-11 08:59 AM
Thanks for the answer, Jan.
One of the next days I will try to use the Nucleo and see what happens.
About the Flash mass erase, it works correctly, I didn't figure out that the mass erase operation would taken a little more than 15 seconds; after that time, the ACK is correctly answered.
Thanks again and best regards
*****
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-03-11 09:34 AM
> About the Flash mass erase
Thanks for coming back with this detail.
Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-03-12 03:11 AM
Maybe I found another issue, or I didn't understand well the documentation: if you send the command to erase multiple sectors, for example 0x00 0x03 in bytes 3 and 4 and 0x00 0x00 in byte 5 and 6 to erase the first four 16K sectors, only the first sector is erased, the other three not, but the duration of the operation is four times the duration of single 16K sector erase.
Anyway, these are the durations of erase operation of my STM32F412RET6 powered with 3.3V and in Bootloader SPI mode (SPI3 with 6.25 MHz clock from SPI master):
- Global mass erase: about 15 s
- 16K single sector erase: about 350 ms
- 64K single sector erase: about 1 s
- 128K single sector erase: about 2 s
*****