cancel
Showing results for 
Search instead for 
Did you mean: 

Strange behaviours of SPI bootloader on STM32F412

Guidoted
Associate III

I'm developing a SPI bootloader, using the integrated function of STM32F412, and I found two strange behaviours:

  1. 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
  2. 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

*****

6 REPLIES 6

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

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

*****

> 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

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

*****

> About the Flash mass erase

Thanks for coming back with this detail.

Jan

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

*****