Skip to main content
Associate III
May 4, 2025
Question

B-WB1M-WPAN1

  • May 4, 2025
  • 7 replies
  • 1602 views

Colleagues,

I need to implement the BLE_CableReplacement project on the b_wb1m_wpan1 device. Since I don’t know the services of this project (the BLE_CableReplacement.ioc file is not included), I tried to adapt the project for the b_wb1m_wpan1 device in IAR.

Steps I took:

  1. In IAR General Options, selected ST STM32WB1MMC.

  2. Copied the B-WB1M-WPAN1 folder into the BSP directory of the BLE_CableReplacement project.

  3. Added a reference in the preprocessor options.

  4. Removed stm32wbxx_nucleo.c from the project tree.

  5. Replaced it with b_wb1m_wpan1.c and commented out all instances of //#include "stm32wbxx_nucleo.h".

  6. Opened the standard set of files:

    • stm32wb55xx_flash_cm4.icf

    • startup_stm32wb55xx_cm4.s

    • system_stm32wbxx.c
      Replaced their contents via clipboard with the corresponding files from the BLE_HR_p2p_Sensor project.

  7. The system prompted me to copy b_wb1m_wpan1_conf.h into the Core → Inc directory. I did so.

  8. Replaced all instances of DMA2_Channel4 with DMA1_Channel5.

After these changes, the project compiles but gets stuck at the MX_APPE_Process() function and shows no further signs of life.

Could you please advise:

  • What did I miss?

  • What would be a better approach?

7 replies

FilipKremen
ST Employee
May 5, 2025

Hello,

where is it stuck exactly? Can you please share a screenshot?

Thank you.

 

Best regards,

ST support

Associate III
May 5, 2025

Hello.
A little later if possible. It's spinning somewhere in the sequencer. I didn't localize it yesterday

Associate III
May 5, 2025

Hello, FilipKremen
After launching, the project gives me the following information in the COM port. See attachment.
After that, at any stop, I get into the function void UTIL_SEQ_Run( UTIL_SEQ_bm_t Mask_bm ) line 207 of the file stm32_seq.c.
At the same time, I do not see ads on the smartphone in the ST BLE Toolbox application.

FilipKremen
ST Employee
May 6, 2025

Hello,

according to the return value 0x7 (Memory Capacity Exceeded), there isn't sufficient amount of resources.

Please try to change the parameters as it's mentioned in this topic. (app_conf.h file)

Solved: STM32WB Fails on SHCI_C2_BLE_Init - STMicroelectronics Community

 

Best regards,

ST support

 

Associate III
May 6, 2025

Hello, PhilipKremen.

It didn't work out quickly and easily.
I tried changing the BLE Stack parameters in the app_conf.h file both from the screenshot at the end of the link you provided and from the BLE_HR_p2p_Sensor project for B-WB1M-WPAN1.
The critical ones are:
#define CFG_BLE_NUM_GATT_SERVICES 8
#define CFG_BLE_NUM_GATT_ATTRIBUTES 30
If I decrease the first one, I will have to increase the second one.
Otherwise debugging will fail with the output
[app_entry.c][APPE_SysEvtReadyProcessing][479] >>== WIRELESS_FW_RUNNING
[app_entry.c]

With the configuration above and changing other parameters the result will remain the same
[app_ble.c][APP_BLE_Init][353] Error: SHCI_C2_BLE_Init command, result: 0x07

I could try creating a new project for B-WB1M-WPAN1, but the BLE_CableReplacement example does not have an .ioc file.

Best regards.

FilipKremen
ST Employee
May 12, 2025

Hello,

if you set #define CFG_BLE_NUM_GATT_SERVICES 4 and #define CFG_BLE_NUM_GATT_ATTRIBUTES 30, does it work?

Best regards,

ST support

Associate III
May 12, 2025

Thank you very much, PhilipKremen.
I thought that if debug information is not fully output to the console, then the application does not work.
After your words, I checked it works both for reception and transmission.
However, if you transmit a large string from a smartphone, the ST BLE Toolbox application freezes and terminates.
There are a lot of questions about the transmission speed and other parameters, but it's a matter of time.
The main thing is that it basically worked.
#define CFG_BLE_NUM_LINK 2
#define CFG_BLE_NUM_GATT_SERVICES 4
#define CFG_BLE_NUM_GATT_ATTRIBUTES 30
#define CFG_BLE_MAX_ATT_MTU (156)
#define CFG_BLE_ATT_VALUE_ARRAY_SIZE (1344)
Again, thank you very much!

FilipKremen
ST Employee
May 13, 2025

Hello,

I'm glad it's working. Please try to update the ST BLE Toolbox to the latest version.

 

Best regards,

ST support

Associate III
May 13, 2025

Hello, FilipKremen.

We have reduced the number of services from 8 to 4.
And what services have we excluded?
I tried to find the code defining the services, but I found nothing except the main service in the crs_stm.c file (void CRS_STM_Init(void), 0000fe11-8e22-4541-9d4c-21edae82ed19).
I launched the nRF Connect program, connected and did not find the latter there.
There are two standard ones and one additional one, not at all similar to our CRS.

I really want to figure out how it all works... Where can I read about it?
But if it takes too long, then I will simply rework the COM port functions. )))

 

Best regards.

FilipKremen
ST Employee
May 14, 2025

Hello,

CFG_BLE_NUM_GATT_SERVICES is for setting the maximum number of services. There is only one user service in this example. Please try to use ST BLE Toolbox application.

How to build wireless applications with STM32WB MCUs - Application note

Also, these links below could be helpful.

Migrating from STM32WB1x/5x to STM32WB1x/5x MCUs microcontrollers - Application note

STM32WB_Workshop_Presentation.pdf

 

Best regards,

ST support

Associate III
June 25, 2025

Dear colleagues.
Continuing to understand the BLE_CableReplacement application, I would like to inform you that if you enable USART buffering, you can transmit not only one character from the console, but also the entire 20-byte string.

However, I would like to use DMA when receiving and transmitting fixed-length packets.
The example is written in such a way that USART DMA is used only to output debug information, which is recommended to be disabled in low-power mode.
HW_UART_Transmit(CFG_CONSOLE_MENU, (uint8_t*)&StrToDisp[jj++], 1, 0xFFFFFFFF) is used to transmit data, and DMA is not even initialized when CFG_DEBUG_TRACE = 0.

I would like to see a standard solution from the developers for using DMA in LPM mode, as, for example, it is implemented and described in AN5406 paragraph 8.5 for the LoRa® application.
The utility provides hooks to be implemented to forbid the system to enter Stop or lower mode while the DMA isactive:
• void UTIL_ADV_TRACE_PreSendHook (void)
{ UTIL_LPM_SetStopMode((1 << CFG_LPM_UART_TX_Id) , UTIL_LPM_DISABLE ); }
• void UTIL_ADV_TRACE_PostSendHook (void)
{ UTIL_LPM_SetStopMode((1 << CFG_LPM_UART_TX_Id) , UTIL_LPM_ENABLE );}