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.

Error XdataStack filled 100% After increasing Boot loader size from 2K to 4K.

Other Parts Discussed in Thread: CC2530, REMOTI

Hi

I am working in CC2530 chip with using of RemoTI-CC253xDK-1.2.1(swrc131c) sample projects.

Application firmware project : \RemoTI-CC253xDK-1.2.1\Projects\RemoTI\RNP\\CC2530EB\rnp_cc2530.eww. I have used CC2530128_SB workspace.

Boot lodaer project : \RemoTI-CC253xDK-1.2.1\Projects\RemoTI\SerialBoot\CC2530RC_Src\SerialBoot.eww.I have used CC2530  workspace.

First I have built the Application and boot loader project using default 2K(0x800) boot loader size.It is working good both debug mode and stand alone execution.

I have changed boot loader size from 2k to 4k and according to this, Application firmware Flash memory map is also modified.

Following are the changes have done for increasing the bootloader size.

///***************************************************************************************************************************************************************///

File name : \RemoTI-CC253xDK-1.2.1\Projects\RemoTI\common\bootloader\sb_target.c

Changes:

# define SB_PREAMBLE_ADDR          0x8C0

to

# define SB_PREAMBLE_ADDR          0x10C0


File name : \RemoTI-CC253xDK-1.2.1\Projects\RemoTI\SerialBoot\Application\boot_interrupt_stubs.s51

Changes:

OFFSET   EQU    0x800

to

OFFSET   EQU    0x1000


File name : \RemoTI-CC253xDK-1.2.1\Projects\RemoTI\SerialBoot\Application\bootlink_2530.xcl

Changes:

-D_CODE_END=0x07FF             // Last address for ROOT and all code.

to

-D_CODE_END=0x0FFF             // Last address for ROOT and all code.


File name: \RemoTI-CC253xDK-1.2.1\Projects\RemoTI\common\cc2530\ti_51ew_cc2530f128_sb.xcl

Changes:

i) -D_SB_BOOT_SIZE=0x800

to

-D_SB_BOOT_SIZE=0x1000

ii) -Z(CODE)INTVEC=0x800 // Serial boot loading app places interrupt vector at 0x800

to

-Z(CODE)INTVEC=0x1000 // Serial boot loading app places interrupt vector at 0x800

iii) -Z(CODE)NON_PREAMBLE_CODE=0x1000-_CODE_END

to

-Z(CODE)NON_PREAMBLE_CODE=0x2000-_CODE_END

iv) -D_BANK0_START=0x8C0

to

-D_BANK0_START=0x10C0


File name:\RemoTI-CC253xDK-1.2.1\Projects\RemoTI\SerialBoot\Application\sb_main.h

Changes:

# define SB_APP_START_ADDR          0x800

to

# define SB_APP_START_ADDR          0x1000

File name:\RemoTI-CC253xDK-1.2.1\Projects\RemoTI\RNP\CC2530EB\pp_cc2530f128sb.bat

Changes:

@%1\..\..\common\cc2530\chexbin -pa 8C0 %1\..\..\SerialBoot\CC2530RC_Src\CC2530\Exe\SerialBoot.hex %1\CC2530F128_SB\Exe\rnp_cc2530.bin %1\CC2530F128_SB\Exe\rnp_cc2530sb.hex

to

@%1\..\..\common\cc2530\chexbin -pa 10C0 -sa 1000 %1\..\..\SerialBoot\CC2530RC_Src\CC2530\Exe\SerialBoot.hex %1\CC2530F128_SB\Exe\rnp_cc2530.bin %1\CC2530F128_SB\Exe\rnp_cc2530sb.hex

//************************************************************************************************************************************************************************************/

After changing the above configurations.I can able to built the code successfully.When i do debugging i am always getting

The stack 'XdataStack' is filled to 100% (512 bytes used out of 512). The warning threshold is set to 90.% This error is occurring  in 4K boot loader size only not in defauklt 2K boot loader size.

Procedure for getting XdataStack error

--------------------------------------------------------

i) Debug Boot loader project.

ii)Click Go(F5)

iii)Program the application firmware(rnp_cc2530.bin) using RemoTI Serail Bootloader Demo tool.A

iv)Program succeeds.

