cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB Getting Started Series WB15 issue

Shahin
Associate II

Hello, I am following this tutorial, but it is designed for the WB55 and I am using the WB15.

I have managed to get the LED task before this one working. However with this task I do not get an output to the App.

I have modified the code to have an LED on button press as shown below:

void myTask(void)

{

if(!HAL_GPIO_ReadPin(B2_GPIO_Port, B2_Pin))

{

UpdateCharData[0] ^= 0x1;

Custom_Mycharnotify_Update_Char();

HAL_GPIO_TogglePin(LD1_GPIO_Port, LD1_Pin);

}

UTIL_SEQ_SetTask(1 << CFG_TASK_MY_TASK, CFG_SCH_PRIO_0);

}

Am I correct in saying the routine works as it is able to re-enter the function (using LED as an indicator that it is) on button press and my issue is strictly these lines of code:

UpdateCharData[0] ^= 0x1;

Custom_Mycharnotify_Update_Char();

Thank you,

Shahin Haque

https://www.youtube.com/watch?v=Zgw3wRpGSRQ&list=PLnMKNibPkDnG9JRe2fbOOpVpWY7E4WbJ-&index=17&ab_channel=STMicroelectronics

3 REPLIES 3
Shahin
Associate II

0693W00000WJkafQAD.png 

ignore the line numbers as this is a different board (I am using NUCLEO-WB15), but the code is in the correct location for each file.

Shahin
Associate II

ANSWER: I have replaced the custom_app.c with the WB55 custom.app.c file and have it working. I will investigate the difference and reply for others with the same issue.

Shahin
Associate II

The difference is the updatedflag variable,

void Custom_Mycharnotify_Send_Notification(void) /* Property Notification */

{

 uint8_t updateflag = 0;

 /* USER CODE BEGIN Mycharnotify_NS_1*/

 /* USER CODE END Mycharnotify_NS_1*/

 if (updateflag != 0)

 {

  Custom_STM_App_Update_Char(CUSTOM_STM_MYCHARNOTIFY, (uint8_t *)NotifyCharData);

 }

 /* USER CODE BEGIN Mycharnotify_NS_Last*/

 /* USER CODE END Mycharnotify_NS_Last*/

 return;

}

The if statement will never be entered as updateflag will always equal 0

this is stock code from MXCube. removing this allows the code to work