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/AM3352: JTAG connection to Cortex-A8 fails after wakeup from DeepSleep1

Part Number: AM3352
Other Parts Discussed in Thread: SYSBIOS, AM3358, OMAP3530, AM4379

Tool/software: Code Composer Studio

Hi,

I would like to debug Cortex-A8 using CCS after AM335x wakes up from DeepSleep1.

I have confirmed already that AM335x can be placed in DeepSleep1 and wake up by GPIO. (using BBB and Starterware demo app)
This app has no problem, it works as expected.

However, after AM335x wakes up from DeepSleep1, I cannot connect to Cortex-A8 using CCS.
Before AM335x is placed in DeepSleep1, both cores(Cortex-A8/Cortex-M3) can be connected using CCS.
Cortex-M3 can be connected and debugged after wakeup.

Using JTAG emulators are XDS100v2 and Blackhowk USB560v2, they are the same results.

Error messages are as follows.

At first,
--------
Error connecting to the target:
(Error -1170 @ 0x0)
Unable to access the DAP. Reset the device, and retry the operation. If error
persists, confirm configuration, power-cycle the board, and/or try more
reliable JTAG settings (e.g. lower TCLK).
(Emulation package 7.0.100.1)
--------

then, the connection will succeed if it retry, but when I try debugging,
--------
CortxA8: Error connecting to the target: (Error -1170 @ 0x0) Unable to access the DAP. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 7.0.100.1)
CortxA8: Can't Single Step Target Program: (Error -2134 @ 0x0) Unable to control device execution state. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 7.0.100.1)
CortxA8: Trouble Reading Register CP15_Registers.CP15_CONTROL_REGISTER: (Error -2131 @ 0x20013F00) Unable to access device register. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 7.0.100.1)
CortxA8: Trouble Reading Register CP15_Registers.CP15_MMU_XLATION_TABLE_BASE_CONTROL: (Error -2131 @ 0x20023F40) Unable to access device register. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 7.0.100.1)
CortxA8: Trouble Reading Register CP15_Registers.CP15_CONTROL_REGISTER: (Error -2131 @ 0x20013F00) Unable to access device register. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 7.0.100.1)
CortxA8: Trouble Reading Register CP15_Registers.CP15_MMU_XLATION_TABLE_BASE_0: (Error -2131 @ 0x20023F00) Unable to access device register. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 7.0.100.1)
CortxA8: Trouble Reading Register CP15_Registers.CP15_MMU_XLATION_TABLE_BASE_1: (Error -2131 @ 0x20023F20) Unable to access device register. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 7.0.100.1)
CortxA8: Trouble Reading Register CP15_Registers.CP15_MMU_DOMAIN_ACCESS_CONTROL: (Error -2131 @ 0x20033F00) Unable to access device register. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 7.0.100.1)
....
--------

after that, CortexA8 will be in uncontrollable state.

