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.

Stack memory configurations

Other Parts Discussed in Thread: TMS570LS20216, HALCOGEN

Hi

I m woking on TMS570LS20216. i have defined some local arrays out of which two has to hold 2000 bytes of data each. whenever i execute the code, the red LED in the TMS570 USB is getting on. this must be beacuse of some memory issues as when i break down the array size and define 10 arrays with each holding 100 bytes each, i m not getting any error. i tried to allocate more memory to the stack area by changing the length in the .cmd file.

the .cmd file memory map is as shown below

VECTORS (X) : origin=0x00000000 length=0x00000020

FLASH0 (RX) : origin=0x00000020 length=0x0007FFE0

FLASH1 (RX) : origin=0x00080000 length=0x00080000

FLASH2 (RX) : origin=0x00100000 length=0x00080000

FLASH3 (RX) : origin=0x00180000 length=0x00080000

STACKS (RW) : origin=0x08000000 length=0x00001200

RAM (RW) : origin=0x08001200 length=0x00026E00

I increased the length of stack upto 0x00007500 but still finding the same problem. Can anyone tell me what needs to be done so that the array size of 2000 works?

Thanks and Regards

Pallavi

 

  • Pallavi,

    You need to set up the stack pointers for each R4 mode. I am attaching a boot code and link command file example for reference.

    2804.boot_flash_ecc_r4_EABI.asm

    http://e2e.ti.com/cfs-file.ashx/__key/communityserver-discussions-components-files/312/3632.lnk32_5F00_DEVICE_5F00_MODEL_5F00_Flash_5F00_randomread.cmd

    Please let me know if you have the information you need.

    Thanks and regards,

    Zhaohong

  • Zhang,

    Thanks for your response.

    I m using halcogen generated command and asm files. In "sys_core.asm"  i m altering the "_coreInitStackPointer_:" section

    from

    user:   .word 0x08000000+0x00001000
    svc:    .word 0x08000000+0x00001000+0x00000100
    fiq:    .word 0x08000000+0x00001000+0x00000100+0x00000100
    irq:    .word 0x08000000+0x00001000+0x00000100+0x00000100+0x00000100
    abort:  .word 0x08000000+0x00001000+0x00000100+0x00000100+0x00000100+0x00000100
    undef:  .word 0x08000000+0x00001000+0x00000100+0x00000100+0x00000100+0x00000100+0x00000100

    to

    user: .word 0x08000000+0x00001000

    svc: .word 0x08000000+0x00001000+0x00006500

    fiq: .word 0x08000000+0x00001000+0x00008000+0x00000100

    irq: .word 0x08000000+0x00001000+0x00008000+0x00000100+0x00000100

    abort: .word 0x08000000+0x00001000+0x00008000+0x00000100+0x00000100+0x00000100

    undef: .word 0x08000000+0x00001000+0x00008000+0x00000100+0x00000100+0x00000100+0x00000100

    does changes to this file help? As i m not aware of using assembly on this controller i m taking the system files generated by halcogen. Even after this change is implemented i m facing the same issue. Could you provide me some ideas about altering these files to make my code execute without any issues?

    Regards

    Pallavi

     

     

  • Pallavi,

    You will need to allocate 0x9400 bytes for STACK with this setting. It does not match your link command file. You can set up stack size for each mode in halcogen. Halcogen should generate the required link command file automatically. STACK is the memory reserved for the local variables (the ones defined in subroutines). You can get an estimate about what you need  by examining your functions and processing flow.

    Thanks and regards,

    Zhaohong

  • Hello Pallavi,

    Did Zhaohong's reply answer your questions and help solve your problem? If so, please verify his answer so the thread may be close.