USB TAP: secure debug challenge/Response

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

USB TAP: secure debug challenge/Response

Jump to solution
2,887 Views
nobelsharanyanj
Contributor III

Hi,

When I tried to re-flash the bootloader USB Tap is not getting connected.

For your information:

I am using P1010 custom board, by default it boot from NOR flash. I am getting U-boot log but get hang when it start to configure DDR. In our board we use fixed ram rather than SPD.

That mean, I have not yet configured the DDR completely.

 

When I tried to reflash the corrected code my USB tap is not getting connected and it is throwing error. let me know how to configure CodeWarrior IDE.

 

125124_125124.pngScreenshot from 2016-01-06 18_43_27.png

 

Kindly see the  log below,

ccs_open

    ipaddr = 127.0.0.1

    port = 41475

    timeout = 15

    serverh = 0

    ccs_open; ccs_error = 10

    Error message: Connection refused

ccs_open

    ipaddr = 127.0.0.1

    port = 41475

    timeout = 15

    serverh = 0

    ccs_open; ccs_error = 10

    Error message: Connection refused

ccs_open

    ipaddr = 127.0.0.1

    port = 41475

    timeout = 15

    serverh = 0

    ccs_open; ccs_error = 10

    Error message: Connection refused

ccs_open

    ipaddr = 127.0.0.1

    port = 41475

    timeout = 15

    serverh = 0

    ccs_open; ccs_error = 10

    Error message: Connection refused

ccs_open

    ipaddr = 127.0.0.1

    port = 41475

    timeout = 15

    serverh = 0

    ccs_open; ccs_error = 0

ccs_get_connection_count

    serverh = 0

    count = 1

    ccs_get_connection_count; ccs_error = 0

ccs_available_connections

    serverh = 0

    count = 0

    ccs_available_connections; ccs_error = 0

ccs_available_connections

    serverh = 0

    count = 0

    ccs_available_connections; ccs_error = 0

ccs_config_cc

    serverh = 0

    config_string = utap:0

    ccs_config_cc; ccs_error = 0

ccs_available_connections

    serverh = 0

    count = 0

    ccs_available_connections; ccs_error = 2

    Error message: Network timeout

ccs_kill_server

    serverh = 0

    ccs_kill_server; ccs_error = 14

    Error message: Invalid sequence number

 

Nobel

Labels (1)
0 Kudos
1 Solution
1,798 Views
addiyi
NXP Employee
NXP Employee

“Secure debug violation” is a generic error and this can means a lot of possible errors (DDR initialization failed, corrupt core, invalid JTAG/config_chain and so on) – this way because there is only one error signal/pin and the ccs can’t multiplex all types of hardware errors using it.

If you don't want to init the DDR in initialization file, you have to init at least SRAM and NOR flash, to be able to reprogram your board.

Adrian

View solution in original post

0 Kudos
13 Replies
254 Views
pipi95
Contributor I

I resolved my issue through the following steps and hope this can help others encountering the same problem. I used the method provided by @addiyi  to create the SRAM project, and then configured the NorFlash in the TCL file.

But before doing this, I changed the CPU's startup mode to Holdoff mode by modifying the circuit.

Then in the TCL file, I reset the CPU to the CPU_EN state.

When setting up the Flash programer, I selected a 256K memory segment (0x0~0x20000) for running the Flash programming algorithm.

This way, I was able to successfully connect to the target board and program its Flash to a valid state.

Thanks @addiyi and @yipingwang a lot!

0 Kudos
1,799 Views
addiyi
NXP Employee
NXP Employee

“Secure debug violation” is a generic error and this can means a lot of possible errors (DDR initialization failed, corrupt core, invalid JTAG/config_chain and so on) – this way because there is only one error signal/pin and the ccs can’t multiplex all types of hardware errors using it.

If you don't want to init the DDR in initialization file, you have to init at least SRAM and NOR flash, to be able to reprogram your board.

Adrian

0 Kudos
1,798 Views
nobelsharanyanj
Contributor III

Thanks Adrian,

do freescale provide reference code to do the same.

0 Kudos
1,798 Views
addiyi
NXP Employee
NXP Employee

Yes. When you create a stationary project, select Download SRAM as launch. This launch will use init_SRAM, which will initialize SRAM and NOR flash.

Adrian

0 Kudos
1,798 Views
nobelsharanyanj
Contributor III

Hi Adrian-Mihai,

Still the problem is unresolved.

let me know any other work around to resolve it.

Nobel

0 Kudos
1,798 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Nobel,

As we discussed previously, in the CCS log the error occurs at the following, CodeWarrior fails at connecting to CCS server, doesn't go to the step to connect to the target board.

