cancel
Showing results for 
Search instead for 
Did you mean: 

Flashing MCU using another MCU

Moamen Ayman
Associate III
Posted on February 14, 2018 at 22:26

Hello everybody

 I am working on a design using STM8S103F2P6TR and will produce a big quantity of it so I am thinking to make another portable design using STM32F407VGT6 as a flasher to program the units after manufacturing without the need to connect it to a PC which take long time. So is there a way I can store the Hex data for 

STM8S103F2P6TR  into

STM32F407VGT6 embedded flash memory

 or an external memory associated with STM32F407VGT6 in a portable small design and just connect this flasher device with the main design to program it. As I know STM8/32 MCUs use JTAG for flashing so do I need to implement the circuit for ST-link inside my flasher design or there is an easier way to flash the firmware to STM8S103F2P6TR

 with STM32F407VGT6 

?

Thanks in advance.

7 REPLIES 7
Posted on February 14, 2018 at 22:44

The STM8 uses a SWIM protocol, you'd have to see what documentation is available about the protocol, or what ST is willing to share with you.

.HEX files aren't unduly efficient, you might want to consider an STM32F407 board with a MicroSD card as a convenient and generic way of supplying file data.

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 14, 2018 at 22:50

First of all, it is swim for stm8.

It is not difficult to design an on-the-go flasher. The simplest would be use stlink plus adapter. 

Then you could look into bootloader's if your chip supports it.

Then Google production off-line programmers.

If all fails, get the swim programming manual and implement it yourself.

Alex R
Senior
Posted on February 14, 2018 at 23:06

Hi,

You don't need to develop anything, as there is already a commercial product that does what you need. See the Flasher STM8 from Segger:

https://www.segger.com/products/production/flasher-st/models/flasher-stm8/

 

Regards,

Alex R.

Alex R
Senior
Posted on February 15, 2018 at 20:09

Hi,

Note that you have to account for the time it takes you to do the flasher hardware design, the firmware development, handling debugging issues, etc. It might be more that the 700USD that you would pay for a device already build and tested.

Why can't you use a PC+STLink to program your units after manufacturing? Would they be deployed already in the field?

If they are still in your manufacturing office, or at your office, you also can have several PC + STLink in parallel, to do the programming.

Another possibility is to request your STM8 distributor to do the programming ahead of assembling the MCU on the final board. Arrow Electronics and others offer that service.

Take a look at this presentation from ST which list a number of companies that have solutions for STM8 flash programming

http://www.st.com/content/ccc/resource/sales_and_marketing/presentation/product_presentation/c5/eb/41/1f/d5/3a/4f/40/stm8_production_programming_solutions.pdf/files/stm8_production_programming_solutions.pdf/jcr:content/translations/en.stm8_production_programming_solutions.pdf

 

Regards,

Alex R.

Moamen Ayman
Associate III
Posted on February 15, 2018 at 20:32

I have no problem to use st-link programmer but I don't want to use a PC, is there a way I can connect ST-programmer to another MCU through USB to provide the firmware to my target MCU?

Posted on February 15, 2018 at 19:46

Hi Alex, I am looking for a design I can make 10pcs of it as a flasher, add some features and its cost around 20USD but this flasher costs 700USD for just one. 

I have found this

https://sourceforge.net/p/stm32f100tostm8s105swimlibrary/wiki/Home/

talking about a library to implement SWIM, I am going to test it and hope it works but still this one just implement ST-Link and I still need a PC.
Posted on February 15, 2018 at 20:28

Thanks Alex!

 The point is after programming I want to store some other data on the flash memory of each MCU, this data defers based on some factors like each device ID and so on. So I want to do all that in one step or it will take long time to program each unit using a PC then connect it to my system to store some identification data.