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/LAUNCHXL-F28379D: large array memory problem

Part Number: LAUNCHXL-F28379D


Tool/software: Code Composer Studio

Hi

i used the SPI loopback example and built a program that reads words from txt file, stores the data in array (Uint32 array[NumberOfWords], Uint32 subarray [NumberOfWords][10]) , and send it via SPI.

my problem is with the size of the array. when i have large data, for example NumberOfWords=500, i get the massage "Break at address "0x3fec52" with no debug information available, or outside of program code." and the program is freezing.
when i am at debug mode, i see that the crush occurs when i call InitSysCtrl(); in F28379D_SysCtrl.c, while trying to execute
WdRegs.WDCR.all = WDCR;.

if i have small data, NumberOfWords = 10 for example, everything works fine.
i understand that it has to be somthing wite the memory, but i dont understand how to solve it (new to microcontrollers)
thank you.

  • Hi,

    One of our experts will get back to you by Tuesday, since Monday is a US holiday.

  • Nir,

    Address 0x3fec52 falls in BOOTROM code. This address tells me that your PC is jumped to I2C_BOOT function available in BOOTROM code.

    My assumption here is when the array size is big it is leading to stack corruption / overflow which is making PC to jump to I2C_BOOT function in BOOTROM code. The key to resolve this problem is to understand why it jumped to I2C_BOOT and how the opcode changed.

    Regards,

    Manoj

  • Thanks for the answer.

    i have no idea how to figure out why it jumped to I2C_BOOT.

    can you guide me please?

  • Nir,

    when i am at debug mode, i see that the crush occurs when i call InitSysCtrl(); in F28379D_SysCtrl.c, while trying to execute
    WdRegs.WDCR.all = WDCR;.

    Based on your earlier post, it looks like you already figured out that executing WdRegs.WDCR.all = WDCR within F28379D_SysCtrl.c is actually triggering it to jump to I2C_BOOT. As soon as you load the program, check opcode pertaining to WdRegs.WDCR.all = WDCR within F28379D_SysCtrl.c. This opcode should be getting corrupted because of stack overflow. Also, increase the amount of memory you have allocated for stack. Check whether 500 word array has enough space in stack.

    Regards,

    Manoj

  • i increased the size of the system stack from 0x100 to 0x390, this is the maximum. if i increase to 0x400 i get error message "program will not fit into available memory" and the program wont' compile.

    now i can define an array for 450 words. this is a big improvement and its sufficient for my use.

    i just wonder how do i set the appropriate adjustments so i can input huge number of words.

    thanks for your help.

  • In your linker command file (.cmd file), assign .stack memory to larger memory section say RAMGS0 (origin = 0xC000, length = 0x1000). Then you will able able to have bigger stack size.

    Regards,

    Manoj