cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to communicate with SPI bootloader

FLewz.1
Associate III

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?

2 REPLIES 2
MM..1
Chief III

Check your connect config to G071 is

0693W00000NsjxSQAR.pngor SPI2 on next page.

gfxfloro
Senior

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