Part Number: CC2745R10-Q1
Hello TI Team,
I am developing a custom CAN/UDS bootloader for the CC2745R10-Q1 device using FreeRTOS and ICall/OSAL.
My current flow is:
-
Board_init()
-
ICall_init()
-
ICall_createRemoteTasks()
-
Boot decision logic
-
vTaskStartScheduler()
In the boot decision stage (before calling vTaskStartScheduler()), I attempted to use OSAL APIs such as:
user_osal_Read()
user_osal_Write()
However, these APIs do not function correctly(Hang and not getting control upto terminate the debug session) before the scheduler is started. Once vTaskStartScheduler() is called and the APIs are used inside a task context, they work as expected.
I would like clarification on the following:
-
Is it expected behavior that OSAL APIs cannot be used before
vTaskStartScheduler()? -
Does OSAL strictly require a FreeRTOS task context to operate?
-
Is OSAL tightly coupled with the BLE stack, or can it be used independently?
-
Can OSAL be used without enabling or running the BLE stack?
-
For a bootloader use case (no BLE functionality required), what is the recommended method to access NVM services before scheduler start?
-
Is there a TI-recommended bootloader architecture for CC27xx devices when using ICall/OSAL without BLE?
My objective is to:
-
Perform boot decision (jump to application or stay in boot)
-
Use OSAL-based NVM storage if possible
-
Avoid enabling the BLE stack in the bootloader
for your reference Boot manager main():
unsigned char osal_ret_val = 0;
int main(void)
{
pthread_t thread;
pthread_attr_t attrs;
struct sched_param priParam;
int retc;
int uds_schedular;
uint32_t reloadValue =0;
Watchdog_Handle watchdogHandle;
unsigned char main_eeprom_read[4] = {0};
unsigned char main_eeprom_clear[2] = {0x00,0x00};
unsigned char main_eeprom_read_1[2] = {0xA5,0x02};
unsigned char main_eeprom_read_test[4] = {0};
unsigned char Security_timer_enable[2] = {0};
/* Register Application callback to trap asserts raised in the Stack */
halAssertCback = AssertHandler;
RegisterAssertCback(AssertHandler);
/* initialize the system locks */
Board_init(); //initialization of clock and peripherals.
/* Update User Configuration of the stack */
user0Cfg.appServiceInfo->timerTickPeriod = ICall_getTickPeriod();
user0Cfg.appServiceInfo->timerMaxMillisecond = ICall_getMaxMSecs();
/* Initialize all applications tasks */
//appMain();
/* Initialize ICall module */
ICall_init();
/* Start tasks of external images - Priority 5 */
ICall_createRemoteTasks();
CheckAndClearResetCause(); //Reset reason.
/* Watch dog initialization*/
watchdog_initialization();
osal_ret_val = user_osal_Read(e_JUMP_FROM_APPLN_FLAG_FOR_BOOT_ID, main_eeprom_read);
if(main_eeprom_read[0] == 0xA5) /* if jump from application //0xA5*/
{
user_osal_Write(e_JUMP_FROM_APPLN_FLAG_FOR_BOOT_ID,main_eeprom_clear);
INIT_BOOT();
}
else
{
MCAL_JUMP_To_Appln();
}
Software_Timer_Init(); //software timer initialization
xTaskCreate(CanTp_Scheduler_Task, "CanTp_Scheduler_Task", STACK_SIZE, NULL, 4, NULL);
xTaskCreate(uds_scheduler_task, "uds_scheduler_task", STACK_SIZE, NULL, 3, NULL);
MCAL_BOOT_Entry();
/* Start the FreeRTOS scheduler */
vTaskStartScheduler();
return 0;
}
I would appreciate guidance on the correct architectural approach.
Thank you.