cancel
Showing results for 
Search instead for 
Did you mean: 

How to do coding in multi-core controller ?

DMist
Associate II

I am new to STM32WB, i have written BLE middle-ware application it is working on Scheduler, in main while Loop SCH_Run(~0) is handlling the entire middleware, now i want to wirte the actual application for Cortex-M4 but when i add anything in the While loop my BLE Stack stop working. So kindly guide me how to code in Multi-core controller

6 REPLIES 6
Stecklo
Senior

Have you flashed wireless stack on the CPU2?

if yes, then

  1. How do you register that "BLE Stack stop working"?
  2. What hardware/software tools do you use for programming/debugging/

DMist
Associate II

I am using STM32Cube IDE with STM32WB55 nucleo board and i successfully run HandOns from STM32WB MOCC but when i add any thing in While Loop Bluetooth application stops working

Stecklo
Senior

If literally anything added to while loop leads to errors, that's confusing. But usually one doesn't need to add any code to the loop explicitly. You should use scheduler to run functions in the loop instead.

DMist
Associate II

can u please show me some example of using scheduler for customized function calling??

Stecklo
Senior
app_conf.h
 
typedef enum
{
    CFG_FIRST_TASK_ID_WITH_NO_HCICMD = CFG_LAST_TASK_ID_WITH_HCICMD - 1,        /**< Shall be FIRST in the list */
    CFG_TASK_SYSTEM_HCI_ASYNCH_EVT_ID,
/* USER CODE BEGIN CFG_Task_Id_With_NO_HCI_Cmd_t */
 
/* USER CODE END CFG_Task_Id_With_NO_HCI_Cmd_t */
    CFG_LAST_TASK_ID_WITHO_NO_HCICMD                                            /**< Shall be LAST in the list */
} CFG_Task_Id_With_NO_HCI_Cmd_t;
app_entry.c
 
static void appe_Tl_Init( void )
{
<...>
  SCH_RegTask( CFG_TASK_SYSTEM_HCI_ASYNCH_EVT_ID, shci_user_evt_proc );
<...>
}
 
void shci_notify_asynch_evt(void* pdata)
{
  SCH_SetTask( 1<<CFG_TASK_SYSTEM_HCI_ASYNCH_EVT_ID, CFG_SCH_PRIO_0);
  return;
}

This code is generated by CubeMX.

SCH_RegTask() registers shci_user_evt_proc() function in the scheduler

SCH_SetTask() puts shci_user_evt_proc() in the while loop

Stecklo
Senior

Maybe I was somewhat ambiguous. SCH_SetTask() doesn't really put the function in the loop. It schedules the function to be executed on the next call of the SCH_Run(). Only once. If you need to execute function repeatedly, you need to call SCH_SetTask() repeatedly.

The goal is to call funcions in interrupt handlers, while executing them in the main loop.