Skip to main content
Christian Frick
Associate
December 9, 2016
Question

Using SPI Bootloader of STM32L476RG

  • December 9, 2016
  • 2 replies
  • 1437 views
Posted on December 09, 2016 at 12:08

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

    This topic has been closed for replies.

    2 replies

    Christian Frick
    Associate
    December 9, 2016
    Posted on December 09, 2016 at 14:27

    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

    ST Renegade
    Associate
    December 9, 2016
    Posted on December 09, 2016 at 21:24

    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

    Christian Frick
    Associate
    December 12, 2016
    Posted on December 12, 2016 at 15:04

    Hi Renegade

    Thanks a lot. Please see my comments in

    https://community.st.com/0D70X000006SqxgSAC

     

    Best regards

    Christian