I need to be able to upgrade the firmware in a Kinetis KL25 in the field from another microcontroller. Where can I find the SWD commands to unlock, write, and verify the Kinetis' onboard flash?
Hi, Mstreet
If you want to use another MCU to program KL25, I think you have to use GPIO to simulate SWD protocol. For protocol, you can find from ARM site. Resourcing is opened.
Hope my reply can help you.
Best Regards
Paul
Hi Paul,
I was planning to use GPIO as you suggested and have downloaded the ARM Debug Interface specification. Is all of the information needed to write the Kinetis flash memory included in this document, or are there Kenetis specific commands or debug memory interfaces that I need to know about?
Hi, Mstreet
Kinetis SWD has no special requirement. You can use ARM opening protocol and GPIO to simulate.
Hope my reply can help you.
Best Regards
Paul
Hi Paul,
i also have similar requirement to program the flash memory through SWD. I found a document from Freescale AN4835 which talking about how to connect to the SWD. But after I connect, how to do the erase, program section, read operations? How to send all those flash commands through SWD?
Thank you in advance.
Another solution for that field upgrade would be to use a FRDM board with the MSD bootloader. This works out of the box, see Using the Freedom Board as SWD Programmer | MCU on Eclipse
Erich
Thanks Zhe,
While looking for how to do this, I found libSWD, which appears to support such bit-banging:
Pgo and Paul,
So, it sounds like I can access the Kinetis flash memory module using SWD to reprogram the flash. Thanks for your answers!
Hi Paul,
Missed that - I'm used to the other Kinetis devices.
bye
Hi Paul,
The SWD protocol is more easily simulated with the SPI interface on the Kinetis devices, in particular the K20 devices are convenient because they allow variable-length transactions. You can refer to the source for USBDM firmware for example code.
The programming of the Flash is described in the Device Manual and has nothing to do with the SWD protocol. You should also consider using the EZPORT protocol which does not require target code execution. This is also described in the Device manual.
bye
Message was edited by: Peter O Donoghue
As has been pointed out by Paul - The KL series devices don't have EZPORT.
bye
Hi, Pgo
KL25 has not EZPORT in it. So we cannot use such SPI way.
Hope my reply can help you.
Best Regards
Paul