2020-10-06 09:56 AM
Hello!
I have created a new project based on the ST example BLE_HeartRateFreeRTOS. I made the comparisons between both projects and added what was missing in my project. I think that I have copied everything that I should but the advertising doesn't start. The program doesn't achieve the function APP_BLE_Init . It should propably be called by the task ShciUserEvtProcessId = osThreadNew(ShciUserEvtProcess, NULL, &ShciUserEvtProcess_attr); but it doesn't happen. When I pause the debugging the program goes to function vPortValidateInterruptPriority . Could someone help to solve this issue?
Solved! Go to Solution.
2020-10-14 04:52 AM
It seems like the RF stack is not active.
Could you check the value of the C2BOOT bit in the PWR control register 4 (PWR_CR4) at address PWR_CR4 = @0x5800040C?
It should be set to 1 if the RF stack is running.
2020-10-14 04:52 AM
It seems like the RF stack is not active.
Could you check the value of the C2BOOT bit in the PWR control register 4 (PWR_CR4) at address PWR_CR4 = @0x5800040C?
It should be set to 1 if the RF stack is running.
2020-10-14 05:22 PM
where can I find it? it is not in option bytes
2020-10-15 02:16 AM
JUst do a read acess at 0x5800040C
2020-10-15 02:17 AM
the 16th bit is C2BOOT.
2020-10-15 03:21 AM
16th bit is 0
I upgraded the stack but it still being 0
2020-10-15 03:35 AM
the other projects run correctly with the advertise
2020-10-19 02:40 AM
In normal condition CPU2 core is kept on hold by CPU1 via the C2BOOT bit
Following a device reset the CPU2 will only boot after CPU1 has set the C2BOOT bit.
This done using the macro LL_PWR_EnableBootC2.in the include file STM32Cube_FW_WB_V1.9.0\Drivers\STM32WBxx_HAL_Driver\Inc
This macro is called in TL_Enable() function which is last function called as part of the CPU1 core initialization APPE_Init() via the cal to appe_TL_init in app_entry.c file.
appe_Tl_Init() function Initializes all transport layers and start CPU2 which will send back a ready event to CPU1.
In fact, you may be missing this ready event.
One possibility if the CPU2 core is not booting to the right code (SBRV pointer).
Could you make a dump of the secure option byte just to check the ESE, SFSA and SBRV values?
Another possibility is something wrong happened during CPU1 core initialisation. Could you check that you call at least the TL_Enable function?
2020-10-19 05:35 AM
the box of ESE is checked
SFSA = 0xcb
SBRV=0x32c00
2020-10-19 06:00 AM
TL_Enable is called.
Function shci_init(APPE_SysUserEvtRx, (void*) &SHci_Tl_Init_Conf); is also called but APPE_SysUserEvtRx where is located APP_BLE_Init is not called.