KL02Z inconsistent SWD response

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

KL02Z inconsistent SWD response

721 Views
haimf
Contributor I

Hi,

I'm hoping for some guidance in regards to using SWD to access the FRDM-KL02Z board.

I connected 2 GPIO pins on my board to the SWDIO and SWDCLK pins on the board for SWD access to the FRDM-KL02Z board.

I was using the instructions on this forum discussion

https://community.freescale.com/thread/350691

to configure the SWD initialization sequence, and I was able to read the IDCODE and get access to the access port.

The problem I encounter is inconsistency in the board response. I am able to recreate it as follows:

Initialization sequence:

  • SWDCLK is set to output.
  • Host turns SWDIO into an output and drives it high, SWDCLK is strobed from high to low 64 times.
  • 0x9E is sent LSb First over SWDIO by the host
  • 0xE7 is sent LSb First over SWDIO by the host
  • Host turns SWDIO into an output and drives it high, SWDCLK is again strobed from high to low 64 times
  • SWDIO is set low and the clock is strobed once
  • Header to read IDCODE is formed and sent, ACK OK received, 32 bits of Data recieved, 1 parity bit received, Data is 0x0BC11477

I then, try to redo the last action- read the IDCODE many times.

After several retries (the amount of retries is inconsistent) of successful reads, I get a fault ACK- which can be 0x4 or 0x7 (which are illegal ACKs in debug port accesses), and I have to redo the init sequence in order to be able to read again.

This problem happens in all kind of read/write operations to the debug and the access ports. I used scope to get the signals coming from the board, and I see that the ACK signals are indeed faulty.

Do you have any idea, what might cause this inconsistency in the board’s response?

Many thanks,
Haim

0 Kudos
2 Replies

483 Views
miduo
NXP Employee
NXP Employee

Hi, Haim

Sorry for the late response. Regarding your issue, did you mean that you have used one FRDM-KL02Z to programming another FRDM-KL02Z? If I am understaning is correct, please let me know if you had effectively isolate the on-board MCU from the OpenSDA debug interface of the programmed FRDM-KL02Z? Please sent me the schematic for reivew if possible.

0 Kudos

483 Views
haimf
Contributor I

Hi Fang Li,

I have connected the FRDM-KL02Z to another board (FRDM-KL02Z) and I am using the GPIO pins on my board to toggle the SWDIO and SWDCLK pins on the KL02Z.

As I mentioned, I was able to initialize the SWD connection and get communication running between the 2 boards. The problem is, after several SWD commands (which the KL02Z returns OK ACK) I am getting a faulty ACK (0x4) from the KL02Z and I must reinitialize the SWD connection.

Can you tell what might cause this inconsistency in the board’s response?

Thanks,

Haim

0 Kudos