2019-04-08 01:14 AM
Hello ,
I am fairly new to microcontroller programming and sorry if this is a noob question. I have a STM32WB55RG board and I want to learn developing a BLE application.
I did an example from STM Workshop (Hands On) and it worked very well. Then i tried configuring CubeMX myself, change the code a bit and still got a good result.
But today, suddenly the BLE stop functioning. I cannot detect the device using any BLE scanner application. At first i thought maybe it got into some error handler eg. HardFault or MemManage. But it dindnt.
I tried debugging using LED and I found out that the code didnt even land on the APP_BLE_Init() function.
So I thought maybe I should re-flash the BLE stack binary. Followed the instructions and using CubeProgrammer CLI, but the device cant be found. Then I tried using CubeProgrammer UI, cant connect to device. I tried with no jumper on BOOT0 and VDD, also connected via ST-Link USB, successfully downloaded the BLE Stack binary on address 0x080CB000.
But still BLE is not active. Anyone maybe experience the same issue or can help me solve this problem?
Thank you very much.
P/s: Sorry for the long post. I thought maybe if I tell the whole story, someone can figure out the solution.
2019-04-17 02:58 AM
Hello,
if you are trying to do the hands-on and start from the beginning using the latest CubeMX 5.1 which doesnt have IPCC setting, you need to write the IPCC TX and RX Interrupt Handler afterwards because it is missing from the stm32wbxx_it.c file.
/**
* @brief This function handles IPCC RX occupied interrupt.
*/
void IPCC_C1_RX_IRQHandler(void)
{
HW_IPCC_Rx_Handler();
}
/**
* @brief This function handles IPCC TX free interrupt.
*/
void IPCC_C1_TX_IRQHandler(void)
{
HW_IPCC_Tx_Handler();
}
It should works fine.
Regards.
2019-04-17 07:28 PM
Thank you very much. The code can land on HW_IPCC_Rx_Handler( void ) than go to HW_IPCC_SYS_EvtHandler();
but it cant go to APPE_SysUserEvtRx( void * pPayload ) fuction . Do i need to add some codes?
2019-04-17 10:43 PM
Hello,
After the TL is initialized, the application is waiting for the ready event (VS_HCI_C2_Ready) received on the system channel before starting the BLE Stack. The system event is received with APPE_SysUserEvtRx. If your code didnt land on that, maybe you need to re-flash the wireless binary. But before that, did you run the scheduler in the while loop?
Regards.
2019-04-18 01:22 AM
Thank you . It can work.
2021-02-08 03:55 AM
Hi,
I have also similar issue on my custom board. It used to do BLE advertisement, able to connect to the ST BLE sensor application and other applications also. It used to send data also. And all of a sudden it stopped BLE advertisement. Its GPIO, timer and other peripherals works fine. But only the BLE part seems to not working anymore. I have got another same kind of working board, using which I am able to check option bytes to compare with the faulty board. I use STM32WB55CE and the option bytes are matching with the working board(SFSA as 0x57, SNBRSA as 0xf, SBRSA as 0xa, SBRV as 0x15c00 and PCCDBA is set to 0). I tried doing FUS upgradation again. But it did not update again. May be because the firmware still exists there. Programming of the BLE full stack binary was succesful. But still the device does not advertise any more. Could you please guide me for where can I check for any mistake or any missing point?
Thank you...
2021-02-20 04:45 AM
Hi,
I have also same problem on my custom board. It was working properly, but suddenly now it's BLE functions not working. The M4 core is OK, but APP_BLE_Init function return error and it fall in Error_Handler. When I checked the source of error, I reached to SHCI_C2_BLE_Init that return 0xFE. This error code is unknown.
I checked my board in STM32CubeProg. This picture shows option bytes of that:
Any one can help me?
Thank you.
2021-03-01 12:02 AM
Hello,
Your secure option bytes seem OK and show you are running the wireless stack on CPU2.
You should first check if APPE_SysUserEvtRx() is called or not. This is the first step to understand if CPU2 was able to start or not.
When APPE_SysUserEvtRx() is received, CPU2 was able to start up. The fault is likely later on during BLE initialisation.
When APPE_SysUserEvtRx() is not received, CPU2 has been hang somewhere. This is most likley due to wrong buffer configuration in the shared table or less likely wrong system setting which could be out of spec ( CPU2 clock speed shall be max 32Mhz, correct flash latency setting according system frequency, etc...)
In all cases, you could check the value read from the base address of SRAM2A ( @0x20030000). If either hardfault or wrong buffer configuration is detected, the CPU2 reports there a magic keyword documented on AN5289 and is locked until the next reset. If you can read back what you wrote before starting CPU2, then I would expect CPU2 to run fine
Regards.
2021-03-01 12:06 AM
Hello,
The secure option byte ( SBRV) shows you are running on the FUS and (SFSA) shows that only the FUS code is made secure.
That means you do not have anymore a wireless stack and you are running the FUS.
You shall install a wireless firmware binary to get BLE application working.
I would expect you tried some CPU2 fimrware update at some points in time or you made some try with Cube Programmer and you unfortunately deleted the wireless firmware.
Regards.
2021-03-01 04:12 AM
Thanks for your response,
By reprogramming BLE stack, now my custom board is working fine.
Thanks a lot
2021-03-01 04:12 AM
Thanks for your response,
By reprogramming BLE stack, now my custom board is working fine.
Thanks a lot