I want to flash a KEAZN64 M0+ device via SWD. This should be realized by a host processor instead of a programmer so I have to implement the host code.
The protocol basics are working and I'm already able to write and verify data in the RAM via AHB-AP but not yet into flash.
To do that I have to erase the flash first, but what is the correct sequence?
I use an appnote from another vendor AN0062 link as base and try to adapt it to the NXP KEA M0+ target.
I chose the simple variant (direct write to msc registers) without a flash driver that is loaded into the target RAM to keep it as simple as possible.
I traces the communication between the KEAZN64 and a programmer (PE Micro universal FX) but it’s hard to find the correct sequence part for erase and flash.
Maybe you can help me?
Thanks a lot
Daniel
Hej Alexis ,
thanks a lot for the answer.
Do I have to halt or reset the controller before I make the full erase?
Thanks
Daniel
Hi Alexis ,
thanks a lot. the description helps to create a flash sequence.
the problem no is that I always get a ACK_WAIT when I try to access the FTMRH registers
Do I need other AP settings?
thanks a lot
Daniel
Request AccessPort Write CSW |
Turnaround |
ACK OK |
Turnaround |
WData 0x22000012 reg CSW bits DbgSwEnable=0 |
Data parityok |
Trailing bits |
Request AccessPort Write TAR |
Turnaround |
ACK OK |
Turnaround |
WData 0x40020000 reg TAR |
Data parityok |
Trailing bits |
Request AccessPort Read DRW |
Turnaround |
ACK OK |
WData 0x00000000 reg DRW |
Data parityok |
Request DebugPort Read RDBUFF |
Turnaround |
ACK WAIT |
Request DebugPort Read RDBUFF |
Turnaround |
ACK WAIT |
Request DebugPort Read RDBUFF |
Turnaround |
ACK WAIT |
Request DebugPort Read RDBUFF |
Turnaround |
ACK WAIT |
Request DebugPort Read RDBUFF |
Turnaround |
ACK WAIT |