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.

Code stuck on 3FF9FA 6F00 SB 0,UNC



I am running on a 28335 have been happily coding and debugging. I have data that I need to run through an algoirthm that is 80K in length so I decided to edit the linker cmd file to place this data in FLASH. When I run the code it jumps to:

3FF9FA 6F00        SB         0,UNC

This is listed as RESERVED so I did not find any documentation as to what this code is. However, I found this post:

http://e2e.ti.com/support/microcontrollers/tms320c2000_32-bit_real-time_mcus/f/171/p/70521/256668.aspx

Unfortunately there was no resolution. It just started working. However, mine is not working.

There were some tips on how to correct this but I am on a 28335 and don't have the same option in CCSv4.

If I comment out the code that causes the compiler/linker to place the data into FLASH, my program runs normally. Once that data goes into FLASH, whether I access it or not, the code jumps to that instruction (above).

Why?

Thanks

  • Are you running code from Flash or RAM?

    One thing to look at is the value of the RPC register when you are stuck in the infinite loop.  This will hopefully give you an indication of possibly where the code has jumped from and narrow down the possible culprits.

    Can you link your code where you access the data?

     

    Tim

  • The instruction at address 0x3FF9FA is the last instruction of  function "_ITRAPisr" (code is documented in spru963A). This interrupt is triggered, when the machine code 0xFFFF (ITRAP) is executed. So I guess, soewhere in your FLASH start sequence the chip hits an unprogrammed FLASH address (0xFFFF). I would recommend to single step the code from RESET and see, where it hits an 0xFFFF instruction.

     

     

     

  • Thask for the info.

    I am running out of RAM but added some data (that is too big to fit into RAM) in FLASH. The odd thing is that if I don't access the data, it runs fine. As soon as I start accessing the data, I have the problem.

    I have single stepped the code but it doesn't appear when I am single stepping. I had breakpoints in the ISRs and stepped through them as well. I did that for several "loops". However, as soon as I hit run, it happens. The stack trace doesn't give me any useful info. I will look at RPC.

    I got around the problem last night by running the code out of FLASH. Then every works fine.

    Tim, you asked "Can you link your code where you access the data?" Are you asking if I am running the code in the same memory space (ie RAM vs FLASH)? If so, when I have the problem, all code and data (apart from a large array) are in FLASH. When I don't have the problem, all code and data are in RAM or all the code is in FLASH.

    Thanks for the help!

  • The RPC register is 0

    There was another aspect of this that I forgot to mention. This above problem only happens right after I download the code with the debugger. If I reset and restart and run, the code runs but not correctly. That is, some of the code appears to be executing but the program does not behave as expected. If I put the code in FLASH or get rid of my FLASH data and run out of RAM, the code runs as expected.

    Thanks

  • Any other ideas? Right now I am running the code out of FLASH and program runs but it takes a lot longer to debug and of course there are limitations to debugging from FLASH.

     

    Thanks

  • What is the status of the watchdog?  If it is enabled, try to run the program with a disabled watchdog and see if its doing better.

     

  • Watchdog is disabled. It disables it at the beginning of DeviceInit() which is called at the beginning of my code. It is also disabled in PLLSet().

     

    void WDogDisable(void)

    {

        EALLOW;

        SysCtrlRegs.WDCR= 0x0068;

        EDIS;

    }

     

    I did a search on my entire project (which includes some TI files) for "WDCR" and I only come up with the code in HVPM_Sensorless-DevInit_F2833x.c, which is the code above.

     

    Is there any other way it could get enabled?

  • The idea to look into the status of the watchdog was just an attempt to corner your problem. Quite often the watchdog comes into play, when you change the timing (e.g. RAM vs. FLASH) of a project. Obviously not in your case, where the WD is actually disabled. 

    Just to summarize your problem:  (1) You run code out of RAM. (2) Some data are stored in FLASH. (3) If you never touch the FLASH data, the code runs as expected. (4) If you access the data in FLASH, then and only then your code hits this the loop-instruction in the Itrap-isr.  Is that right?

    If that's true, the only conclusion that I have now is that there must be something going on in your code, which uses the data from FLASH, computes something with these data and comes to a false decision ( for example a wrong pointer setting or something like this).  Did you check the values in your FLASH-data after programming? Are they as expected?  Without more knowledge about your project it is difficult to give more advice, at least for me.

     

     

  • Frank,

         Thank you for your time in looking at this. You understand it exactly right.

    Before I posted, I thought it must be something with my code (and still may be) but the same code, linked to run out of FLASH, works. Once the code is in RAM, no go. Unfortunately, the problem doesn't happed right away or behaves different when stepping.

    Thanks

  • I assume he got it solved but I was having the same problem using the ADC SYS/BIOS example.  In the example it was already set to run from flash and all but had the same failure with the SB 0,UNC if you ran it from hardware reset and not from main() which is the default entry point when you use the debugger.

    I fixed it by enabling the C28x Boot/Startup screen in the BIOS configuration and setting "Boot from FLash".  Now the right "magic" code to get it from the reset vector to the program entry point is enabled.

    jv