cancel
Showing results for 
Search instead for 
Did you mean: 

Advertise don't run in HearthRateFreeRTOS project

Kolab
Senior

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?

1 ACCEPTED SOLUTION

Accepted Solutions
Remi QUINTIN
ST Employee

​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.

View solution in original post

10 REPLIES 10
Remi QUINTIN
ST Employee

​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.

Kolab
Senior

where can I find it? it is not in option bytes

Remi QUINTIN
ST Employee

​JUst do a read acess at 0x5800040C

Remi QUINTIN
ST Employee

​the 16th bit is C2BOOT.

Kolab
Senior

0693W000004JruOQAS.png16th bit is 0

I upgraded the stack but it still being 0

Kolab
Senior

the other projects run correctly with the advertise

Remi QUINTIN
ST Employee

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?

Kolab
Senior

the box of ESE is checked

SFSA = 0xcb

SBRV=0x32c00

Kolab
Senior

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.