Other Parts Discussed in Thread: SYSBIOS, LAUNCHXL-CC26X2R1
Tool/software: TI-RTOS
Hello,
My colleague made a post here concerning our issues and lack of debug ability:
The responses to this thread have been helpful - along with the realization that we had been working in the release configuration which suppressed a lot of the debug options that were available.
I have since run into an issue which has brought our debug efforts to a halt. As I was working between build configurations, I noticed a blurb of code in the ble_release.cfg file that can be commented out to put the BIOS in flash, and then another part to also check our task stacks for overflow conditions:
/* ================ ROM configuration ================ */ /* * To use BIOS in flash, comment out the code block below. */ var ROM = xdc.useModule('ti.sysbios.rom.ROM'); if (Program.cpu.deviceName.match(/CC26/)) { ROM.romName = ROM.CC26X2; } else if (Program.cpu.deviceName.match(/CC13/)) { ROM.romName = ROM.CC13X2; }
/* ================ Task configuration ================ */
var Task = xdc.useModule('ti.sysbios.knl.Task');
/*
* Check task stacks for overflow conditions.
*
* Pick one:
* - true (default)
* Enables runtime checks for task stack overflow conditions during
* context switching ("from" and "to")
* - false
* Disables runtime checks for task stack overflow conditions.
*
* When using BIOS in ROM:
* This option must be set to false.
*/
Task.checkStackFlag = true;
//Task.checkStackFlag = false;
Great, right? Well, not so fast.
After making the modifications necessary to exclude/include the right code in my now modified .cfg file, I cleaned and re-built the project, where I was hit with the old "unresolved symbols remain" error. Namely, the below was undefined:
undefined first referenced
symbol in file
--------- ----------------
ti_sysbios_knl_Mailbox_Params__init__S <whole-program>
ti_sysbios_knl_Mailbox_construct <whole-program>
ti_sysbios_knl_Mailbox_pend__E <whole-program>
ti_sysbios_knl_Mailbox_post__E <whole-program>
Obviously, these are all of the basic mailbox-structure function calls that we use over and over for multiple I2C and SPI operations to multiple external hardware devices. The code files are still existent, I can use F3 to jump into the source files and see the definitions in the source files and everything. As it seems, whenever you put RTOS into flash, these functions are no longer defined (or are just not in the BIOS.obj library or something). If you uncomment the "put BIOS in ROM" section back in and use ROM-based RTOS, everything is fine again.
So now the fun debug features I was looking forward to aren't usable unless I heavily modify my code to exclude mailbox usage... which is pointless.
Being the skeptical individual I am, I immediately thought I did something wrong to break the code, and it was my fault. So, I opened a brand new simple_peripheral project in a different workspace. It built successfully in both Release and Debug configurations, BUT it doesn't use a mailbox. So, I added my structure and variable definitions, along with some of my init code below and dropped it straight into SimplePeripheral_init so I knew it would attempt to link it in:
// TW DEBUG
typedef struct I2C_InfoMsgObj {
uint8_t slave_addr;
uint8_t tx_length;
uint8_t* tx_data;
uint8_t rx_length;
uint8_t* rx_data;
} I2C_InfoMsgObj;
typedef struct I2C_MailboxInfoMsgObj {
Mailbox_MbxElem elem; /* Mailbox header */
I2C_InfoMsgObj obj; /* Info mailbox */
} I2C_MailboxInfoMsgObj;
I2C_MailboxInfoMsgObj i2cInfoBuffer[4];
Mailbox_Struct I2C_mbxInfoStruct;
Mailbox_Handle I2C_mbxInfoHandle;
// TW DEBUG Mailbox_Params mbxParams; Mailbox_Params_init(&mbxParams); mbxParams.buf = &i2cInfoBuffer; mbxParams.bufSize = sizeof(i2cInfoBuffer); Mailbox_construct(&I2C_mbxInfoStruct, sizeof(I2C_InfoMsgObj), 4, &mbxParams, NULL); I2C_mbxInfoHandle = Mailbox_handle(&I2C_mbxInfoStruct);
The result is that the Debug configuration spit out a very similar error, but only with the first two parts included (as I didn't copy in pend/post usage at all).
After all this - the question becomes, is the flash library image of TI-RTOS not complete with Mailbox usage? How do I get these functions to be properly defined so I can have a proper debug configuration?
undefined first referenced
symbol in file
--------- ----------------
ti_sysbios_knl_Mailbox_Params__init__S <whole-program>
ti_sysbios_knl_Mailbox_construct <whole-program>