2020-03-11 01:03 AM
I'm developing a SPI bootloader, using the integrated function of STM32F412, and I found two strange behaviours:
Probably, I'm doing something wrong...
Thanks and best regards
*****
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
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
*****
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
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
*****
2020-03-11 09:34 AM
> About the Flash mass erase
Thanks for coming back with this detail.
Jan
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):
*****