Skip to main content
Lotta
Associate II
December 9, 2022
Question

Bug for BLE Init in new wb5 firmware 1.15

  • December 9, 2022
  • 9 replies
  • 6339 views

I've used BLE for a month now on the wb5mmg with the 1.14.1 firmware with the steval-proteus board. The setup in the .ioc for new projects was always the same:

  • HSEM, IPCC, RCC, RTC, RF, (USART)
  • Activating BLE
  • Using Default P2P Settings or Custom Template

Then I used the ST BLE Toolbox App to look at the services. It was never any trouble and worked already without much user config

Earlier this week I updated the Cube IDE to 1.11 and with it updated the firmware for the wb5 to 1.15.0.

After the update new projects created on the 1.15 firmware would not advertise.

APP_BLE_Init(void) (app_ble.c) was never called because the function where it was called in was registered as a Task but never set.

Function calls were as follows:

  • app_entry.c: appe_Tl_Init(void) was called

0693W00000WKe8SQAT.png

  • In this function shci_user_evt_proc is registered as task for the sequencer
  • Also APPE_SysUserEvtRx is passed as a function pointer
    • This function is important because: APPE_SysUserEvtRx (app_entry.c) -> APPE_SysEvtReadyProcessing (app_entry.c) -> APP_BLE_Init (app_ble.c)
  • In shci_user_evt_proc the passed function pointer of APPE_SysUserEvtRx is called
  • shci_user_evt_proc is registered but never set and therefore never called. In stm32_seq.c: UTIL_SEQ_RegTask() was called UTIL_SEQ_SetTask() was never called

It is important to notice that projects created with firmare 1.14.1 and migrated to 1.15.0 did not have this issue and worked like before.

Just projects created on the 1.15.0 firmware showed this issue. I created mutliple (8) projects and tried different BLE configurations, all with the same issue.

It would have helped a lot if the new IDE version 1.11 would have been still able to change the firmware version of both new projects in the creation dialog and existing projects in the .ioc file in Project Manager.

In the end I deinstalled the IDE and downloaded the 1.10 to work with firmware 1.14.1. Now everything is working again.

This topic has been closed for replies.

9 replies

Remy ISSALYS
ST Technical Moderator
January 5, 2023

Hello,

Which version of BLE Stack are you using? When the issue occurs did you received the ready event from CPU2 (SHCI_SUB_EVT_CODE_READY) or not? Where is stuck the code when the issue occurs?

Best Regards

Lotta
LottaAuthor
Associate II
January 9, 2023

Hello,

The Version for BLE Stack:

stm32wb5x_BLE_Stack_full_extended_fw.bin: V1.15.0

stm32wb5x_BLE_Stack_full_fw.bin: V1.15.0

stm32wb5x_BLE_Stack_light_fw.bin: V1.15.0

Where can I see the SHCI_SUB_EVT_CODE_READY?

The code is not stuck at all, just the functions mentioned above are never reached and therefore the BLE is not initialized. The main loop runs fine.

Best Regards

Lotta
LottaAuthor
Associate II
January 9, 2023

@Remy ISSALYS​ 

Remy ISSALYS
ST Technical Moderator
January 9, 2023

Hello,

With the stm32wb5x_BLE_Stack_full_fw.bin, if you generate a P2P Server, is it working?

You can see the SHCI_SUB_EVT_CODE_READY event in APPE_SysUserEvtRx function see app_entry.c file.

Best Regards

Lotta
LottaAuthor
Associate II
January 10, 2023

Hello @Remy ISSALYS​ ,

Thank you very much for your help! with the stm32wb5x_BLE_Stack_full_fw.bin it is finally working :)

Best Regards

Jtron.11
Senior
March 19, 2023

Hi Lotta,

I followed this Wiki page that Remy told me to follow but I got the same error.

The link example is for STM32WB55 but I am using STM32WB5MMGx. Can you very please help me give me some pointers or ioc file that I can try since you are using the same STM32WB5MM?

I used the BLE_HeartRate example from STM32 project, and my custom board works great, but as soon as I tried to remove all the BSP and extra file, or edit .IOC file, and all errors broke lose.

I also use stm32wb5x_BLE_Stack_full_fw.bin: V1.15.0 and STM32Cube FW_WB V1.16.0.

I literally created about 20+ projects from examples or app note AN5289 but not successfully create my own custom template or P2P just for advertising.

Please help.

