Other Parts Discussed in Thread: CC2640, , SYSBIOS
We are developing firmware using CC2640 SDK v4.30.00.08 in CCS v10. The firmware is based on the BLE 5 Simple Peripheral example. Development has been proceeding fine as features are added. After adding the most recent set of modules, the firmware builds with no linker issues, and loads normally when starting a debug session, but after the firmware is loaded, rather than setting the firmware to start in main and enabling the resume button, the debug environment indicates the firmware is running. The firmware is actually in the weeds not running. The behavior is the same as described in the first part of this thread:
(+) CCS Unable to debug CC2650 code - Bluetooth forum - Bluetooth® - TI E2E support forums
The thread transitions to a different problem without a resolution to the original issue, unless the suggestion to change to a different optimization level is considered the solution.
We are going to be hard-pressed to fit the entire application into the flash on this part, so changing optimization levels toward speed away from size optimization is not an option. I was concerned this latest code would not fit. If this issue is related to code size, I would expect the build to fail, with the linker indicating that X space is required but the biggest available window is Y. This has happened a couple times along the way, and I have been able to remove unused code to get the new code to fit, and development has proceeded from there. Since the firmware is building successfully, I do not know whether to suspect code size.
I commented out a block of the new code as shown below:
bool startCaptureTask() { CaptureMode captureMode = getCaptureMode(); uint16_t taskStartDelay = getTaskStartDelayTime(); /* TaskConstructor taskConstructor = NULL; switch (captureMode) { case CAPTURE_MODE_A: taskConstructor = modeADataCollectorTask; break; case CAPTURE_MODE_B: taskConstructor = modeBDataCollectorTask; break; default: // Unrecognized mode; can't start a task return false; } return startNewTask(taskConstructor, taskStartDelay); */ return false; }
After this change, everything works fine. This is code that is not executed at all unless directed to do so by a connected client.
If I modify the function to get rid of the switch block and simply assign one of the task structs to taskContructor, a debug session will start normally and wait to begin execution in main, but the firmware crashes at the Task_create call in ICall_createRemoteTasksAtRuntime. Not sure how adding/removing unrelated code would lead to a BLE stack init crash.
Any info on where to look would be appreciated.