cancel
Showing results for 
Search instead for 
Did you mean: 

I am using "P-NUCLEO-WB55". My application needs BLE over RTOS, So I tried the example code of "BLE_HeartRateFreeRTOS" ,I just put blinking led code in default task but I am not able to observe the output.(Initialization for LED PIN is added)

SMane.2
Associate II

I tried to debug the code by changing the "CFG_DEBUGGER_SUPPORTED" to 1 , but still we are facing the issues, RTOS tasks are not executing as expected. We found some task in ble_app.c with priority of "osPriorityNone" which is 0. Does this example code has any issue?

5 REPLIES 5
Aishwarya
Associate III

hi, @SMane.2 (Community Member)

In BLE_HeartRateFreeRTOS example code GPIO Pins( PB5 for LED1, PB0 for LED2 and PB1 for LED3) are not initialized as GPIO output mode.

  • Add below code in MX_GPIO_Init() function after enabling the clock

 GPIO_InitTypeDef GPIO_InitStruct = {0};

 /*Configure GPIO pins : LD2_Pin LD3_Pin LD1_Pin */

 GPIO_InitStruct.Pin = LED1_PIN|LED2_PIN|LED3_PIN;

 GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;

 GPIO_InitStruct.Pull = GPIO_NOPULL;

 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;

 HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);

 HAL_GPIO_WritePin(GPIOB, LED1_PIN|LED2_PIN|LED3_PIN, GPIO_PIN_RESET);

SMane.2
Associate II

Thanks,@Aishwarya​ 

I already added this things in the  MX_GPIO_Init() function, but still it was not working. It was going in task only single time. Now I changed "CFG_LPM_SUPPORTED" to 0. So after disabling the LOW Power Mode, now its executing all task properly. Is low power mode making any problem to RTOS task? How can I optimize power? and implement sleep modes with BLE & RTOS both?

ABiry.1
Associate

1

JPaul.3
Associate II

I am finding the same issue, did anyone find a solution to this problem?

SMane.2
Associate II

hi @Community member​  After disabling the LOW Power Mode, the problem resolved(CFG_LPM_SUPPORTED = 0). If you want low power mode enabled(CFG_LPM_SUPPORTED = 1) you can change this "configEXPECTED_IDLE_TIME_BEFORE_SLEEP" parameter, On code regeneration it will be 2. You can increase to 10 to 30 Ticks as per your requirement. In FreeRTOS.h file you will find this parameter