Hello,
I'm working on on a KW45 based board, I have two tasks to be run on the same time :
The firts one is to emit BLE CW on a specific channel :
void sFct_StartBleRadiationTask(void *argument)
{
sFct_bleRadiationTask((uint32_t)argument);
}
static OSA_TASK_DEFINE(sFct_StartBleRadiationTask, 2U, 1, 1024, 0);
And the BLE INIT specific tasks are being created here :
tenuStatusType
BLE_MGR_enuInit( BLE_MGR_tstr_InitParamsData *pstrBLEinitParams )
{
tenuStatusType fct_status = STD_SUCCESS ;
tpfTaskFunction pfTaskFct_MGR = (tpfTaskFunction)&BLE_MGR_vidTaskFct_MGR ;
tpfTaskFunction pfTaskFct_BLE = (tpfTaskFunction)&BLE_MGR_vidTaskFct_BLE ;
if ( pstrBLEinitParams == NULL )
{
fct_status = STD_FAILURE ;
}
if ( fct_status == STD_SUCCESS )
{
BLE_MGR_pfBleMgrEventHandler = pstrBLEinitParams->pfBleMgrEventHandler ;
// static tenuStatusType BLE_MGR_enuBleMgrEventHandler( uint32_t u32_EventId, void *pData ) ;
BLE_MGR__AL__vidRegisterCallback( BLE_MGR_enuBleMgrEventHandler ) ;
}
if ( fct_status == STD_SUCCESS )
{
// create task MGR
BLE_MGR_strTask_MGR.sTaskName = BLE_MGR_TASK_MGR_NAME ;
BLE_MGR_strTask_MGR.u32StackSize = BLE_MGR__TASK_MGR_STACK_SIZE ;
BLE_MGR_strTask_MGR.u8TaskPriority = 2U ;
BLE_MGR_strTask_MGR.u8StackBuffer = &(BLE_MGR_pu8TaskFctStackBuffer_MGR[0]) ;
fct_status = OSA_enuCreateTaskStatic( pfTaskFct_MGR, &BLE_MGR_strTask_MGR, NULL ) ;
if ( fct_status == STD_SUCCESS )
{
// create event set for task BLE_MGR_TASK_MGR :
BLE_MGR_EventSetHandle_MGR = OSA_strCreateEventStatic( &BLE_MGR_EventSetStruct_MGR ) ;
// create event set for task BLE_MGR_TASK_BLE :
BLE_MGR_EventSetHandle_BLE = OSA_strCreateEventStatic( &BLE_MGR_EventSetStruct_BLE ) ;
if ( ( BLE_MGR_EventSetHandle_MGR == NULL )
|| ( BLE_MGR_EventSetHandle_BLE == NULL ) )
{
fct_status = STD_FAILURE ;
}
}
}
if ( fct_status == STD_SUCCESS )
{
// create task BLE
BLE_MGR_strTask_BLE.sTaskName = BLE_MGR_TASK_BLE_NAME ;
BLE_MGR_strTask_BLE.u32StackSize = BLE_MGR__TASK_BLE_STACK_SIZE ;
BLE_MGR_strTask_BLE.u8TaskPriority = 2U ;
BLE_MGR_strTask_BLE.u8StackBuffer = &(BLE_MGR_pu8TaskFctStackBuffer_BLE[0]) ;
fct_status = OSA_enuCreateTaskStatic( pfTaskFct_BLE, &BLE_MGR_strTask_BLE, NULL ) ;
}
And here is where I create the BLE CW emission, and init and start the BLE so that I can start advertising after the CW emission is done :
BLE_MGR_tstr_InitParamsData strBLEinitParams ;
tenuStatusType JOB_WorkflowJobInit(void)
{
tenuStatusType xReturn = STD_FAILURE;
/* Create button task */
xWorkflowTaskHandle.u32StackSize = WORKFLOW_DISPATCHER_TASK_STACK_SIZE;
xWorkflowTaskHandle.u8TaskPriority = WORKFLOW_DISPATCHER_TASK_PRIORITY;
xWorkflowTaskHandle.sTaskName = WORKFLOW_DISPATCHER_TASK_NAME;
xWorkflowTaskHandle.u8StackBuffer = aWorkflowStackBuffer;
xWorkflowTaskHandle.strTaskContext.strTaskBuffer = XWorkflowTaskCtx;
xReturn = OSA_enuCreateTask((tpfTaskFunction)WorkflowJobOperation, &xWorkflowTaskHandle, NULL);
KFB_MGR_InitializeBTNCallback(xWorkflowBtnWindowCallback);
PLATFORM_InitGenfsk();
OSA_TaskCreate((osa_task_handle_t)s_startRadiationTaskHandle, OSA_TASK(sFct_StartBleRadiationTask), NULL);
strBLEinitParams.pfBleMgrEventHandler = KFB_MGR_enuBleMgrEventHandler ;
// init BLE module
BLE_MGR_enuInit( &strBLEinitParams ) ;
/* init of BLE stack */
BLE_MGR_enuStartBLE() ;
return xReturn;
}
The problem that I have is if Ido that the CW(continus wave emission) will not work but the ADV works just fine, and when I try to manipulate the tasks priority in BLE_MGR_enuInit() to make them less, the CW emission works fine but when I try to Advertise i get an assert error in Controller_SetTxPowerLevel :
/* Set New Lowpower Constraint on Advertising start request */
( void )PWR_SetLowPowerModeConstraint(PWR_WFI);
(void)Controller_SetTxPowerLevel(ADV_POWER_DBM, channelId);
/*LED ON*/
GPIO_PinWrite(DIAG_LED_GPIO, DIAG_LED_PIN, DIAG_LED_ON);
BluetoothLEHost_StartAdvertising(&RADIATION_strAdvertisingData, NULL, NULL);
Here is the stack of the error :

Help please !
Thank you in advanced.