Skip to main content
Visitor II
June 24, 2022
Question

Unable to communicate with SPI bootloader

  • June 24, 2022
  • 2 replies
  • 976 views

Hi,

I am trying to use the ROM bootloader on the STM32G071 to change the contents of specific flash sections. I was able to enter the bootloader just fine, at least I think so because I can see in the debugger how different points in the address space above 1fff0000 are accessed.

I am using this library on another STM32 as a master:

​https://github.com/glegrain/STM32-SPI-Bootloader-host

​Since it's written by an STM employee and the commands are exactly like in AN2606 I am confident this is correct. However I can't even get past the first synchronization sequence. The bootloader only responds with seemingly random data.

The baud rate is below 8MHz ​as necessary. Is there some additional timing I have to adhere to, or anything else that I am missing?

    This topic has been closed for replies.

    2 replies

    Graduate II
    June 25, 2022

    Check your connect config to G071 is

    0693W00000NsjxSQAR.pngor SPI2 on next page.

    Visitor II
    June 27, 2022

    The master spi config is correct so far. I used the CubeMX configuration for SPI on master side with CPOL Low, CPHA Edge 1, MSB first 8bit. Using the master code from the linked repo I am calling BL_Init a moment after I am sure the slave uC has entered the BL. Is there specific timing to adhere to? I am not using any other periphery to connect to the BL. I can see that the bootloader sends a dummy while the master sends the sync byte. However after that the master loops in wait_for_ack() because the bootloader just sends garbage data while the master sends dummies

    Explorer
    March 7, 2025

    Was the issue ever solved? Is it a timing issue of any kind or what led to success?