Page 1 of 1
Use the serial port to update the firmware
Posted: Mon May 21, 2018 3:45 am
by Meekdai
Hello everyone,
As far as I know, only use DFU to update the firmware.
Is there a way to update the firmware on Pyboard through the serial port?
Re: Use the serial port to update the firmware
Posted: Mon May 21, 2018 5:49 pm
by dhylands
Yes. I wrote a blog post about it over here:
http://blog.davehylands.com/2014/02/ser ... m32f4.html
That blog post is 4 years old, so its possible it might not work. I'd be interested to hear if it works for you.
Re: Use the serial port to update the firmware
Posted: Tue May 22, 2018 5:35 am
by Meekdai
dhylands wrote: ↑Mon May 21, 2018 5:49 pm
To initiate the bootloader on the UART you need to make BOOT0 high, and then press and release RESET (keep BOOT0 high while releasing RESET).
As you said, it goes into bootloader mode by make BOOT0 high.
I found another way initiate the bootloader over here:
http://docs.micropython.org/en/latest/p ... bootloader
Here is the source code in micropython:
https://github.com/micropython/micropyt ... #L197-L223
I found that this assembly code is entering the DFU mode, can be modified to enter the USART mode?
I know nothing about Assembly Language.
Re: Use the serial port to update the firmware
Posted: Tue May 22, 2018 7:43 pm
by dhylands
That code is actually doing a RESET from the code. So it should launch the bootloader. The bootloader will then select which mode to use by following the flow chart shown on page 97 of the AN2606 document:
http://www.st.com/resource/en/applicati ... 167594.pdf
Re: Use the serial port to update the firmware
Posted: Wed May 23, 2018 2:05 am
by Meekdai
1. I use pyb.bootloader() to initiate the bootloader, and send 0x7f in USART1, device reply 0x0 0x0 0x0.
2. I use pyb.bootloader() to initiate the bootloader,and use DfuSeDemo software ,device enter DFU mode.
3. I make BOOT0 high to initiate the bootloader, and send 0x7f in USART1,device reply 0x79.
4. I make BOOT0 high to initiate the bootloader, and use DfuSeDemo software ,device enter DFU mode.
The above 4 steps illustrate that make BOOT0 high and pyb.bootloader() are different in some cases.
Here is USART bootloader code sequence:
http://www.st.com/content/ccc/resource/ ... 264342.pdf