This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/TMS570LC4357: CCS/AJSM GUI functionality

Part Number: TMS570LC4357
Other Parts Discussed in Thread: TMS570LS3137, HALCOGEN

Tool/software: Code Composer Studio

Hello.

My main goal is to lock the TMS570LC4357 device by AJSM and temporarily unlock it at CCS debugging with GUI usage.

If you have this example/template – please share it with me.

 

But I used the described in the “spna232a” approach to configure CCS and it constantly fails.

See please my details below.

Code Composer Studio, Version: 8.3.1.00004

HW: TMS570LC4357: HDK and LaunchPad. And TMS570LS3137 HDK.

Before to set my key to lock the device I decided to test and check connection with AJSM functionality. So I kept the originally programmed visible key in OTP memory and tried to access and unlock the device with “zero-key”.

 

1)      CCS GUI

I downloaded the “spna232.zip”. Copied ‘ajsm’ folder to GEL files as described. Created ‘tms570lc43xx_secure.xml’ file as described in ‘readme.txt’. And used the available ‘rm57l8xx_secure.xml’ as example. Copied the created .xml file to corresponded folder. Then I created the appropriate project and got Port18 and AJSM key value in Target configuration as supposed:

After that I try to debug the application and press ‘F11’ key. I get a constant error:

AJSM: Error: (Error -2010 @ 0x0) Internal error: Invalid parameter passed to function. Restart the application. If error persists, please report the error. (Emulation package 8.3.0.00003)

AJSM: Unable to determine target status after 20 attempts

AJSM: Failed to remove the debug state from the target before disconnecting. There may still be breakpoint op-codes embedded in program memory. It is recommended that you reset the emulator before you connect and reload your program before you continue debugging

Dap: GEL: Error while executing OnPreTargetConnect(): Connect failed

       at GEL_Connect() [ajsm_util.gel:50]

       at AJSM_Unlock()

       at GEL_EvalOnTarget("AJSM", "AJSM_Unlock()", 1) [dap_util.gel:46]

       at OnPreTargetConnect()

CortexR5: GEL Output:     Memory Map Setup for Flash @ Address 0x0CortexR5: GEL Output:      Memory Map Setup for Flash @ Address 0x0 due to System Reset

CortexR5: GEL Output:     Memory Map Setup for Flash @ Address 0x0 due to System Reset

 

2)      Command line check with “dbgauth”

I successfully connected and unlocked the device with “dbgauth” command line access. See please the result:

I copied and renamed the “testBoard” file (which was obtained at board “Test connection”) to the “570Lnx-WithAjsmPort.dat” and used it here. You can see the device is unlocked. And please note it does not matter which key I use in command line.

3)      After that I updated the emulation pack to last one, version 8.04. And tried to debug the application. I see the same error:

And there is the copied text output :

AJSM: Error: (Error -2010 @ 0x0) Internal error: Invalid parameter passed to function. Restart the application. If error persists, please report the error. (Emulation package 8.4.0.00006)

AJSM: Unable to determine target status after 20 attempts

AJSM: Failed to remove the debug state from the target before disconnecting. There may still be breakpoint op-codes embedded in program memory. It is recommended that you reset the emulator before you connect and reload your program before you continue debugging

Dap: GEL: Error while executing OnPreTargetConnect(): Connect failed

       at GEL_Connect() [ajsm_util.gel:50]

       at AJSM_Unlock()

       at GEL_EvalOnTarget("AJSM", "AJSM_Unlock()", 1) [dap_util.gel:46]

       at OnPreTargetConnect()

CortexR5: GEL Output:     Memory Map Setup for Flash @ Address 0x0CortexR5: GEL Output:      Memory Map Setup for Flash @ Address 0x0 due to System Reset

CortexR5: GEL Output:     Memory Map Setup for Flash @ Address 0x0 due to System Reset

 

4)      Command line check with “dbgauth” works properly again.

5)      I decided to check with other device. I downloaded the project from this topic:

https://e2e.ti.com/support/microcontrollers/hercules/f/312/t/686560

And tried to debug it, see please the result:

You can see the introduced into “tms570ls3137_ajsm_unlock.gel” GEL file call of the “dbgauth” command line utility unlocks the device correct.

But the configured in the GUI unlocking functionality fails on calling the functions in corresponded GEL files in ajsm folder.

6)      So I report the error on this functionality

 

And one more – my main goal is to lock the TMS570LC4357 device by AJSM and temporarily unlock it at CCS debugging with GUI usage.

Please share the example/template how to do that.

 

Thanks in advance,

