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.