SWD Programming Can't Write Stack Pointer

cancel
Showing results for 
Search instead for 
Did you mean: 

SWD Programming Can't Write Stack Pointer

230 Views
tialin
Contributor I

Hi all,

I am trying to use a microcontroller(KL16) to program another microcontroller (KL02) via SWD. 

I followed AN4835. after successfully mass erase the KL02. The program also seems to works fine with nether Flash Access Error Flag nor Flash Read Collision Error Flag. 

The FTFA cmd I used was Program Longword 

After the programming finished I try to read back and verify. Everything matched up but the following 3 register. 

0x0000_0000 0 — — ARM core Initial stack pointer

0x0000_0004 1 — — ARM core Initial program counter

0x0000_0008 2 — — ARM core Non-maskable interrupt (NMI) .

They all read 0xFFFFFFFF. 

Thanks!

Tia 

Labels (1)
Tags (2)
0 Kudos
1 Reply

96 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Tia Lin,

   Do you mean, except the front 3 32bits can't be programmed, other flash address are all can be programmed?

  Could you share some code about controlled the SWD interface to program the external flash with me? I need to check it at first.

Besides, please also post some debug result, include the unsuccessful readout and the successful result.


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos