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.

TMS320C5535: Program works when flashed from debugger, but not when flashed from an EEPROM

Part Number: TMS320C5535

I'm developing on a TMS320C5535 using the XDS110 debugger, the C5000 chip support library, and Code Composer version:  8.3.0.00009. I have a program that uses GPT0 in the C5535 to blink an LED every second indefinitely. When I flash this program using the debugger, not issues occur and the LED happily blinks forever. 

However, when I burn the boot image of the program onto a 512kb I2C EEPROM and then have the C5535 boot from it, the C5535 hangs. The LED blinks correctly 3 times, and then it goes solid red. The C5535 successfully starts up after reading the boot image from the EEPROM, so I don't think it's I2C communication issue.

I already used the I2C EEPROM programmer to check that the data in the EEPROM memory and the .bin file matches. They do match, so there's no problem there.

Perhaps the way I formatted the boot image is incorrect? 

Here are my specs:

   

**** Build of configuration Debug for project test_blink_LEDs_interrupt ****

"C:\\ti\\ccsv8\\utils\\bin\\gmake" -k -j 12 all -O 
 
Building file: "../main.c"
Invoking: C5500 Compiler
"C:/ti/ccsv8/tools/compiler/c5500_4.4.1/bin/cl55" -v5515 --memory_model=large -g --include_path="C:/ti/c55_lp/c55_csl_3.08/inc" --include_path="C:/Users/Inno Algo/Desktop/puck_workspace/test_blink_LEDs_interrupt" --include_path="C:/ti/ccsv8/tools/compiler/c5500_4.4.1/include" --define=c5535 --display_error_number --diag_warning=225 --ptrdiff_size=16 --preproc_with_compile --preproc_dependency="main.d_raw"  "../main.c"
Finished building: "../main.c"
 
Building target: "test_blink_LEDs_interrupt.out"
Invoking: C5500 Linker
"C:/ti/ccsv8/tools/compiler/c5500_4.4.1/bin/cl55" -v5515 --memory_model=large -g --define=c5535 --display_error_number --diag_warning=225 --ptrdiff_size=16 -z -m"test_blink_LEDs_interrupt.map" --stack_size=0x200 --heap_size=0x400 -i"C:/ti/ccsv8/tools/compiler/c5500_4.4.1/lib" -i"C:/ti/ccsv8/tools/compiler/c5500_4.4.1/include" -i"C:/Users/Inno Algo/Desktop/puck_workspace/C55XXCSL_LP" --reread_libs --display_error_number --warn_sections --xml_link_info="test_blink_LEDs_interrupt_linkInfo.xml" --rom_model --sys_stacksize=0x200 -o "test_blink_LEDs_interrupt.out" "./main.obj" "../C5535.cmd"  -l"C:/ti/c55_lp/c55_csl_3.08/ccs_v6.x_examples/C55XXCSL_LP/Debug/C55XXCSL_LP.lib" -llibc.a 
<Linking>
Finished building target: "test_blink_LEDs_interrupt.out"
 
Building files: "test_blink_LEDs_interrupt.out"
Invoking: C5500 Hex Utility
"C:/ti/ccsv8/tools/compiler/c5500_4.4.1/bin/hex55" --boot --mcbsp8 --silicon_version=5505 --binary -o "test_blink_LEDs_interrupt.bin"  "test_blink_LEDs_interrupt.out" 
Translating to Binary format...
   "test_blink_LEDs_interrupt.out"   ==> .cinit 	(BOOT LOAD)
   "test_blink_LEDs_interrupt.out"   ==> vectors 	(BOOT LOAD)
   "test_blink_LEDs_interrupt.out"   ==> .text 	(BOOT LOAD)
   "test_blink_LEDs_interrupt.out"   ==> .switch 	(BOOT LOAD)
Finished building: "test_blink_LEDs_interrupt.out"
 

**** Build Finished ****

Here are the .bin, .map., and .cmd files of the program I'm booting from: test_blink_LEDs_interrupt.zip

Any help or guidance would be greatly appreciated! 

Best, 

