AnsweredAssumed Answered

Need help developing a low level driver for SWIM

Question asked by hiller.dudley on Jul 17, 2014
Latest reply on Dec 9, 2014 by

Dear STM08 Technical support

I am a consultant developing a flash programmer tool for the STM8 that runs on the Teradyne Test Station platform. The end users of this tool will be two high volume users of STM08 devices.

I have so far achieved only partial functionality of the SWIM debug module. And I need further advice to make it work.

My questions will reference document UM0470.

I don’t believe I have achieved successful completion of the eight step sequence described on page 10. I get to step 6 “Write 0A0h in the SWIM_CSR”. I assume at this point I need to do a WOTF 01 00 F7 80 A0. The STM08 returns an ACK for the WOTF command, and every data byte except for the A0 at the end.  At this time the STM08 does not ACK or NACK, it simply floats high.

I do know that the SWIM is at least partially working because I get the first 5 ACK responses. I can induce a parity error, and I get a NACK. If I send an erroneous sequence like an SRST followed by a data byte I get neither NACK nor ACK. Somewhat predictable behavior.

If I simply ignore the final “failure to acknowledge” and proceed to release the reset, any subsequent WOTF commands behave pretty much the same way. An ROTF will reply with all of the correct ACK cycles, however the STM08 does respond to the command. No data is sent back by the STM08.

The device samples that I have are STM08F6266, de-soldered from PCBAs that were sampled to me from a 3rd party. I do not know if they are blank, or programmed, or if the SWIM access has somehow been locked out by firmware. Is this possible?

Other things that I have observed… The SWIM pin did not appear to have its own pull-up. I had to connect a pull-up to the SWIM pin, I used 5.1K. If not, when I got to step 4 of the entry sequence the STM08 would output a continuous low speed frequency instead of a single synchronization frame.

Any further advice that can help me make this work is much appreciated.

Thanks in advance for any information.