Skip to main content
October 6, 2020
Solved

Advertise don't run in HearthRateFreeRTOS project

  • October 6, 2020
  • 10 replies
  • 1925 views

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?

This topic has been closed for replies.
Best answer by Remi QUINTIN

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

10 replies

Remi QUINTIN
Technical Moderator
October 14, 2020

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

October 15, 2020

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

Remi QUINTIN
Technical Moderator
October 15, 2020

​JUst do a read acess at 0x5800040C

Remi QUINTIN
Technical Moderator
October 15, 2020

​the 16th bit is C2BOOT.

October 15, 2020

0693W000004JruOQAS.png16th bit is 0

I upgraded the stack but it still being 0

October 15, 2020

the other projects run correctly with the advertise

Remi QUINTIN
Technical Moderator
October 19, 2020

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?

October 19, 2020

the box of ESE is checked

SFSA = 0xcb

SBRV=0x32c00

October 19, 2020

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.

October 19, 2020

could you please tell me what do I have to add to my project after generation of the ble+freertos project(the main functions) so as to at least ble worked properly? May be I'm missing some steps