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.

RTOS/TMDSICE3359: CCS project load issue

Part Number: TMDSICE3359
Other Parts Discussed in Thread: AM3359

Tool/software: TI-RTOS

Hello,

I am still very new to the AM335x platform and the tools that go with it. At the moment I am trying to get some simple application running by taking one of the TI examples and changing it to what I want it to do, which at the moment not very much more than simply run.

My setup is: CCS 7.2.0.00013 running on Windows 7. I have the AM3359 ICE V2 development board. My project is using the following parts: GNU v4.9.3 (Linaro) compiler / EDMA3 2.12.5 / NDK 2.25.1.11 / SYS/BIOS 6.46.5.55 am335x PDK 1.0.8 / C:/ti/ccsv7/ccs_base

The components are based on the example application "I2C_Example_icev2AM335x_armExampleProject" which I have used as the basis for my own project. The problem occures with both the example and my own project. When loading the .out file via the CCS debugger, I often get the following error in the debug window:

Texas Instruments XDS100v2 USB Debug Probe_0/CortxA8 (Suspended - SW Breakpoint)	
	do_AngelSWI(int, void *) [C:/Users\hoeksh\workspace_v7\HaHo_TestApp1\Debug\HaHo_TestApp1.out] at 0x80011ED0	
	_kill(int)() at swi.h:78 0x80011ED0 	
	xdc_runtime_Error_policySpin__E(struct xdc_runtime_Error_Block *, unsigned short, unsigned char *, int, unsigned long, int, int) [C:/Users\hoeksh\workspace_v7\HaHo_TestApp1\Debug\HaHo_TestApp1.out] at 0x00000000	
	xdc_runtime_Error_policySpin__E(struct xdc_runtime_Error_Block *, unsigned short, unsigned char *, int, unsigned long, int, int)() 0x00000000  (next frame is identical to an existing frame)

My procedure for connecting to my target is the following:

1. Launch my target configuration

2. Connect to the Cortex A8 target

3. Run -> Reset -> CPU Reset (HW)

4. Run the GEL script: SYS_CLKOUT2 -> L3_CLK

5. Run the GEL script: AM335x System Initialization -> AM3359_ICE_Initialization

6. Run -> Load -> Load my .out file

At this point I mostely get the error. I have tried this procedure with first resetting the board by unplugging it, resetting it via the push button or not resetting it at all, this makes no noticeable difference.

The Console output from executing the GEL scripts is:

Console output during init of the MPU
CortxA8: Output: ****  AM3359_ICE Initialization is in progress .......... 
CortxA8: Output: ****  AM335x ALL PLL Config for OPP == OPP100 is in progress ......... 
CortxA8: Output: Input Clock Read from SYSBOOT[15:14]:  24MHz
CortxA8: Output: ****  Going to Bypass... 
CortxA8: Output: ****  Bypassed, changing values... 
CortxA8: Output: ****  Locking ARM PLL
CortxA8: Output: ****  Core Bypassed
CortxA8: Output: ****  Now locking Core...
CortxA8: Output: ****  Core locked
CortxA8: Output: ****  DDR DPLL Bypassed
CortxA8: Output: ****  DDR DPLL Locked
CortxA8: Output: ****  PER DPLL Bypassed
CortxA8: Output: ****  PER DPLL Locked
CortxA8: Output: ****  DISP PLL Config is in progress .......... 
CortxA8: Output: ****  DISP PLL Config is DONE .......... 
CortxA8: Output: ****  AM335x ALL ADPLL Config for OPP == OPP100 is Done ......... 
CortxA8: Output: ****  AM335x DDR3 EMIF and PHY configuration is in progress... 
CortxA8: Output: EMIF PRCM is in progress ....... 
CortxA8: Output: EMIF PRCM Done 
CortxA8: Output: DDR PHY Configuration in progress 
CortxA8: Output: Waiting for VTP Ready ....... 
CortxA8: Output: VTP is Ready! 
CortxA8: Output: DDR PHY CMD0 Register configuration is in progress ....... 
CortxA8: Output: DDR PHY CMD1 Register configuration is in progress ....... 
CortxA8: Output: DDR PHY CMD2 Register configuration is in progress ....... 
CortxA8: Output: DDR PHY DATA0 Register configuration is in progress ....... 
CortxA8: Output: DDR PHY DATA1 Register configuration is in progress ....... 
CortxA8: Output: Setting IO control registers....... 
CortxA8: Output: EMIF Timing register configuration is in progress ....... 
CortxA8: Output: EMIF Timing register configuration is done ....... 
CortxA8: Output: PHY is READY!!
CortxA8: Output: DDR PHY Configuration done 
CortxA8: GEL Output: Turning on EDMA...  
CortxA8: GEL Output: EDMA is turned on...  
CortxA8: Output: ****  AM3359_ICE Initialization is Done ****************** 


