stm32duino/STM32duinoBLE

can't get P-nucleo-WB55RG (MB1355D) to work

thijses opened this issue · 4 comments

(edit: accidentally pressed Ctrl+Enter when writing, and it posted prematurely)
Dear creator(s) of STM32duinoBLE,
This library would be an awesome tool for a project i'm doing, BUT,
i can't get past BLE.begin() in the example sketch.
I did some minor digging (with the intent to save you some time) using the debugger, and it makes it to here:
BLE.begin()
HCI.begin() (line 41 in BLELocalDevice.cpp)
_HCITransport->begin() (line 92 in HCI.cpp)
stm32wb_start_ble() (line 437 in HCISharedMemTransport.cpp)
SHCI_C2_BLE_Init() (line 666 in HCISharedMemTransport.cpp)
which returns the enum: SHCI_CmdStatus_t
but it returns 0xFE, which is one of the enum options

P.S. using PRINT_IPCC_INFO it can correctly print the currently flashed BLE firmware (line 431 in HCISharedMemTransport.cpp)
and i'm using only app_conf_default.h

I've tried several different BLE firmwares, from V1.16.0 to 1.13.3 (yes, all stm32wb5x_BLE_HCILayer_fw.bin, and yes i used the starting address from the Release_notes table every time)
I flashed using STM32CubeProgrammer, with FUP at 1.2.0 and got no error messages during flashing.
The abovementioned function returns 0xFE for all firmwares i tested, so presumably it's not a fluke

I've confirmed the hardware works (but using an entirely different environment: https://github.com/GrumpyOldPizza/ArduinoCore-stm32wb )

any ideas as to why it would respond with a value not outlined in the enum?

Hi @thijses
to use the WB55RG you have to update the copro binary as stated in the README.md:

In order to use this library with SM32WBxx series, you need to update the STM32WB Copro Wireless Binaries
with stm32wbxx_BLE_HCILayer_fw.bin depending of your mcu:
https://github.com/STMicroelectronics/STM32CubeWB/tree/master/Projects/STM32WB_Copro_Wireless_Binaries
Each subdirectories contains binaries and Release_Notes.html which explain how to update it.

A new STM32Cube has been released and I do not yet test it. So I advice to use the v1.15.0:
https://github.com/STMicroelectronics/STM32CubeWB/tree/v1.15.0/Projects/STM32WB_Copro_Wireless_Binaries/STM32WB5x

I've tested it when updating to this version and it works.

i might be an idiot, please confirm:
do you need to hit the "Start Wireless Stack" button after updating BLE firmware in STM32CubePorgrammer?
i just reflashed 1.15.0 (again), and this time i hit that start button,
now my example sketch appears to work

IIRW, yes. I noticed sometimes Cube programmer requires to hit twice, for example I always hit twice Start FUS. Problem is raised internally and hope will be fixed, but not on my scope.

alright, dang. I feel a little silly, but my problem is solved!
thank you for your incredibly speedy reply

for future TL;DR:
i just needed to try pressing "start Wireless Stack" in STM32CubeProgrammer after uploading
i just tried with FW 1.16.0 and it worked, but only on the second time i used the start button for some reason