MKL02 Debug Error on Multilink FX with CW 11.1

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

MKL02 Debug Error on Multilink FX with CW 11.1

1,367 Views
aarathiramesh
Contributor I

Hello,

 

I am using CodeWarrior v11.1 with PE Micro Mulilink FX debugger. I use the UART of the MKL02Z16M4. When I debug the code with PE Multilink Universal FX connected to the board and powering the target it works perfectly. I am checking the code via Docklight script. I am unable to free run the code.

Also, I am unable to suspend or stop the debug session when I power the target board externally. The debug session when the target is powered externally does not respond on UART. The following error appears, "GDI Protocol Adapter : An error occurred while trying to write memory. The Debugger can not write memory." when I pause or stop the debug session to read the port registers.

Please suggest remedies for the above issues.

Thanks.

0 Kudos
6 Replies

1,290 Views
Sabina_Bruce
NXP Employee
NXP Employee

Hello Aarathi,

Hope you are doing well.

Could you please describe the steps you are taking to reproduce this behavior. I am confused by your initial description

When I debug the code with PE Multilink Universal FX connected to the board and powering the target it works perfectly.

then you mention

I am checking the code via Docklight script. I am unable to free run the code.

So from my understanding is everything is working perfectly fine until you check the code via Docklight. Is that correct? 

 

Best Regards,

Sabina

-----------------------------------------------------------------------------------------------------------------------

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

----------------------------------------------------------------------------------------------------------------------- 

0 Kudos

1,290 Views
aarathiramesh
Contributor I

So the code started working after the debugger was disconnected and a power reset was done on the target board. 

We have an application where we need to trigger an interrupt on either edges at a GPIO input (PTB5) of MKL02Z16. The configuration is done as below:
PORTB_PCR5 &= 0xfff0f9a8; 
PORTB_PCR5 |= 0x000b0100; // Mux Option Alt1 for GPIO, Interrupt on rising or falling edge 

And the reset pin for SWD is on PTA1 which is pulled up to 3.3V via a 10k resistor and 0.1uF capacitor to ground. When we connect the PTB5 to GND which is it's normal operating condition, the reset pin toggles as below and the application does not work:

pastedImage_1.png

When the PTB5 is left floating or pulled up to 3.3V, the reset pin remains high and the other functions operate as expected. But I need the board to operate when the PTB5 is grounded and trigger interrupt when it sees a rising edge at its input. Could you please help me understand why this could be happening? And what should I be looking at to resolve this isssue?

0 Kudos

1,290 Views
Sabina_Bruce
NXP Employee
NXP Employee

Hello Aarathi,

Hope you are doing well.

The NMI function is the default state for PTB5. Since this is designed to interrupt when it is low, you are not reaching your application as it is interrupted directly at power on. If you plan to use it as a GPIO then you must disable it in the startup file, otherwise it will continue to get interrupted before you reach the GPIO configuration.

You may check some useful instructions in the file provided in this post for the KL02:

https://community.nxp.com/message/498496 

Best Regards,

Sabina

-----------------------------------------------------------------------------------------------------------------------

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

----------------------------------------------------------------------------------------------------------------------- 

0 Kudos

1,290 Views
aarathiramesh
Contributor I

Hi Sabina,

Thank you very much for the response. We solved this issue yesterday by disabling the NMI_b in Startup_Code. 

Regards,

Aarathi

0 Kudos

1,290 Views
aarathiramesh
Contributor I

Hello Sabina,

So the code works perfectly on:
1. Debug mode while the debugger powers up the target board and responds on UART lines, but

2. The code enters Debug mode but throws the GDI Protocol Adapter error once the board is powered from the AC mains and does not respond on UART lines. 

I am checking the output of the UART lines over Docklight script commands.

Can you help me with what could I be doing wrong while I am powering the board from Input Mains? I checked the voltage at MCU read 3.3V as expected.

0 Kudos

1,290 Views
aarathiramesh
Contributor I

Hello Sabina,

We are now able to run the code outside debug mode.

We have a new issue:

We are using MKL02Z16VFG4 MCU where we are using PTB5 as an input with PORTB interrupt enabled on either edge. We are able to program the code when the PTB5 is left floating on board, but when the PTB5 is connected to ground which is the required configuration, the Reset Pin (PTA1) toggles continuosly and does not run any required functionality.

0 Kudos