CortxA8: GEL Output:  **** SYS_CLKOUT2 = L3 (From Core PLL) (divided by 2)
CortxA8: Output: ****  AM3359_ICE Initialization is in progress .......... 
CortxA8: Output: ****  AM335x ALL PLL Config for OPP == OPP100 is in progress ......... 
CortxA8: Output: Input Clock Read from SYSBOOT[15:14]:  24MHz
CortxA8: Output: ****  Going to Bypass... 
CortxA8: Output: ****  Bypassed, changing values... 
CortxA8: Output: ****  Locking ARM PLL
CortxA8: Output: ****  Core Bypassed
CortxA8: Output: ****  Now locking Core...
CortxA8: Output: ****  Core locked
CortxA8: Output: ****  DDR DPLL Bypassed
CortxA8: Output: ****  DDR DPLL Locked
CortxA8: Output: ****  PER DPLL Bypassed
CortxA8: Output: ****  PER DPLL Locked
CortxA8: Output: ****  DISP PLL Config is in progress .......... 
CortxA8: Output: ****  DISP PLL Config is DONE .......... 
CortxA8: Output: ****  AM335x ALL ADPLL Config for OPP == OPP100 is Done ......... 
CortxA8: Output: ****  AM335x DDR3 EMIF and PHY configuration is in progress... 
CortxA8: Output: EMIF PRCM is in progress ....... 
CortxA8: Output: EMIF PRCM Done 
CortxA8: Output: DDR PHY Configuration in progress 
CortxA8: Output: Waiting for VTP Ready ....... 
CortxA8: Output: VTP is Ready! 
CortxA8: Output: DDR PHY CMD0 Register configuration is in progress ....... 
CortxA8: Output: DDR PHY CMD1 Register configuration is in progress ....... 
CortxA8: Output: DDR PHY CMD2 Register configuration is in progress ....... 
CortxA8: Output: DDR PHY DATA0 Register configuration is in progress ....... 
CortxA8: Output: DDR PHY DATA1 Register configuration is in progress ....... 
CortxA8: Output: Setting IO control registers....... 
CortxA8: Output: EMIF Timing register configuration is in progress ....... 
CortxA8: Output: EMIF Timing register configuration is done ....... 
CortxA8: Output: PHY is READY!!
CortxA8: Output: DDR PHY Configuration done 
CortxA8: GEL Output: Turning on EDMA...  
CortxA8: GEL Output: EDMA is turned on...  
CortxA8: Output: ****  AM3359_ICE Initialization is Done ****************** 

The debug console displays the following error when I see the do_AngleSWI message in the debug window:

CortxA8: Unhandled ADP_Stopped exception 0x20023

Is there anyone that can help me solve this issue ?

