cancel
Showing results for 
Search instead for 
Did you mean: 

UART bootloader in the Nucleo-L476RG - Getting NACK from the beginning

Cristina_Paniagua
Associate II

Hi, 

I wanted to use the bootloader via uart in a nucleo-L476RG (target) and have an L4P5ZG as a Master. I read the AN2606 and AN3155 but I am facing some problems. 

The activation pattern is the 7. I did the following: 

- BOOT0->to VDD

- nBoot1 ->1 

-BFB2->0 ( default value)

I connected the TX-RX and The RX-TX and the GND of both boards. I am using USART_1 ( I tried normal uart before and it seems to work) in both. 

I used the USB to power them. 

In the c code, I sent the first 0x7F. 
But I am always receiving a NACK(0x1F), so I cannot continue with the commands ( I wanted to send the get command to see if it was working before doing anything else). 

I am doing something wrong obviously but I do not know what, I read the application notes but I do not know what I am missing. 

Do you have any idea?

I am not doing anything with the reset, can this be related? In some forums, they mention the reset but in the application note, it does not say much about this so I do not know what to do exactly with it. And I am getting some response from the bootloader tho. 

If you know a host example code in c, that uses uart to access the bootloader it would be great to check. 

 

Thank you in advance. 

 

 

 

 

1 REPLY 1

Make sure to be using EVEN parity, and send the 0x7F (01111111b) pattern as a single byte. The loader is a one-shot deal, it's not "receiving" the 0x7F but rather measuring the timing so it can compute a baud rate from the pattern. If the first signal it sees doesn't work then the thing remains in that broken mode. You can reset and retry. Watch for secondary devices like GPS squawking at startup on other UARTs the STM32 might respond too.

For an example see how the MKR WAN 1300 board updates the Murata module with an STM32L0 part.  https://github.com/arduino-libraries/MKRWAN/tree/master/examples/MKRWANFWUpdate_standalone

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..