iv)After successful program when running application firmware error "The stack 'XdataStack' is filled to 100% (512 bytes used out of 512). The warning threshold is set to 90.%" is occurrig

Ensures list:

-----------------

i) Application firmware successfully starts after jumping from the boot loader using  preamble.

ii) I can confirm   HAL_BOARD_INIT(); and HalDriverInit(); are executing in the application firmware.

iii)After clicking Go(F5). I am getting The stack 'XdataStack' is filled to 100% (512 bytes used out of 512). The warning threshold is set to 90.%

 

Regards

Raja Sivasankaran

www.e-consystems.com

 


 


  •  

    Following things I have  confirmed

    ------------------------------------------------

    i) Application firmware successfully starts after jumping from the boot loader using preamble.

    ii) I have confirmed HAL_BOARD_INIT(); and HalDriverInit(); are executing in the application firmware using LED blink.

    iii)After clicking Go(F5). I am getting The stack 'XdataStack' is filled to 100% (512 bytes used out of 512). The warning threshold is set to 90.%

     

    Regards

    Raja Sivasankaran

    www.e-consystems.com

  • Hi Raja,

    Please have a look at chapter 9 of RemoTI Network Processor Developer's Guide. This explains the usage of both stack and heap; how to profile it and how to modify it.

    Hope you find this useful,

     

    Best regards,

    Torbjørn

  • Hi,

     

    the stack is initialize by IAR at the value 0xCD.

    IAR is checking this value in debug mode to know when a stack overflow occurs.

    But, with the serial bootloader, once the binary is downloaded, a HW reset occurs and a jump to the start of the image is executed.

    then the stack pointer is initiliazed to its default value (0x40). it acts like the HW just start from a reset.

    IAR does not know that, and the stack value is not reinitiaze. it can also generate error.(you can see that some value of the stack change, but not related to the stack pointer)

    So stack for the serial bootloader must be profiled  until the call to the image begin, whch is done here:

          (*preamble.pfnStart)();

    The profiling of the stack for the binary image, should be done independently.

     

    My understanding is that it's a limitation of IAR.

    My questions:

    Does this 'xdata stack overflow' prevent your binary to be downloaded? (normaly it should not. Put a breakpoint just before  (*preamble.pfnStart)(); and check if you have an stack overflow).

    Does this stack overflow prevent your binary to be executed? in this case, can you reprocude the stack oveflow in debug mode without the serial bootloader )


    I'm still concern by some value of the stack that change between the start of the downloaded image and later.I will keep a eye on it and try to figure it out.

    if you have any comment, feel free.

    Regards,

    Calimero.

     

  • New Comments:

    change in

    File name:\RemoTI-CC253xDK-1.2.1\Projects\RemoTI\RNP\CC2530EB\pp_cc2530f128sb.bat

    change

    @%1\..\..\common\cc2530\oadbbin %1\CC2530F128_SB\Exe\rnp_cc2530.a51 %1\CC2530F128_SB\Exe\rnp_cc2530.bin

    by

    @%1\..\..\common\cc2530\oadbbin -s 1000 %1\CC2530F128_SB\Exe\rnp_cc2530.a51 %1\CC2530F128_SB\Exe\rnp_cc2530.bin

    This remove the stack overflow I had.

    My comment above is still good, but less relevent I think

     

    Regards,

  • Hi Calimero

    Thank you for your Solution.

    It resolves my issue.

    Actually I had doubt on the OADBBIN.exe but i couldn't get information about that application in the documentation or googling.

    Could you please explain OADBBIN.exe application functionality.

    Once again Thank you for your solution

    Regards
    Raja Sivasankaran

  • Hi,

    that's good news.

    to have some little information about aodbbin.exe, you can only use a DOS prompt:
    C:\Texas Instruments\RemoTI-CC253xDK-1.2.1_REF\Projects\RemoTI\common\cc2530>oad
    bbin.exe
    oadbbin [-s <start-hex-address>] <input-file-path> [<output-file-path>]

    This soft generate a TI specific binary file (link to bank mapping) that is aimed to be downloaded either with a serial bottloader or Over The Air.

    if -s option is not indicated, it takes 0x800 by default.

    input file is a hex file

    output file is a binary file

    Regards,

     

  • can you give me "swrc131c"  to my email:  986458764@qq.com,,thank you