ccs_available_connections

    serverh = 0

    count = 0

    ccs_available_connections; ccs_error = 2

    Error message: Network timeout

I suggest you create a bare board project in a new workspace, and use this default sample project to connect to the target board. If it this problem remains, you need to consider about reinstall CodeWarrior.

In addition, it seems the above CCS log doesn't coincide with you description, please capture the latest log if necessary. According to your description, it should fail at ccs_config_chain.

For P1010 processor, there is a known issue, if DDR controller has been initialized with improper parameters, secure debug error will be encountered when connecting the target to CodeWarrior.

After power on, your target board execute u-boot on NOR Flash first, it means before connecting to CodeWarror, the target board has already been initialized with improper DDR configure parameters.

So I suggest you configure your target board boot form empty NAND Flash, or use other method(except CodeWarrior) to erase NOR Flash. Then you could use CodeWarrior to connect to your target board.


Have a great day,
Yiping

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

0 Kudos
1,798 Views
nobelsharanyanj
Contributor III

Hi Yiping,

Thanks, We got this issues after we flash the code to bootloader section(0xFFF4_0000) and its due to the improper initialization of DDR controller.

So we tried changing the boot location to NAND flash. But still we can't able to connect/attach or reprogram the board.

FYI, In our custom board we use fixed ram instead of SPD I have modified the same in the code to select fixed ram configuration.

I have few questions,

1. There are different initialization files init_core, init_ROM, init_SRAM, init_uboot, init_uboot_linux. What is the actual purpose of the initialization files. When reset Boot rom code will look for bootloader location based on cfg_boot_loc then why we need to use the initialization files.

2. We are using CodeWarrior USB TAP and 60days evaluation version of codewarrior will this be a reason for the above issues.

3. In a fresh board we are able to erase, write and verify multiple times 80% consistently but when we write the bootloader to corresponding bootloader section(on reset the code get executed) we are unable to reconnect back again. is there any thing related to JTAG connection that we need to take care.

0 Kudos
1,798 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Nobel,

Answer your questions as the following.

1. CW initialization file init_core is used to configure target registers, configure MMU, DDR and IFC controller, just like a small bootloader to initialize the target board, then execute the program(such as flash program algorithm) on RAM. Init_SRAM configures L2 Cache as SRAM to avoid using DDR to run program. Init_ROM is used for initializing some necessary registers to run program from ROM(NOR Flash). Init_uboot is used in debugging u-boot, init_uboot_linux is used in debugging Linux Kernel.

2. As usual, the evaluation CW often includes 30 days license, please check whether your CW license has already expired from Help->Freescale Licenses in CodeWarrior IDE.

3. As I mentioned previously, the incorrect initializing DDR controller is related with JTAG connection to USB/CodeWarrior TAP. On your target, the NOR flash has already been programmed incorrect u-boot, when you reset the board, the DDR controller will be initialized with incorrect parameters first, which cause JTAG connection failed.

Would you please configure your target boot from NAND Flash and capture the CCS log to me in CodeWarrior IDE when connecting to the target?


Have a great day,
Yiping

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

1,798 Views
addiyi
NXP Employee
NXP Employee

The problem with NAND boot location is that if in NAND is not valid code or the NAND is empty, the connection to the board will fail. So, it recommended is to set the board to NOR boot and try using a init file with SRAM and NOR device initialization.

Adrian

0 Kudos
1,798 Views
nobelsharanyanj
Contributor III

hi Adrian,

please find the steps I follow,

001.png

002.png

003.png004.png005.png006.png007.png008.png009.png010.png011.png012.png013.png014.png015.png

after that I configure RUN, and execute button got enable and I tried runing the application but getting the same problem as mentioned in the code.

Let me know the steps I followed is right?

0 Kudos
1,798 Views
addiyi
NXP Employee
NXP Employee

Let's first resolve the connection issue. Please open ccs console (go to Freescale\CW_PA_v10.4.0\PA\ccs\bin\ and run ./ccs). In ccs console run the below commands:

> config cc utap

> show cc

> ccs::config_chain p1010

> display ccs::get_config_chain

> ccs::all_run_mode

and share the output.

Adrian

0 Kudos
341 Views
pipi95
Contributor I

I've encountered a similar issue myself. I ended up unable to connect to my P1010 target board because I mistakenly flashed an incorrect bootloader. I've attached the symptoms I'm experiencing. I'd appreciate your assistance with this. Since my board doesn't have NAND flash, I can't attempt Yipingwang's method using NAND. Looking forward to your response! Thanks very much!

0 Kudos
339 Views
pipi95
Contributor I

Can you help me @yipingwang @addiyi ,Thanks!20240516200745.jpg

0 Kudos