cancel
Showing results for 
Search instead for 
Did you mean: 

BLE basic library support for Zephyr v4.0.0

BKaiwalya
Associate II

Hi, 

I am programming the STM32 NUCLEOWBA55CG with Zephyr v4.0.0 and our application is using the BLE stack.

Due to flash limitations, we would like to use the basic stack and link layer BLE libraries for the STM32WBA series  

(see communication with STM before)

Zephyr itself is not adding a lot of FLASH , the bottleneck is the size of the STM32WBA Link Layer lib.

Why 
When building with Zephyr you can not guess what customer is willing to do : a basic peripheral ? a central device ? 
Zephyr is so flushing from our repository the Full Link Layer stack (254Kbytes) to accommodate all capabilities.

How to overcome
Now for sure you can still replace this Full Link Layer stack by the Basic Link Layer stack, and you will drastically reduce to overall Flash needs.
If so Build Peripheral HIDS example will consume FLASH:      220460 B         1 MB     21.02% 
Basic Lib is for sure providing needed feature for peripheral device (STM32WBA Bluetooth® LE Stack Integration - stm32mcu)

How to replace :
In zephyr\modules\hal\stm32\zephyr\blobs\stm32wba\lib replace LinkLayer_BLE_Full_lib.a & stm32wba_ble_stack_llo.a by LinkLayer_BLE_Basic_lib.a & stm32wba_ble_stack_llobasic.a (from the STM32WBACube 1.3.1 package) 
Zephyr 3.7.0 - - > STM32WBACube 1.3.1
Zephyr 4.0 (W46) - - > STM32WBACube 1.4.1 (latest)

 

I tried to download the 

STM32WBACube 1.4.1 (latest) package and used the files stm32wba_ble_stack_llobasic.a and LinkLayer_BLE_Basic_lib.a and renamed them to stm32wba_ble_stack_llo.a & LinkLayer_BLE_Full_lib.a for successful compilation. This strategy worked while building with Zephyr v3.7.0 but failed while building with Zephyr v4.0.0. see error below:

CMake Error at C:/zephyrproject/zephyr/cmake/modules/extensions.cmake:1859 (message):
  Blob for path
  "C:\zephyrproject\modules\hal\stm32\zephyr\blobs\stm32wba\lib\LinkLayer_BLE_Full_lib.a"

 

Could you please share the correct approach for building with the basic BLE libs together with Zephyr v4.0.0

1 REPLY 1
Remy ISSALYS
ST Employee

Hello,

To switch to basic variant, the following step need to be done:

  • Modify modules/hal/stm32/zephyr/module.yml file to:   
    • Recover LinkLayer_BLE_Basic_lib.a and stm32wba_ble_stack_llobasic.a libs
    • Update the sha256 (you can used sha256sum.exe)

  • Modify modules/halstm32/lib/CMakeLists.txt file to:
    • Replace “ LinkLayer_BLE_Full_lib.a” by “LinkLayer_BLE_Basic_lib.a” and "stm32wba_ble_stack_llo.a" by "stm32wba_ble_stack_llobasic.a"

Best Regards