SWIM interface code to run on STM32
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-12-09 8:21 AM
I have an application requiring the use of an STM32F107 to program a number of STM8S parts in-circuit, therefore I must implement the SWIM protocol on the STM32F107. I have requested the source code for the SWIM driver in the STM32F103 part that is on the STM8 Value Line Discovery board, but ST has declined.
Has anyone implemented the SWIM protocol on and STM32 part (or any embedded microcontroller)? Would you be willing to share the source code?Thanks #swim-stm8- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-12-12 3:28 AM
Hi
Sort of - I am working on it. No, I cannot share it. This is a commercial development I am working on so I cannot give away any of the source code, Sorry. I can however give you hints on how to go about it. The timing of the SWIM bits means it is impractical to try and bit bang it. The timers inside the STM32 have a PWM mode which can be used to generate the 1/0 pulses. I have not found it possible to use a single timer to do both write and read. Our design uses 1 timer for write (set timer up as PWM output) and another timer for read (set timer up for output compare) I also had to make the SWIM driver work in a multi-tasking system (FreeRTOS) so the implementation is heavily built on the ISR and a state machine within the ISR.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-12-20 12:38 AM
Look at
I think it can do what you need.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-01-05 4:46 AM
The versaloon website seems offline. At the moment, there is some effort on the OpenOCD list around SWIM. Join the discussion.
https://sourceforge.net/p/openocd/mailman/openocd-devel/?viewmonth=201701
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-01-09 6:42 AM
FYI: the STlink programmers firmware encryption had been broken, so you could easily get the firmwares. If you are familiar with ASM you could quiclky get an overview how they implemented it.
