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.

Compiler/CC2642R: The Simple Broadcast Sample cannot work using the IAR-EW

Part Number: CC2642R
Other Parts Discussed in Thread: SYSCONFIG

Tool/software: TI C/C++ Compiler

Team,
I got an inquiry about sample program of SimpleLink CC13x2_26x2 SDK from my customer. Customer is suffering from the HardFault exception in sample project - . Simple Broadcast. I have tried to build the simple broadcast sample and tried to do debug. It appears the program exit reached with HardFault exception as below:

///////////////////////////////
Mon Jan 20, 2020 13:21:46: Program exit reached.
Mon Jan 20, 2020 13:21:46: EXIT 0
Mon Jan 20, 2020 13:21:46: HardFault exception.
Mon Jan 20, 2020 13:21:46: The processor has escalated a configurable-priority exception to HardFault.
Mon Jan 20, 2020 13:21:46:   A precise data access error has occurred (CFSR.PRECISERR, BFAR) at data address 0x20014048.
Mon Jan 20, 2020 13:21:46:
Mon Jan 20, 2020 13:21:46: Exception occured at PC = 0xffffffff, LR = 0x0
Mon Jan 20, 2020 13:21:46:
Mon Jan 20, 2020 13:21:46: See the call stack for more information.
Mon Jan 20, 2020 13:21:46: The stack pointer for stack 'CSTACK' (currently 0x20003430) is outside the stack range (0x20013C00 to 0x20014000)
///////////////////////////////

This phenomenon would be appeared in case of using the IAR-EW. The CCS does not have any problem. It also happen on both SDK3.30 and SDK3.40.

Could I have your comment on this?

Regards,
Nonaka

  • Hi,

    Have you verify if the stack size you defined in CCS and in IAR are the same? From the last line of the log, I understand you have allocated 1024 bytes to the stack. Is it what you wanted? In addition, I understand that the error is raised due to an access to the address 0x20014048 (i.e. 0x48 [meaning 72] out of the stack). Does this ring any bell?

    In summary:

    • verify the stack size on the IAR project (and compare it to the one defined for the CCS )

    I hope this will help,

    Kind regards,

  • Hi,

    Yes, I have confirmed the stack size defined in linker configuration lile - cc26xx_app_and_stack_agama.icf. It is the same value as CCS's one.
    Please note thatI have not made any changes to the sample project(source code, configuration files and so on).
    ------------------------------------------------------------------------------------------------------
    ////////////////////////////////////////////////////////////////////////////////
    // Stack
    //

    define symbol STACK_SIZE = 0x400;
    define symbol STACK_START = RAM_END + 1;
    define symbol STACK_END = STACK_START - STACK_SIZE;
    //
    define symbol STACK_TOP = RAM_END + 1;
    export symbol STACK_TOP;
    ------------------------------------------------------------------------------------------------------
    Regards,
    Nonaka

  • Any update?

  • Hi Nonaka,

    Thank you for your patience. I was out for a couple of days.

    Can you verify the following for me:

    - Is IAR using the expected files? I have seen cases where IAR was not taking in consideration the right .c and .h files due to some error while setting the SDK version

    - Are the sysconfig files generated through IAR the same as the ones generated through CCS?

    - Can you try to compile using IAR installed on a different computer?

    - Can you precise which version of IAR you are using?

    Regards,