cancel
Showing results for 
Search instead for 
Did you mean: 

How can I load my program on a brand new stm32f103?

MRisu
Associate II

From an other mircocontroller manufactor i know a mechanism, that recognize if the uC is brand new and there is no program loaded. In this case, the uC goes automatically in bootmode.

Is this the case with the stm32f103?

Thank you.

4 REPLIES 4

Typically no.

You can pull BOOT0 High for it to go into the system loader, then connectivity via serial, usb, etc can be used to update. See application note AN2606

https://www.st.com/content/ccc/resource/technical/document/application_note/b9/9b/16/3a/12/1e/40/0c/CD00167594.pdf/files/CD00167594.pdf/jcr:content/translations/en.CD00167594.pdf

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

Thank you very much,

I saw this before, but its not the solution in my case, because:

The product has a CAN interface as output and after casting the electronic i have only this output to connect with. So to save the step "program the uC" before we cast, I want to connect the CAN output with the USART output and the uC just go the first time he starts up in to the system loader. And than i can implement a case when he goes into the system loader again to make an update.

Or can I pull BOOT0 high for the whole time and set a BFB bit, that he doesent go any more in the system loader?

I hope you know what I mean.

AvaTar
Lead

Install a second stage bootloader (as "user application") that either loads updates via CAN, or starts the existing application. You could e.g. support UDS with you BL.

Fumbling with the BOOT pins is not really a good option.

I think the system loader can be jumped into via software, in your own loader.

With your own loader you can implement any functionality desired.

Frequently people use the JTAG/SWD connectivity for production programming.

You want the BOOT0 pulled low for normal operation, with a test-point or jumper to take it high during production test/programming stages.

The alternative is to have your supplier/distributor pre-program parts before you place them, although this adds cost.

Usually people make these testability and programing choices in the design phase.

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