Best Regards,
Yasun

  • Hi,

    What is the CCS release version and do you update the emulation package to the latest? Is the host PC windows or Linux?

    To reproduce your issue, is that possible you send us the binary file that put A8 into deep sleep then wakeup? Does this have any hardware/EVM dependence? E.g., if we use AM335x GP EVM, or iceAM335x board (in case we can't find BBB), will the binary run and we expect to see the same issue?

    Also, please provide the procedure to reproduce the issue? Like:
    1. Connect A8, running GEL to initialize the SOC?
    2. Load binary and run?
    ....

    Regards, Eric
  • Hi Eric,

    Thank you for your reply.

    I use:
     the CCS release version is v7.2.0.
     the host PC is windows10.

    I confirmed it using the latest version(CCSv8.2.0, EMUpack 8.0.803.0), but it was the same.

    My environments are:
    - AM335x GPEVM + Starterware demo app
    - BeagleBoneBlack(or AM335x GPEVM) + SYSBIOS app
    -> Booting from SD Card (MLO and app).

    Any cases, Cortex-A8 cannot be connected after wakeup from DeepSleep1.
    So, I think this does not have any hardware/EVM dependence.

    My issue is reproducible as follows.

    Hardwqare:
     AM335x GPEVM, SD Card
    Software:
     AM335X_StarterWare_02_00_01_01: prebuild image
      binary/armv7a/cgt_ccs/am335x/evmAM335x/bootloader/Release_MMCSD/MLO
      binary/armv7a/cgt_ccs/am335x/evmAM335x/demo/Release/app

    Procedure:
    1. Boot from SD Card (MLO and app).
    - demo app (is controllable by UART console or TSC) runs.
    2. Select "PM Demo".
    3. Select "GPIO wake source".
    4. Select "DS1 power mode". AM335x will put into DeepSleep1.
    5. Push SW9 on AM335x GPEVM. AM335x will wake up.
    6. Connect A8, not running GEL.
    - first error message is shown.
    7. Click retry button.
    - JTAG connection will success.
    8. Try to debug, the error messages are shown. Any debug command(Step Into, Run, etc) fails.

    Best Regards,
    Yasun

  • Hi, Eric

    Is there any update?
    Please teach me if you have any information about it.

    I confirmed it using PROCESSOR-SDK-LINUX-AM335X 05_01_00_11 and AM335xSDK 06_00_00_00(Linux).
    AM335x will put into DeepSleep0 in the Linux environment, the behavior was the same, I was not able to debug the Cortex-A8. (The connection was successful.)
    But, the debug commands(run, asmStepIn, asmStepOver, etc) did not work shown the same error messages.

    Additionally, I found that Global Cold Software Reset may be effective.

    By Issuing a Global Cold Software Reset(RST_GLOBAL_COLD_SW bit to 1) after AM335x was woke up from DeepSleep1, the debug commands to Cortex-A8 did work as expected after AM335x was rebooted.
    Using a Warm Software Reset(RST_GLOBAL_WARM_SW bit to 1) instead of a Global Cold Software Reset, the debug commands to Cortex-A8 did not work even after AM335x was rebooted.

    I think that debugss or/and emulation logic in AM335x(or Cortex-A8) has not been restored completely.
    Are there any possible reasons?

    Best Regards,
    Yasun
  • Yasun,

    Can you try one option? After Linux finishes booting, can you connect to the A8, enable the Low power run option and put the core to run again?

    To enable this option, go to menu Tools --> Debugger Options --> Misc/Other options and check the box near "Allow power transitions while running if supported (low power running).

    If I recall correctly, the AM335x family of devices fully supported this option.

    Please give this a try and see if it improves the stability.

    Regards,
    Rafael
  • Hi Rafael,

    Thank you for your reply.

    I did try it.

    1. connect to the A8.
    2. enable the Low power run option.
    3. put the core to run again.

    then,
    4. put into DeepSleep0 (execute "echo mem > /sys/power/state").
    5. input any key (to wakeup with UART).

    This point, the A8 was halted automatically on CCS Debugger.
    - The PC(Program Counter) is 0x403003D4.
    - The ipc_reg0 value(return address) is 0x40303D0.

    At the same time, the following error message was displayed.

    CortxA8: Trouble Reading Register PC: (Error -2062 @ 0x0) Unable to halt device. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 8.0.803.0)

    6. put the A8 to run again.

    This point, the A8 was disconnected automatically.
    At the same time, the following error message was displayed.

    CortxA8: Can't Run Target CPU: (Error -2134 @ 0x0) Unable to control device execution state. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 8.0.803.0)
    CortxA8: Power Failure on Target CPU

    The console on Linux freezes and there is no response.

    7. connect to the A8.

    The A8 was halting at 0x00000010(=PC).
    There are unexpected values displayed in the Disassembly and Memory Browser.

    Try to execute the debug command, the A8 was disconnected automatically.
    The debug command did not work, the error messages was displayed.

    CortxA8: Trouble Reading Register CP15_Registers.CP15_CONTROL_REGISTER: .....etc.

    After, can not connect to the A8.

    Even in this condition, we can debug the M3.
    The debug commands(including connect/disconnect) to the M3 works as expected.

    The behavior was almost the same.
    I think that the route cause is the same.

    Regards,
    Yasun
  • Yasun,

    I was not able to see the same behaviour as you on my AM3358 Starter Kit, but it may be a problem in the example I am running: the standby process from the Matrix GUI application. In my case, the processor never recovers from the standby.

    In conversations with a device expert he mentioned that, depending on the sleep mode being used (deep sleep), the debug subsystem is also turned off completely, which may cause sync problems with some or all cores. Since you are able to debug the M3, there is a chance this is not the case, but I can't yet tell for sure.

    At any rate, I re-tested this feature on the Cortex A9 core of my AM437x Starter Kit and the problem does not manifest itself in that platform.

    At this point I can only tell that AM335x is not working but I will have to build the Starterware SD card and validate the same procedure as yours. I will get back with further information.

    Regards,
    Rafael
  • Try running this command before you connect:

    devmem2 0x44e00414 w 0x12500002

    FYI, that's mentioned in a note on this page:

    http://processors.wiki.ti.com/index.php/Debugging_AM335x_Suspend-Resume_Issues

    Here's the note:

    Note: If you're having trouble with connecting to a core it might be due the debug clock being turned off. If that's the case, reboot your board and from the console you can poke the CM_WKUP_DEBUGSS_CLKCTRL register by executing "devmem2 0x44e00414 w 0x12500002".

  • Rafael,

    I'm sorry. You may need to modify the kernel source.
    I have been change the kernel source as follows.

    --- a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
    +++ b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
    @@ -205,6 +205,7 @@ static struct omap_hwmod am33xx_debugss_hwmod = {
    .name = "debugss",
    .class = &am33xx_debugss_hwmod_class,
    .clkdm_name = "l3_aon_clkdm",
    + .flags = (HWMOD_INIT_NO_IDLE|HWMOD_INIT_NO_RESET),
    .main_clk = "trace_clk_div_ck",
    .prcm = {
    .omap4 = {


    I did confirm it using AM3358 Starter Kit + PROCESSOR-SDK-LINUX-AM335X 05_01_00_11.
    In my case, the behavior was the same as the above description for AM335xEVM.

    I have been using arago-base-tisdk-image-am335x-evm for root filesystem.
    I have been executing commands on serial console, not using the Matrix GUI application.

    Regards,
    Yasun
  • Hi Brad,

    Thank you for your information.

    I tried "devmem2 ..." before connect to A8, but it was not effective.
    CM_WKUP_DEBUGSS_CLKCTRL(0x44e00414) value is 0x52580002 before writing.

    I would like to debug the validity of the restore operation after AM335x was woke up.
    So, Resetting the board(AM335x device) is not able to became a workaround in my case.

    Regards,
    Yasun
  • I just did a quick test using CCS 8.2, Blackhawk XDS560v2 emulator, and BeagleBone Black running Linux SDK 5.01 binaries.  Here are my observations:

    1. I couldn't connect in any capacity until I ran devmem2 0x44e00414 w 0x12500002.
    2. I could initially connect to Cortex A8 (i.e. prior to suspend/resume).  I looked at Core Registers, and click run/halt several times.  Everything kept running.
    3. After suspend resume (echo mem > /sys/power state) the Cortex A8 became very difficult.  I got a connection error initially, though upon retrying I was able to connect.  However, it was misbehaving.  For example, when I hit "run" it would not subsequently allow me to halt.  And the target didn't actually seem to be running.  I had to unplug the emulator to get the target running again.
    4. I was able to connect to the DAP and read memory without issue.

    My impression is that CCS has an issue with the Cortex A8 after suspend/resume.  Maybe Rafael will have some ideas.

    In the interim, Yasun, have you ever used the DAP?  In the "Debug" panel you right-click on your ccxml file and select "Show all cores".  Then you expand the "Non Debuggable Devices" entry that shows up and connect the one that says CS_DAP_DebugSS.  This allows you to open a memory window and view any physical address in the device (i.e. as long as it is visible from the L3 interconnect).  So the main things you CANNOT read are the registers that are internal to the Cortex A8.  If you're looking to checkout pinmuxing, PRCM, peripheral registers, etc. then the DAP is a great option.  In fact, I like it better than the Cortex A8 because you can leave the Cortex A8 running while you're looking at the registers!  And also you don't have to worry about the MMU.

  • Brad,

    Thank you for your replay.

    I have been use the DAP.
    I will use the DAP for PRCM, peripheral registers, etc except the Cortex-A8.

    I did try to debug the Cortex-A8 using the Lauterbach debugger and TRACE32 software.
    It became similar behavior, and it was not able to debug the Cortex-A8 after waking up.

    I think that debugss or/and emulation logic has issues after waking up.
    Is there a way to completely restore it?

    Regards,
    Yasun
  • Brad, Yasun,

    I was finally able to do some more testing on this platform. Here is what I found.

    I ran before on Cortex A9 and everything runs as expected, with low power run correctly being acknowledged and the debugger keeping control during the power transition.

    Then, to validate the Cortex A8 platform, I grabbed another platform (I had nothing better than a BeagleBoard with OMAP3530!) and put it to run with a somewhat modern Debian Distro. After booting, I am able to keep full control of the Cortex A8 core via JTAG (just like my AM3358 SK).

    With low power run enabled with the echo mem > /dev/power/state command, I put the core to sleep and CCS throws the following error:

    CS_DAP_PC_0: Error: (Error -275 @ 0x0) The attempt to poll a target device exceeded its timeout limit. The utility or debugger has requested that a target device be repeatedly accessed for a specific data or status value. This has failed because the built-in limit for the maximum number of attempts when polling the JTAG scan-path has been exceeded. (Emulation package 8.0.803.0)

    On this board I was able to recover from the deep sleep well (differently than my AM3358 SK). Attempting to halt the Cortex A8 core, however, throws the error below:

    Cortex_A8_0: Trouble Halting Target CPU: (Error -6311) PRSC module failed to write to a register. (Emulation package 8.0.803.0)

    Given the core went through a power cycle, I simply disconnected and re-connected to the Cortex A8 core. This time I was able to successfully connect, have full control and put the core to run and halt without any issues.

    This shows that the low power behaviour is heavily dependent on the hardware (and maybe software as well).

    Tomorrow I will test Debian on my BeagleBone White and see if I can get another datapoint.

    Regards,
    Rafael
  • Brad, Yasun,

    Please apologize for the delay; it took me a while to get all the details to do a proper setup on my BeagleBone Black.

    I am running into the same issue as before with the AM3358 SK: after the board goes to power down, it can't recover anymore - with or without JTAG. It does not throw any errorrs and anything else, but I really can't get a clean cut case as I could with the OMAP3530 device or the AM4379.

    In this case, I really don't know where to go from here. The function seems to be working with a Cortex A9 device (thus ruling out anything with the debugger itself) and with another Cortex A8 device (thus ruling out anything intrinsically related to the Cortex A8 driver).

    Perhaps the processor or the Linux experts would have a better idea on what may be going on? Somethign that needs to be done on the Cortex M3 core perhaps (as it says it is a WAKEUP device)?

    Please advise.

    Regards,
    Rafael