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.

BLE_Bridge app crash

The application running on CC2541F256 works just fine without a serial bootloader. It crashes when it is used with SBL.   SPX (XDATA)  register gets loaded with invalid data during a call to API function GAP_ParamsInit() in gap.c module. Upon return form osal_msg_allocate() function XSP(L) and XPS(H) register gets loaded with a value over 0x1000 which causes a stack overflow and the system resets. The application INTVEC is set to 0x1000, since the SBL is located in code space from 0 to 0x1000.  XSP registered is mapped to 0x10 and 0x11 IDATA memory.

 BLE version: 1.4.0. Both BSL and BLE_Bridge app are compiled with IAR 8051 8.30.3. The linker script is: cc254x_f256_sbl.xcl

I have not tried a compiler version IAR v8.20.2 yet.

Thanks Boris.

  • Hi,

    Would you mind terribly doing a test with 8.20.2 as well? There is at least one change in the linker file that I'm aware of between .20 and .30, so there might be more for whatever reason. The difference is related to virtual registers in IDATA.

    I expect you've been following the instructions on:
    http://processors.wiki.ti.com/index.php/SerialBootLoader

    I don't know that you need to change intvec, since the SBL image takes all the interrupts, but has the following assembly code hard-coded into the INTVEC area;

    OFFSET EQU 0x800

    COMMON INTVEC(1)

    ORG 0x0003 ; RF Tx FIFO underflow and overflow
    LJMP $ + OFFSET
    ORG 0x000B ; ADC end of conversion
    LJMP $ + OFFSET
    ........

    which means that all interrupts are re-jumped 0x800 from the original placement. Since you say your SBL image is from 0 to 0x1000, i guess you have changed this OFFSET variable when you mention that INTVEC is set to 1000.

    Best regards,
    Aslak