2016-12-09 03:08 AM
Hi all
I'm trying to use the SPI Bootloader of the STM32L476RG.
To do so, I set up an other STM32 device running an SPI master (Frame Format = Motorola, Data Size = 8 Bits, First Bit = MSB First, Baud Rate = 62.5 KBits/s, CPOL = Low, CPHA = 1 Edge, CRC Calculation = Disable, NSSP Mode = Enabled, NSS Signal Type = Output Hardware). The SPI master is connected to SPI2 of the STM32L476.
I pull the BOOT0 pin to VDD and reset the device. After waiting one seconds, the master sends 0x5A, 0x00, 0x00. The answer is monitored via oscilloscope and is: 0xA5, 0xA5, 0xA5. According to AN4286, the 3rd byte should either be 0x79 or 0x1F. Even if I send additional 0x00's, the device always responses with 0xA5. So it looks like the SPI synchronization is not working properly.
Serving the bootloader with USART worked properly.
What am I doing wrong? Do you have any recommendations?
Thanks a lot
Christian
2016-12-09 05:27 AM
BTW, the bootloader version on STM32L476RG is 9.2.
I just tried the same procedure on SPI1, getting the same effect.
Then I tried the procedure on a STMF429ZI using SPI4 and running the bootloader version 9.1. Here I don't even get an answer.
When I set up a minimal firmware using the SPI4, everything works well. So the wiring should be fine.
Has anyone an idea?
Thanks a lot
2016-12-09 12:24 PM
According to AN4286, the 3rd byte should either be 0x79 or 0x1F. Even if I send additional 0x00's, the device always responses with 0xA5. So it looks like the SPI synchronization is not working properly.
The AN is a bit misleading. You need to follow the Figure 2., where it is clearly stated, that every ACK has to be polled until 0x79 or 0x1F is returned. So it practice it's not a third byte...
Have a nice day,
Renegade
2016-12-12 07:04 AM
Hi Renegade
Thanks a lot. Please see my comments in
https://community.st.com/0D70X000006SqxgSAC
Best regards
Christian