in circuit programming of ST micro using swim

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
gavin mack
Posts: 28
Joined: Wed Sep 26, 2018 2:15 pm
Has thanked: 3 times
Been thanked: 3 times
Contact:

in circuit programming of ST micro using swim

Post by gavin mack »

Hi

As part of a test rig circuit I'm doing using flowcode 8 and a PIC micro has any one done, or can suggest best way to achieve the following reliably.
programming a ST micro (STM8) using the SWIM protocol an 8K hex file stored on an SD card (or other storage).
On previous test rigs I used an external laptop and ST-LINK programmer but I want to eliminate this.

Below are several methods, I'm sure there are more
1.) a USB interface to external programmer such as ST-LINK,
2.) directly programming using SWIM pins connected directly to the pic.
3.) program using SPI interface from this website http://kuku.eu.org/?projects/stm8spi/st ... _toc_head6

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: in circuit programming of ST micro using swim

Post by Benj »

Hello,

It sounds possible. I do something similar on the EB2 BL0061 board to program the on-board ST-ARM using it's built in bootloader.

If you look at the EB2 datasheet then the schematic for the board is included there. I connect to the chip using SPI and also via UART for backup. The programming is currently done using the UART connection plus a few of the IO.

Changing the source so that it comes from a file on an SD card rather than steamed via USB should be possible.

Here are my firmware files I created to facilitate programming the ST32 device, hopefully they are useful for you.
stm32prog.c
(5.46 KiB) Downloaded 190 times
stm32prog.h
(2.93 KiB) Downloaded 202 times
If you need more then I can maybe help but I might have to share files in private to avoid loosing EB2 IP.

I've not done ST8 so not sure how compatible these are. Probably not at all :cry:

gavin mack
Posts: 28
Joined: Wed Sep 26, 2018 2:15 pm
Has thanked: 3 times
Been thanked: 3 times
Contact:

Re: in circuit programming of ST micro using swim

Post by gavin mack »

Hi Ben

thanks for that, unfortunately any stm8 less than 16Kb does not have the ST bootloader. this means a user bootloader has to be written and programmed in somehow before spi programming can be used. we are using an 8K STM8

Post Reply