Lotta
LottaAuthor
Associate II
March 20, 2023

Hi @Jtron.1​ ,

For creating my own P2P/Custom Template this video:

https://www.youtube.com/watch?v=i10X4Blr8ns

helped me a lot on what I need to set up in the .ioc.

Best regards

Jtron.11
Senior
March 20, 2023

Thank you so much for your reply. I also use the youtube link first. But I am not successfully let my device just broad cast the name.

When I debugged it seem like the IPCC_C1_RX_IRQHandler never break.

Do you remember any trick or add anything additional data base from the video?

Lotta
LottaAuthor
Associate II
March 20, 2023

Sorry, apart from what is done in the video I did not add any additional settings to get a running version. Maybe try a different BLE App on your connecting device if you can't see the advertisement. I can reccoment LightBlue BLE App. But if it is a code-related problem I don't know how to fix it.

Remy ISSALYS
ST Technical Moderator
March 20, 2023

Hi @Jtron.1​,

Can you describe your issue and what is going wrong? Which stack are you using?

Best Regards

Jtron.11
Senior
March 22, 2023

@Remy ISSALYS​  Can you please share with us or help me to understand why there are differences in the linker file one is generate from CubeMX and one provided by BLE_HeartRate example from STM32 repo?

Jtron.11
Senior
March 20, 2023

As I wrote above,

I am using use stm32wb5x_BLE_Stack_full_fw.bin: V1.15.0 and STM32Cube FW_WB V1.16.0, and STM32CubeMX version 6.8.0 for STM32WB5MMGHx, and I followed exactly the steps from this Videohttps://www.youtube.com/watch?v=i10X4Blr8ns

Just about 15 minutes ago I found the solution, but I don't know exactly understand the reason yet.

If I used the BLE_HeartRate linker file to replace the linker file from CubeMX generated after follow the video or the wiki page you provide to me, my custom app will work. The BLE_HeartRate source code is coming straightly from STM32WB example for STM32WB5MMGHx

These are the differences from the generated custom app linker file

/* Highest address of the user mode stack */

_estack = ORIGIN(RAM1) + LENGTH(RAM1);  /* end of RAM1 */

/* Generate a link error if heap and stack don't fit into RAM */

....

/* Initialized data sections goes into RAM, load LMA copy after code */

 .data :

 {

  . = ALIGN(4);

  _sdata = .;    /* create a global symbol at data start */

  *(.data)      /* .data sections */

  *(.data*)     /* .data* sections */

  *(.RamFunc)    /* .RamFunc sections */

  *(.RamFunc*)    /* .RamFunc* sections */

  . = ALIGN(4);

  _edata = .;    /* define a global symbol at data end */

 } >RAM1 AT> FLASH

...

 .ARM.attributes 0    : { *(.ARM.attributes) }

  MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED

  MB_MEM1 (NOLOAD)    : { *(MB_MEM1) } >RAM_SHARED

  /* used by the startup to initialize .MB_MEM2 data */

 _siMB_MEM2 = LOADADDR(.MB_MEM2);

 .MB_MEM2 :

 {

  _sMB_MEM2 = . ;

  *(.MB_MEM2) ;

  _eMB_MEM2 = . ;

 } >RAM_SHARED AT> FLASH

}

vs.

BLE_HeartRate

/* Highest address of the user mode stack */

_estack = 0x20030000;  /* end of RAM */

/* Generate a link error if heap and stack don't fit into RAM */

...

 /* Initialized data sections goes into RAM, load LMA copy after code */

 .data : 

 {

  . = ALIGN(4);

  _sdata = .;    /* create a global symbol at data start */

  *(.data)      /* .data sections */

  *(.data*)     /* .data* sections */

  . = ALIGN(4);

  _edata = .;    /* define a global symbol at data end */

 } >RAM1 AT> FLASH

...

.ARM.attributes 0    : { *(.ARM.attributes) }

  MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED

  MB_MEM1 (NOLOAD)    : { *(MB_MEM1) } >RAM_SHARED

  MB_MEM2 (NOLOAD)    : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED

Remy ISSALYS
ST Technical Moderator
March 24, 2023

Hello,

There is an extra dot in auto-generated linker script: *(.MB_MEM2) ; instead of *(MB_MEM2) ;

Due to this typo, the buffers that need to be in SRAM2 are not placed there, so your application doesn't work. For more details, see this post, it will be corrected in the next release.

Best Regards