Skip to main content
VBess.1
Associate II
March 24, 2025
Question

Not receiving VS_HCI_C2_Ready

  • March 24, 2025
  • 9 replies
  • 1361 views

Hello,

 

I'm trying to implement a custom BLE Client on a P-Nucleo-WB55 board. The ST P2p_client example runs fine on the board and I could add some traces and do little modifications in it before trying to start my project from scratch with CubeMX. It seems the VS_HCI_C2_Ready is not received in my project since I never reach a breakpoint in IPCC_C1_RX_IRQHandler. I have checked many times the differences (clocks, code generated, initialisations...) between the P2P example and my project. I don't know what more to check. Since the example runs fine, I guess it's not a stack firmware problem.

If a kind soul could enlighten me...

Thanks.

9 replies

FilipKremen
ST Employee
March 25, 2025

Hello, 

can you please share the project?

 

Best regards,

ST support

VBess.1
VBess.1Author
Associate II
March 25, 2025

Ooops, yes of course. I should have done that in the first post.

Thanks for your quick answer.

FilipKremen
ST Employee
March 28, 2025

Hello,

I tried your project and it is working on my side. Can you please try it again?

Please erase full chip flash memory and reflash the BLE stack. After uploading the BLE stack, click on "Start Wireless Stack" button and try to run your application again.

 

Best regards,

Filip Kremen

VBess.1
VBess.1Author
Associate II
April 1, 2025

I've flashed the BLE Stack Full 1.22.0, it seems to work. The Nucleo had previously an 1.13.0 version.

 

I'm still wondering why, on the same board with the same BLE stack, the P2P_client example worked and not my project...

 

Thank you

VBess.1
VBess.1Author
Associate II
April 3, 2025

After a few tests it appears it's not working. I've added a

UTIL_SEQ_SetTask(1 << CFG_TASK_START_SCAN_ID, CFG_SCH_PRIO_0);

at the very end of APP_BLE_Init(). In the traces I get the line " ** START GENERAL DISCOVERY (SCAN) ** " but nothing more happens. No timeout after 10s and most of all no HCI_LE_ADVERTISING_REPORT_SUBEVT_CODE event in SVCCTL_App_Notification().

Still the P2P_client, on the same board same stack and same line added at the end of APP_BLE_Init() is working.

I've tried to modify the ioc from the P2P_client, a load of files are not regenerated and the project cannot compile anymore.

I've tried to import the P2P_client ioc alone in CubeIDE. That compiles but doesn't work.

Starting from the P2P_client code "as is" is not an option for us since we have a lot of modules to add (SPI, some GPIOs, probably QSPI and others) and merging "by hands" is just crazy when CubeMX is meant to avoid this process. So far, the time I spent on Cube tools is a total loss.

FilipKremen
ST Employee
April 3, 2025

Hello,

can you please share the modified project again?

Thank you.

 

Best regards,

ST support

VBess.1
VBess.1Author
Associate II
April 4, 2025

Here it is.

When I put a breakpoint in SVCCTL_App_Notification() in case HCI_LE_META_EVT_CODE, sub case HCI_LE_ADVERTISING_REPORT_SUBEVT_CODE, it never goes there. Also the scan stops after a 10s timeout on the P2P_Client, but not with my project.

FilipKremen
ST Employee
April 4, 2025

Hello,

I was also able to reproduce the same behavior. Right now, I'm not sure where might be the problem.

To not waste the time, I have prepared for you P2P_client project which can you modify. I was trying to add SPI via CubeMX and it compiles fine. It's based on STM32Cube_FW_WB_V1.21.0 package.

If you encounter error messages regarding some files path location, please try to clean and refresh the project.

Can you please try it and let me know it works on your side? Thank you.

 

Best regards,

ST support

VBess.1
VBess.1Author
Associate II
April 7, 2025

I remain polite and courteous, but I'm getting tired of wasting time with tools that are supposed to save me time!!

 

Your last zip "seems" to work (the few tests I made are ok)...as long as I don't add extra files to the project! I join two projects. The first (ST_try.7z) is basically your project with a extra C file. It works. Starting from there, if I modify the ioc CubeMX fails to regenerate the project. I've added a screenshot of the message box I get and the log file it tells me. The result is the second project (ST_try_modified_ioc.7z). This project fails to compile with undefined references to HAL_TIM_xxx functions.

 

I'm working with CubeMX 6.13 and CubeIDE 1.16.0, Linux versions.

 

VBess.1
VBess.1Author
Associate II
April 7, 2025

I nearly forgot. Despite the error message box, CubeMX still claims "Project has been successfully generated"...

FilipKremen
ST Employee
April 7, 2025

Hello,

two files stm32wbxx_hal_tim.c and stm32wbxx_hal_tim_ex.c weren't included in the project.

To fix it, please add these two files from ST_try_modified_ioc\ST_try\P2P_client\Drivers\STM32WBxx_HAL_Driver\Src folder to the project (link to files).

Also, please try to update the tools to the latest versions.

 

Best regards,

ST support

 

VBess.1
VBess.1Author
Associate II
April 7, 2025

I have updated my tools to CubeMX 6.14 and CubeIDE 1.18. It's the same.

Thank you for the two files but what I try to point you is that CubeMX fails to generate an usable project (starting from the last project you posted), WHATEVER the modification you make to the ioc, as soon as you add external code. The TIM example was just...an example to send to you. Whichever peripheral you add/remove/modify produce the same effect: a non compilable project.

I'm used to external code/library in my STM32 projects, I'm used to change things in CubeMX in such projects without any problem.

 

I'm now wondering if it has ever been possible to build a BLE Central project from scratch and using MX...

FilipKremen
ST Employee
April 8, 2025

Hello,

I have entered an internal ticket regarding the code generation, and I will let you know once I receive any feedback.

It is possible to create P2P client using CubeMX, however some changes may be necessary to add compared to the original example.

 

Best regards,

ST support

FilipKremen
ST Employee
April 9, 2025

Hello,

please try to open the .ioc file in standalone CubeMX and choose the "Generate under root" option and generate the code. It should fix the issue.

 

Best regards,

ST support