CW-ARMv8 GDB with secure-key, CCS connection issue

cancel
Showing results for 
Search instead for 
Did you mean: 

CW-ARMv8 GDB with secure-key, CCS connection issue

Jump to solution
981 Views
frank_o
Contributor III

We have a board based on ls1043a that we can debug with gdb console found in:

C:\Freescale\CW4NET_v2020.06\CW_ARMv8\ARMv8\gdb\bin\aarch64-fsl-gdb.bat

We have the same board with secure debug enabled and we can successfully unlock with ccs debug console.

When we try to connect to this board with gdb console, we get as expected a message “Secure debug violation”.

We use cw-diag to test this process; this is the expected output since secure debug is enabled.

cw-diag -p cwtap:00:04:9f:05:64:ae -gc :ccs:LS1043A::CortexA53#0 -ca "127.0.0.1:41475"

Output from gdb console:

(gdb) cw-diag -p cwtap:00:04:9f:05:64:ae -gc :ccs:LS1043A::CortexA53#0 -ca "127.0.0.1:41475"

c:\freescale\cw4net_v2020.06\cw_armv8\armv8\gdb_extensions/../gta/gta

Connect to Debug Server

    Version: 1.0.2.200624-492f8acecb5780db5e607d65c425c898d19c3df4 (built on Jun 24 2020 22:23:38)

    PASSED

Connect (telnet) to TAP probe

    Skipped - only available for CodeWarrior TAP - Ethernet connections

Connect to CodeWarrior Connection Server

    PASSED

Start built-in low-level JTAG tests

    PASSED

Attach to CodeWarrior Connection Server

    CCS Release Build 496.0.0.200525-p0

    PASSED

Connect to probe

    PASSED

Power at probe tip

    PASSED

IR Scan

    IR length: 12

    PASSED

Bypass Scan

    Bypass length: 36

    PASSED

TAP state moves

    PASSED

Bit error stress patterns

    Testing all zeros for 500 ms

    Testing all ones for 500 ms

    Testing alternating zeros and ones for 500 ms

    Testing random bit sequence for 500 ms

    PASSED

Scan IDCODE

    Detected IDCODE

    TDO -----

            |

            * Device 0  IDCODE: 5BA00477  Device: ARM DAP rev 5.x

            * Device 1  IDCODE: 06B1001D  Device: NXP LS1043A rev 1.x

            |

    TDI -----

    PASSED

Toggle JTAG reset

    PASSED

End built-in low-level JTAG tests

    PASSED

Connect to target

    CCS: secure debug violation. Please specify the unlock key matching the challenge key 0x0123456789ABCDEF.

    Failed to connect to target

Please check if you are using the correct Target Connection Configuration, and that it is configured correctly.

Since we already have a ccs window open (listening) we see on the console that cw-diag connected to it and everything ran good (except the device is secured)

Then we use cw-diag again passing the response key with -sk parameter:

(gdb) cw-diag -p cwtap:00:04:9f:05:64:ae -gc :ccs:LS1043A::CortexA53#0 -ca "127.0.0.1:41475" -sk 0xAABBCCDDAABBCCDD

c:\freescale\cw4net_v2020.06\cw_armv8\armv8\gdb_extensions/../gta/gta

Connect to Debug Server

    Version: 1.0.2.200624-492f8acecb5780db5e607d65c425c898d19c3df4 (built on Jun 24 2020 22:23:38)

    PASSED

Connect (telnet) to TAP probe

    Skipped - only available for CodeWarrior TAP - Ethernet connections

Connect to CodeWarrior Connection Server

    Failed to connect to locally started CodeWarrior Connection Server

Problems communicating with the CodeWarrior Connection Server may be caused by:

- ports 41475-41491 being in use

- running several CodeWarrior products simultaneously on the same computer

- missing dependencies reported at installation time in Linux environments

- defective / corrupted product layout

You can try to start CodeWarrior Connection Server manually to further diagnose the problem.

Otherwise re-install CodeWarrior.

As you can see, we get a “Failed to connect to CCS server”.  But the server is open and listening. We have tried calling cw-diag many way’s but it is systematic, the CCS connection is always’s good except when we provide the -sk parameter.  Does someone else tried cw-diag with the same behaviour? Why would it not connect to CCS server when parameter -sk is added ?

Regards,

Frank

0 Kudos
1 Solution
940 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please refer to the following solution from the application team.

This is a bug. Customer should update C:\Freescale\CW4NET_v2020.06\CW_ARMv8\ARMv8\gdb_extensions\diagnostics\diag.py:

 

replace:

 

self.ta.set_property(self.params.context.split(':')[2], "secure_debug_key", secure_debug_key)

 

with

 

self.ta.set_property(self.params.context.split(':')[2], "secure_debug_key", self.params.secure_debug_key)

 

It should work.

View solution in original post

0 Kudos
4 Replies
975 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please refer to the following output message provided by you.

Problems communicating with the CodeWarrior Connection Server may be caused by:

- ports 41475-41491 being in use

- running several CodeWarrior products simultaneously on the same computer

Please close all CCS(CodeWarrior Connection Server) consoles, then run the following command.

(gdb) cw-diag -p cwtap:00:04:9f:05:64:ae -gc :ccs:LS1043A::CortexA53#0 -ca "127.0.0.1:41475" -sk 0xAABBCCDDAABBCCDD

0 Kudos
969 Views
frank_o
Contributor III

Hi,

I wish the solution would be so easy, but unfortunately it's not the case.  I did understand the error message and tried that already.  As described in my original post, I tried many combinations and all the ways to connect to CCS or spawn a new one works as expected except when passing the -sk parameter.

cw-diag -p cwtap:00:04:9f:05:64:ae -gc :ccs:LS1043A::CortexA53#0 -ca "auto" -sc

The line above will start a new CCS server and connect to it, but as soon as we add -sk parameter (with all other ccs servers killed) will not try to start or connect to a CCS server; it will just throw the error. We can see that in the task manager that it doesn't try to start a CCS process.

If I already have a CCS server listening and without the -sk parameter, the script will connect to CCS and will pass the "Connect to CodeWarrior Connection Server" step.  In the CCS console, I can see the successful connection.

If I don't have an active ccs server running and start cw-diag without the -sk parameter, the script will spawn a CCS instance and will connect to it.  The script will fail later because device is locked.

Regards.

Frank

0 Kudos
941 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please refer to the following solution from the application team.

This is a bug. Customer should update C:\Freescale\CW4NET_v2020.06\CW_ARMv8\ARMv8\gdb_extensions\diagnostics\diag.py:

 

replace:

 

self.ta.set_property(self.params.context.split(':')[2], "secure_debug_key", secure_debug_key)

 

with

 

self.ta.set_property(self.params.context.split(':')[2], "secure_debug_key", self.params.secure_debug_key)

 

It should work.

0 Kudos
932 Views
frank_o
Contributor III

It work's like a charm now. 

Thank you very much for your support.

0 Kudos