Kind regards,

   Han Hoekstra

  • I have one addition to the above.
    I have a very simple project that only displays data on the debug console every second in a task and this project always seems to run. This project does not use any of the I/O's of the Sitara and therefore does not references any of the ti.drv modules in the .cfg file and does not do a call to "Board_init". The other 2 projects have I2C, UART and GPIO drivers loaded in the .cfg file.
    I am not able to extend my simple project to include for example GPIO, because then I get compiler errors on "UART_stdioInit", which I cannot same to fix.
  • Han,

    Let's first try to get the "I2C_Example_icev2AM335x_armExampleProject" example running on the board.
    Are you able to put a breakpoint in main at the top of the example and step through the code to see where it crashes?

    Lali
  • Hello Lali,

    The problem is that I don't even get to the point where I can run my code.

    The only thing I do is try to load the binary file and immediately after the loading it gives me the error message. So I don't even get to the point where the debugger takes met to the first line in the main function and allows me to run the application. So the problem is somewhere in the section the compiler/linker adds to the application, which is run before main. If the problem would pop up when I run my code, then I could probably do something about it.

    Kind regards,

       Han

  • Han,

    Which particular GEL file are you using? C:\ti\ccsv7_3\ccsv7\ccs_base\emulation\boards\ice_am3359\gel\TMDXICE3359.gel ?
    Also, based on your procedure above, could you please just try with #5 only?
    Try as well without a GEL file, I believe the application is also doing some board initialization (PLL, etc).

    Lali
  • Lalindra Jayatilleke said:
     
     Which particular GEL file are you using? C:\ti\ccsv7_3\ccsv7\ccs_base\emulation\boards\ice_am3359\gel\TMDXICE3359.gel ?

    Yes, that is the GEL file I am using. Looking at your path, I think you are using CCS7 version 3, I am using CCS7 version 2. That is a difference.

    Lalindra Jayatilleke said:
     
    Also, based on your procedure above, could you please just try with #5 only?

    I have tried this, but the result remains the same.

    Lalindra Jayatilleke said:
     
    Try as well without a GEL file, I believe the application is also doing some board initialization (PLL, etc).

    I have created a target that does not have a GEl file for the Cortex A8, but using this target, the debugger is unable to load the application onto the target, it gives me the following error:

    CortxA8: Trouble Writing Memory Block at 0x80000000 on Page 0 of Length 0x7ff0: (Error -1065 @ 0x3D5A) Unable to access device memory. Verify that the memory address is in valid memory. If error persists, confirm configuration, power-cycle board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 7.0.100.1) 
    CortxA8: File Loader: Verification failed: Target failed to write 0x80000000
    CortxA8: GEL: File: C:\Users\hoeksh\workspace_v7\HaHo_TestApp2\Debug\HaHo_TestApp2.out: Load failed.
    CortxA8: Trouble Reading Memory Block at 0x233ba on Page 0 of Length 0xc: (Error -1205 @ 0x233B8) Device memory bus has an error and may be hung. Verify that the memory address is in valid memory. If error persists, confirm configuration, power-cycle board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 7.0.100.1) 
    CortxA8: Trouble Reading Memory Block at 0x233ba on Page 0 of Length 0x60: (Error -2130 @ 0x233B8) Unable to access device memory. Verify that the memory address is in valid memory. If error persists, confirm configuration, power-cycle board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 7.0.100.1) 
    CortxA8: Error: (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: Unable to determine target status after 20 attempts
    CortxA8: 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
    

    So I think the GEL file is required to configure the target before loading an applicaiton.

    New information:

    I have had some time to play with the board and software and I created a new project, taking the settings from a different project. And now I am able to run my application about 70% of the time. The times that it won't run is still with the same error are I mentioned before. So it is still usefull for me to know why this problem occurs, but I am able to do some software development (when I have the time, I have to write some specification first, but I try to play around with the ICE board every now and then to get acquinted with the whole TI-RTOS environment).

    Thank you very much for helping me so far, I really hope we can find the problem with the "do_AngelSWI" issue, so that I can consistently run my application and not have to worry about the debugger stopping during the load.
     
    Lali

  • Does the Out of the Box (unmodified) example work or not? What is do_AngelSWI? Your code? If so, what's it do?
  • The unmodified examples also give the same problems.

    I don't know what the function 'do_AngelSWI' is, it is not something coming from my code.

    I still haven't found a solution for this problem and it keeps popping up from time to time here. Sometimes it is enough to terminate and then launch my target configuration in CCSv7 and perform the procedure described in my first post. But sometimes that doesn't work after 2 tries and then I remove the power from my board (also the USB debug cable) wait for some time and power the board again and most of the time I can run my application again (but not always).

    What I have noticed is that the AM3359 chip is getting quite hot, I don't know if this could have anything to do with it...

    Thanks for taking the time to look into my post !

    I really don't know what is going on with this crash when only loading the software image and not running it at all.

    Kind regards,

       Han

  • Small addition to my post above:

    In the .map file of my project, I cannot find any reference to "do_AngelSWI", so where that one is coming from I really don't know.

  • do_AngelSWI is from the compiler. Can you take a look at this thread: e2e.ti.com/.../1182247
  • I have had a look at the post, but there they are talking about running the application, without the debugger connected, from flash (if I read it correctly). What I am doing is try to run the application under debugger control, because I want to have the output to the CCS debug console.

    My application is printing messages using "System_printf" about what is going on in the application and I want to see those messages. Only from time to time the application will not load and crashes with the mentioned error message. The first project I created shows this behaviour more often than the one I am currently working on.

    When my application is running and I terminate the target connection (debugger no longer connected), the application is still running correctly. I can see this becaue I am using the UART to send commands to my application and these commands are executed correctly, so the applicaiton is still running.
    I can also see that the semi-hosting stuff is no longer executed, because I have a task that is blinking a LED using a sleep of 100 ms. and when the debugger is connected, the blink rate is not constant (sometimes a much longer delay than 100 ms.), when I disconnect the target in CCS, the blinking is constant at 100 ms..

    I am not loading my application in flash, just in RAM, so when I reset the board, my application is gone.

    The solution in the suggested thread is to remove the semi-hosting stuff, but I would not like to do that at this point, because then I have no means of printing status information, because the UART is used for a 'protocol' that can control the behaviour of the application.

    I am not using the 'xdc.runtime.SysMin' for printing the messages, but 'xdc.runtime.SysStd'. The SysStd seems to print the messages more real-time than the SysMin. I read abou tthe SysStd on the following page: processors.wiki.ti.com/.../Processor_SDK_RTOS:_TI_RTOS_Tips_And_Tricks

    Hopefully this information give you more insights into my issue. If you need more information from me, please let me know.
  • Today I was looking at the SPI driver and wanted to run the example project 'MCSPI_BasicExample_icev2AM335x_armExampleProject'.

    I managed to run this project once, all the other times I loaded the project it gave me the error message about "do_AngelSWI".

    After some time of trying to run this project and failing, I did a Run->Reset->CPU Reset (HW), then Scripts->SYS_CLKOUT2->L3_CLK followed by Scripts->AM335x System Initializaiton->AM3359_ICE_Initialization and then a Run->Load of my own project and that one did load at once without the error message.

    I have no clue at all what this issue with the "do_AngelSWI" error could be... But it is very annoying... For my own project I still get it from time to time, which is costing me time and it is frustrating, because I never know if my project is going to run or not.