cancel
Showing results for 
Search instead for 
Did you mean: 

Update firmware stm32f103 via SWD

Sam Sam
Associate
Posted on February 05, 2018 at 10:48

Hi! How to update firmware stm32f103 via SWD interface from ESP8266?  I need program manual, application/technical note, or description of SWD interface. Maybe someone did this? 

#esp8266 #swd #stm32f103 #update-firmware
7 REPLIES 7
Posted on February 05, 2018 at 11:41

I googled 'cortex swd implementation' and see several implementations. Not sure how complex the protocol is.

Maybe using DFU would be easier (set right boot pins on STM32, reset STM32 and enter bootloader, then program the STM32 through the DFU using UART)

http://www.st.com/content/ccc/resource/technical/document/application_note/51/5f/03/1e/bd/9b/45/be/CD00264342.pdf/files/CD00264342.pdf/jcr:content/translations/en.CD00264342.pdf

 
Andrew Neil
Evangelist III
Posted on February 05, 2018 at 13:58

Any particular reason for doing this via SWD rather than a bootloader?

I guess another good google term would be, 'CMSIS-DAP' ...

EG, 

https://www.adafruit.com/product/2764

 
Posted on February 05, 2018 at 15:15

Using JTAG/SWD programming is a non-trival task, especially if you have no prior experience with programing via the scan chains and writing loaders.

Consider using the System Loader's USART method, this is well documented and significantly easier to implement on an embedded micro-controller.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
henry.dick
Senior II
Posted on February 05, 2018 at 15:16

1. Figure out how the programming protocol is. And

2. Implement it on your host.

Luckiky, swd is well understood so it should be easy, relatively speaking.

Posted on February 05, 2018 at 16:17

You can also implement your own protocol (the one between the STM32 and ESP8266)

Posted on February 06, 2018 at 01:21

Well, if you insist on using SWD then, surely, you are constrained to use the standard SWD protocols?

Posted on February 06, 2018 at 06:44

I proposed at the beginning of this thread to use DFU. This time i suggested to implement serial based protocol to move code from the PC to STM32, then program flash by own build in protocol i.e. write own bootloader if the built-in is not aceptable.

SWD is too complicated for me.