Controller gets locked if SWDE pins are configured as GPIO

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

Controller gets locked if SWDE pins are configured as GPIO

927 Views
lavakushreddy
Contributor II

Hi freescale team, We have a serious issue related to SWDE pin configuration for MKE02Z64VQH2 MCU.

we are trying to configure SWDE (SWD_DIO,SWD_CLK) pins as GPIO by writing the SIM_SOPT=0x40 value( in SIM_Init() function).

Controller gets locked after programming it for 3-6 times.Updating the SIM_SOPT register during SIM_Init() , is it the correct method of accesing the SIM_SOPT register. 

0 Kudos
Reply
2 Replies

627 Views
perlam_i_au
Senior Contributor I

As you mention SWD_DIO and SWD_CLK could  be configured to be used as GPIO ( as PTA4 and PTC4 respectively), with SIM_SOPT=0x40 instruction you are disabling the SWD function but you also need to complete some configurations, you must consider relationship for configuration settings on Figure 11-1. Normal I/O Structure, specially check and configure GPIOx_PDDR registers.

I really would like to reproduce the error, I certainly would like to take a look on your project if you want to share it. Please keep in touch and let me know what happens.


Have a nice day,
Perla Moncada

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

0 Kudos
Reply

627 Views
sys
Contributor III

Hello, I'm having similar issue, it seems that after some programmations when using that pins as GPIO, the controller gets locked, or BDM cannot communicate with controller.

After entering in this conditions, the controller gets OK again after:

1) power off the controller

2) Unplug BDM

3) Power on controller

4) Wait for pins to go back to SWD mode

5) Plug again BDM

At this point it go back work.

We use those pins in this way:

1) Reset bit SIM_SOPT_SWDE_MASK in SIM_SOPT

2) Configure GPIOx_PDDR, PORT_PUEL, GPIOA_PSOR, GPIOA_PCOR, GPIOA_PIDR

3) Do some stuff

4) Set to back configurations for  GPIOx registers

5) Set bit SIM_SOPT_SWDE_MASK in SIM_SOPT

And it happens that the next programmation doesnt work, until I do the operations I listed above.

Is there some news in this discussion that can help me?

Thanks in advance,

Sandro

0 Kudos
Reply