Eddie

  • Hi Eddie,

    This issue is not previously reported. As very first steps for investigating the issue I suggest to to check project properties -> CCS General -> Configuration should be Release (not Debug).
    You could make some changes in the blink (switch on/off) LED delay and burn again to ensure that the new bin is flashed properly.

    Regards,
    Tsvetolin Shulev
  • Tsvetolin ,

    I had done as you suggested. I complied my code in release mode (Optimization level = 2) and changed the blink rate of the LED from 1 second to 2 seconds.

    Unfortunately, the same issue persists.  When the c5535 is flashed using the XDS110 debugger the LED successfully blinks every 2 seconds indefinitely. When the c5535 boots from the I2C EEPROM, the LED blinks only 4 times (every 2 seconds) and then stops blinking.

    When I reverted back to the code where the LED blinks every second and compiled it in release mode, the only noticeable difference is that the LED blinks correctly 8 times (as opposed to 3 times in the original post) before the LED stops blinking.

    What troubleshooting step would you suggest next?

    Best, 

    Eddie

  • Tsvetolin, 

    Unfortunately I have not been able to find the solution for this problem. The EEPROM I'm using is 512kb and the .bin files is only 58kb, so it's not an issue with the .bin size. 

    I have found that modifying the .cmd file changes the behavior of the LED blinking, so perhaps the problem is how the memory is being allocated in the DSP? 

    This .cmd file causes the LED to stop blinking after 8 times: Stops Blinking.zip

    I changed the .cmd in this file and now the LED doesn't blink at all: Doesnt Blink at All.zip

    I have included the .cmd, .hex, .bin, and .map file for you to review in each zip folder. 

    I would also like to point out that when I flash using the XDS110 debugger, both the .cmd files above causes the LED to blink as expected (1 second intervals indefinitely). The LED only stops blinking when the c5535 boots from the EEPROM. 

    Best, 

    Eddie

  • Hello Eddie,
    As I can see the main difference between two versions concerns stack definition. You say that both are working when loaded via XDS110 so this can lead to conclusion that program itself is okay but some initialization is missing when data is taken from I2C EEPROM. Both ways of loading an executable code to C5535 differ a lot. When Boot ROM is reading the EEPROM it makes a kind of parsing its contents and initialize important registers to certain values prior to execute the code.
    Maybe there is something wrong so can we double check all steps that you made for creating the special format .bin file for the eeprom?

    BR
    Michail
  • Hi Eddie,

    I'm sorry for the delay. Out team still working on the issue.
    I check that the binary image fulfills the conditions of correctness - the size is less then 64 KB and the .bin image file starts with the boot signature 0x09AA.
    An other idea for verification is to use a logic analyzer to inspect SDA and SCL and make sure the data is what you expect.
    Also you should check description about burning a boot image in TMS320C5545/35/34/33/32 Bootloader guide sections 2.2.3. and 3.2. at:
    www.ti.com/.../sprabl7d.pdf

    Regards,
    Tsvetolin Shulev
  • Hi again,
    as I can see in both .bin images register configuration count is 0000.

    0000 .word 9AAh ; signature
    0002 .long 19974h ; entry point 00019974 (00011974 on other image)
    0006 .word 0 ; register configuration count 0000 ???
    0008 .word 36h ; Section 1 word count 0036h
    000A .long 8000h ; Destination address to load Section 1: 00008000
    ...
    This means that no registers are configured prior to executing the image and it can be a pretty good reason for the code to hang.

    BR
    Michail
  • Michail and Tsvetolin, 

    Thank you for your investigative work.

    Within the actual program itself, I'm able to successfully initialize ESBR, GPIO, GPT, and the interrupts. Isn't it enough for the registers to be initialized within the program itself, or is it mandatory for the boot loader to initialize those peripherals? 

      

    I'm willing to give this solution a try but I have never used the register configuration feature before and would probably cause the bootloader to fail if I tried. Could you provide a reference or step-by-step guide for how to do this?    

    Best, 

    Eddie

  • Hi Eddie,
    theoretically initializing registers inside the main program should work. Question is what is the additional action that CCS is taking using XDS100 which is not maintained in stand alone boot from EEPROM.
    Can you please attach the .out files for both cases "Stops Blinking" and "Doesnt Blink at All" ?
    Thanks
    Michail
  • Michail,

    Here are the zip files with the .out files added:

    8780.Stops Blinking.zip

    1565.Doesnt Blink at All.zip

    Just a friendly reminder that the only difference between these two files is the .cmd file. 

    Best, 

    Eddie

  • Hello,
    I can confirm that .out files contain the necessary initialisations as PLL_init/reset/set to 100MHz, EBSR_init, GPIO_init, GPT_init.
    In this case reason for the issue can be some overlapping in xxRAM memory. Can you tell me how you create the .bin?
    I mean the cmdline row that you used with hex55 utility.
    BR
    Michail
  • Michail, 

    The settings I used can be seen below:

    I did my best to follow the recommended commands from SPRABL7D

    Best, 

    Eddie

  • Hi again,
    I think before testing with another options for hex55 it is good to clarify something. Generally if an application is intended to work standalone (as from I2C eeprom) it should also work through xds110 without including .GEL file for the particular chip. Did you already tested to run your app through emulator with no .GEL specified?

    BR
    Michail
  • Michail,

    I believe that I am already driving the XDS110 without a .GEL file, but please tell me if I'm wrong:

    Best, 

    Eddie

  • same problem. without gel file, it's working well. But after eeprom boot, it doesn't work
  • Hi Eddie and minkyo seo,

    so when you have the same problem can we compare some details to triage the case:

    - are you using custom boards or dev ones

    - what is the main clock frequency of your C5535

    - what type of EEPROM is connected; it can be of type 24xx with array from 8kBytes to 64kBytes and must accept 400kHz clock

    Please let's clarify both of your configurations

    Thanks,

    Michail

  • Michail, 

    For my application, the C5535 is on a custom board. The clock frequency of my processor is 100MHz running at 1.3V. 

    I have verified that the EEPROM I'm using meets specs, but you can go ahead and see the EEPROM I'm using for yourself. The voltage I'm driving the EEPROM at is 3.3V, which also meets specs.

    Best, 

    Eddie

  • Hi

    - Actually, I'm using C5545 on my own board.
    - 100MHz
    - EEPROM : AT24C512C_MAHM_T, same with Eddie.

    Thanks
  • Hi

    In my case, if I put long long code, It doesn't boot well.

    but if I change long long to Int32, It works well.

    I need to use long long code. why does problem occure with long long ?

    please give me details. Thanks

    and I attached part of my code. please check

    
    /////////////////// global var 
    // if i change long long to Int32, it works, but I need to use long long
    long long anfdsum1d=0;
    long long anfdsum2d=0;
    long long dc0[32];
    long long dc1[32];
    long long dc2[32];
    long long dc3[32];
    long long dc4[32];
    long long dsum[32];
    long long temp_out;
    
    
    
    
    for(i=0; i<32; i++)
    {
    
       dc0[i] = Right_TempBuf[i] * nAnfcoef[0]; 
    	dc0[i] = dc0[i]>>11;           
    
       dc1[i] = anfdsum1d * -nAnfcoef[2];
       dc1[i] = dc1[i]>>13;
    
    
       dc2[i] = anfdsum2d * -nAnfcoef[3]; 
       dc2[i] = dc2[i] >> 13;
    
    
    
       dc3[i] = anfdsum1d * nAnfcoef[5]; 
       dc3[i] = dc3[i] >> 13;
    
       dc4[i] = anfdsum2d * nAnfcoef[6]; 
       dc4[i] = dc4[i] >> 13;
    
       dsum[i] = dc0[i] + dc1[i]; 
       dsum[i] = dsum[i] + dc2[i]; 
       dsum[i] = dsum[i]*nAnfcoef[1];
       dsum[i] = dsum[i]>>13;
    
       temp_out = dsum[i]*nAnfcoef[4]; 
       temp_out = temp_out>>13;
       temp_out = temp_out + dc3[i]; 
       temp_out = temp_out +dc4[i];;
       temp_out = temp_out>>2;
    
       notch_out_sig2[i] = (LDATA)(temp_out<<16);
       notch_out_sig[i] = temp_out;
    
       anfdsum2d = anfdsum1d; 
       anfdsum1d = dsum[i]; 
    
    
    }

  • Hello,
    did you use -serial8 option of C5500 Hex Utility when creating .bin image file for the eeprom?

    BR
    Michail
  • Minkyo Seo,

    According to the following post:

    https://e2e.ti.com/support/processors/f/791/t/768697?tisearch=e2e-sitesearch&keymatch=64%20bit%20c5000

    the C55X compiler does not support 64 bit data types. Unfortunately, the absolute max is 40 bits, so you'll have to restraint your program according to that limitation. 

    Best, 

    Eddie

  • Thank you for the reply!!

    Actually, I know that long long is 40bit in C5545.

    and I'm using long long for 40bit variable.

    Is there something I have to do to use long long?

    Please give me details . Thanks!!
  • Hello Eddie,
    as I see HEX55 utility command line does not include -serial8 option. Can you test replacing the -mcbsp8 with it to check if there will be any difference?

    Michail
  • Michail,

    I gave your suggestion a try. Unfortunately the same issue persists.

    Best,
    Eddie
  • Hello Eddie,
    here are two old threads which possibly can give a clue about the problem
    e2e.ti.com/.../416872
    e2e.ti.com/.../417942
    If it turns out that it is a tools issue maybe better place for this thread will be in the CCS forum.
    BR
    Michail
  • Michail,

    I appreciate all the help from you so far. I went ahead and made a new thread in the CCS forum.

    Best,
    Eddie