Oleg.

  • Hello Oleg,

    You said your device is not locked. How does the wrong unlock key (00112233445566...) work? BTW, the number used in your test is not the unlock pattern generated by HALCOGen.

    If the device is not AJSM locked, the default visible lock key is: 0XFFFDFFFF_FFFFFFFF_FFFDFFFE_FFEFFFFF, and unlock key should 0x00000000_00000000_00000000_00000000

  • Hello QJ.

    Thank you for quick response.

    1) You are right absolutely – my device is unlocked with original code from manufacture (as you say: 0XFFFDFFFF_FFFFFFFF_FFFDFFFE_FFEFFFFF). And my unlocking code (00112233445566...) is not unlock pattern. But….

    2) As I wrote in initial comment – the unlock code does not matter for “dbgauth” command line case. I tried to apply different unlock keys – and it works!

    You can check on your test bed – and will get the same result.

    3) Moreover, you may see the “correct” from the Halcogen key on the screenshot for LS31 device – it also successfully unlocks originally visible device (my LS31 is NOT locked also).

    4) In addition I might suppose if the .dat file (which I got it by clicking “Test connection”) contains the key value (“zero” all words), so “dbgauth“ skips the key parameter defined by ‘-k’ option.

    But I changed the key values in .dat file and it also does not matter for “dbgauth” unlocking of NOT locked device. Just in case see please my .dat file:

    ===================================

    # config version=3.5

    $ sepk

    pod_drvr=jioxds110.dll

    pod_port=0

    pod_supply=0

    pod_voltage_selection=0

    pod_voltage=0

    $ /

    $ product

    title="Texas Instruments XDS110 USB"

    alias=TI_XDS110_USB

    name=XDS110

    $ /

    $ uscif

    tdoedge=FALL

    tclk_program=DEFAULT

    tclk_frequency=5.5MHz

    jtag_isolate=enable

    $ /

    $ dot7

    dts_usage=nothing

    $ /

    $ swd

    swd_debug=disabled

    swo_data=aux_uart

    $ /

    @ icepick family=icepick_c irbits=6 drbits=1 subpaths=3 systemresetsupported=1

    & port18 address=18 default=no custom=no force=yes pseudo=no cancelreset=0x0

       @ ajsm family=ajsm irbits=4 drbits=1 unlock_key_w0=0x0 unlock_key_w1=0x0 unlock_key_w2=0x0 unlock_key_w3=0x04

    & port17 address=17 default=no custom=no force=yes pseudo=no cancelreset=0x0

    & port16 address=16 default=no custom=no force=yes pseudo=no cancelreset=0x0

       @ dap family=cs_dap irbits=4 drbits=1 subpaths=1 identify=0 revision=Legacy systemresetwhileconnected=1

         & portr5 type=debug address=0 default=no custom=no force=no pseudo=no

           @ cortexr5 family=cortex_rxx irbits=0 drbits=0 address=0x80001000 identify=0x02000100 traceid=0x1

         & /

    & /

    # /===================================

     

     

    5) But the main problem – CCS reports the permanent error when AJSM is configured by GUI in accordance with SPNA232.

    Please repeat what I did – and you will get the same results.

    Hope I explained everything clear. Please let me know if you need any additional info from me to reproduce the situation.

     

    Thanks and regards,

    Oleg.

  • Hello,

    Any unlock key except for 0x00..00 doesn't work. The AJSM module XOR the unlock key and the OTP content to generate "FFEFFFF_FFFDFFFE......"(default value in OTP).

    If you use 00112233...ff, the output of XOR is FFFEDDCC..... which doesn't unlock the device. 

    I tried on my bench:

  • The maximum speed of XDS110 USB is 2.5MHz. How did get 5.5MHz in your config file?

  • Hello QJ.

    Your screenshot reports another (not concerned to the key) error: 

    "Failed to find the specified device name in the board config info"

    Please fix the device name and then you will be able to work with key (if no another errors in the config file).

    Please try it again after fix.

    Thanks in advance,

    Oleg

  • QJ,

    to respond another your question related to XDS and its frequency.
    I get the "testBoard.dat" file from my CCS when I click button "Test Connection".

    Specially to check again - I just generated 2 files. First - for my project with AJSM port. Second - it is downloaded from TI your "TMS570LC4357_UART_Boot" project.
    I compared the both files - they are identical. Only one difference - presence of AJSM port.
    The screenshot of comparison is attached.
    And please let me know if you prefer I to send you both .dat files

    I guess it does not mater what frequency CCS reports if I am able to connect to the device successfully. ...but I maybe wrong...

    Thanks,
    Oleg

  • QJ,

    Let me append the additional info to my comment above on fail you got on device name.
    I have identified this error - it appears when to use another device type in command line than in .dat file.
    In your command line you use "cortexr5" parameter but seems your .dat file contains 'cortexr4' or another device type.

    I just generated the same with yours fail by changing the command line parameter to "cortexr4" from "cortexr5", but my .dat file relates to the R5 device. See please the attached screenshot - the same fail as yours.
    So please correct it and try to test again.




    Thanks,
    Oleg

  • QJ,

    And one more.
    The main problem - CCS AJSM GUI functionality fails with reporting of internal error if to follow the GUI configuration method described in SPNA232.
    So please identify the cause and fix it.

    Or provide the info me how to configure this functionality correctly.


    Thanks in advance,
    Oleg

  • QJ,

    And additional info to you.
    Based on your output it seems your .dat file does not contain AJSM debug port (Port18) info.
    Please check and configure it properly if required.

    Thanks and regards,
    Oleg

  • Hello QJ.

    Could you or somebody else to help me with this subject?

    Thanks in advance,
    Oleg.

  • I locked one LC4357 device with AJSM, and unlocked it with the unlock key generated through the HALCOGen

  • Hello TI engineers.

    There is no response from you for about 2 weeks.
    Could you please tell me if somebody is able to help me with this fail/problem?

    Please respond me 'yes/no' - so I will understand what way to move forward.
    Silence from you puts me in indeterminate state which harms my business.

    Thanks in advance,
    Oleg.

  • Hello TI engineers.

    There is no response from you for about 2 weeks.
    Could you please tell me if somebody is able to help me with this fail/problem?

    Please respond me 'yes/no' - so I will understand what way to move forward.
    Silence from you puts me in indeterminate state which harms my business.

    Thanks in advance,
    Oleg.

  • Hello Oleg,

    As I mentioned before, the unlock key for the default OTP value at 0xF0000000 0s 0x00000000_00000000_00000000_00000000. It is not possible to unlock the device with a wrong unlock key for example 0x00112233445566778899aabbccddeeff.

  • You said that your TMS570LS3137 AJSM was unlocked successfully, but JTAG connection failed. Was the device locked successfully? Is the unlock key generated through HALCOGen? 

    Can you please tell me the HALCOGen version you used to generate the AJSM lock key and unlock key?

  • The issue had been resolved in other thread:
    e2e.ti.com/.../915636

    So I close this one.