cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F10x USART bootloader

fatemehjml
Associate II
Posted on January 16, 2014 at 09:00

I use STM32F103 in a project which is hard to access device after installation. Also it is manufactured in large quantity. I can get a serial port access to the out of device for updating firmware of device in future, but device is completely close and it is not possible to change status of BOOT0 & BOOT1 for entering system memory boot mode.

Is there any USART bootloader to use in STM32f103 which use to update device's program without changing status of MCU pins?

Regards,

Thanks,

 
12 REPLIES 12
chen
Associate II
Posted on January 16, 2014 at 10:27

Hi

In this situation, you can either write your own bootloader (and you will have to develop the mechanism to get it into the bootloader).

Another way round is to call (or technically it is more of a jump) to the built in bootloader.

Search the forum - some others have been discussing how to do this.

Again - you will have to develop a method to call the built in bootloader.

Probably some kind of serial comms protocol.

Posted on January 16, 2014 at 18:54

I use STM32F103 in a project which is hard to access device after installation. Also it is manufactured in large quantity. I can get a serial port access to the out of device for updating firmware of device in future, but device is completely close and it is not possible to change status of BOOT0 & BOOT1 for entering system memory boot mode.

 

Does the person who designed this still have a job? Unless you have access to the pins, or an ability to use the JTAG/SWD interface you're going to be in trouble.

You could program the blank devices before stuffing them on the board, or have you distributor do so.

Generally you'd look to provide access using via, test-points, or edge castelations.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
arganasss
Associate II
Posted on January 16, 2014 at 23:23

check this: [DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Jump%20to%20internal%20bootloader&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&currentviews=2070]https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=%2Fpublic%2FSTe2ecommunities%2Fmcu%2FLists%2Fcortex_mx_stm32%2FJump%20to%20internal%20bootloader&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&currentviews=2070

It helped me a lot and i can confirm you that you can jump to built in bootloader from your application without changing the states of BOOT0 and BOOT1 pins.

Posted on January 17, 2014 at 02:31

You still have to be able to control BOOT0 when the processor has no code in FLASH, a blank device does not fail-over gracefully into the ROM.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
fatemehjml
Associate II
Posted on January 18, 2014 at 07:57

Is it possible to develop my own bootloader? Is there any sample code?

I use C in keil.

Posted on January 18, 2014 at 18:37

Is it possible to develop my own bootloader? Is there any sample code? I use C in keil.

Sure, but it would have to be code you could put on the device prior to production if you can't access the BOOTx/SWD/JTAG pins afterward.

The USART IAP (In-Application Programming) should provide a simple example, but boot loaders can be as simple or complex as you need them to be.

http://www.st.com/web/en/catalog/tools/PF257844

ST maintains a list of consultants and contractors.

http://www.st.com/web/en/support/mcu_design_consultants.html

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
fatemehjml
Associate II
Posted on January 21, 2014 at 07:12

Thanks clive

I read application manual about USART IAP. It talks about an example which I can not find it in Web. I just can found a very old version from year 2007. Anybody can attach the last version of USART IAP?

Also it doesn't execute my program after I burn it's image to the MCU!

fatemehjml
Associate II
Posted on January 21, 2014 at 07:13

How I should address my new program?

chen
Associate II
Posted on January 21, 2014 at 11:22

Hi

The bootloader needs to be located at the default boot location, this is normally 0x0/0x8000000 but check the datasheet/reference manual.

''Also it doesn't execute my program after I burn it's image to the MCU! ''

This is the tricky part. To jump to the new downloaded program - it is not a simple case of changing the PC. You have to fake a boot up by setting the stack pointer and PC. The first 2 entries in the vector table (of the new app) should be the stack pointer and PC locations to use.

Google for how to jump from bootloader into application - that is how I found out how to do it.