cancel
Showing results for 
Search instead for 
Did you mean: 

Having trouble with Bluetooth

XPonc.1
Associate III

Hey everyone,

I'm having trouble on my STM32WB55RG custom board.

Using version 1.7 of the Cube FW package, my board worked properly. But one day, my device was not discoverable in Bluetooth (I suspected that I deleted it whith my custom bootloader, but I verified the code and don't see how that's possible :\ ).

I looked into the copro binaries and everything seems fine...

I tried programming the examples that I had, but it does not work: my phone does not find the STM32WB.

I might have some old WB samples, as I had a problem with flash that was only related to the first samples (see here: https://community.st.com/s/question/0D50X0000AvfFNKSQ2/why-error-flashsr-is-set-and-block-erasing-flash-memory )

I have 3 other cards from the same batch where the memory section where the FUS is supposed to be is readable. Those 3 cards have a very suspicious behavior that I suspect being related to it... They are currently being transported to me

With all of that I am a bit concerned that my board is simply not usable

If you have any idea, I'd be glad to hear it...

Thanks for your help!

Xavier

14 REPLIES 14
Remi QUINTIN
ST Employee

​See in shci.h file

SHCI_C2_Reinit

 * @brief This is required to allow the CPU1 to fake a set C2BOOT when it has already been set.

 *       In order to fake a C2BOOT, the CPU1 shall :

 *       - Send SHCI_C2_Reinit()

 *       - call SEV instruction

 *       WARNING:

 *       This function is intended to be used by the SBSFU

 *

 * @param None

 * @retval Status

 */

 SHCI_CmdStatus_t SHCI_C2_Reinit( void );

There are also other interesting functions to interact with CPU2. But they should not be called from M4 application SW.

I am not use to creating a bootloader with CubeMX. So I dont know if it includes a launch of the CPU2.

Remi QUINTIN
ST Employee

On a usual configuration (bootloader at 0x00000000), the application running on the M4 core calls the appe_Tl_init() function to intitialize the system chanel to comunicate with the M0+ core and then it starts CPU2.

Hey Remi,

I just went to try your solution,but I quickly met a big problem:

I cannot implement

SHCI_C2_Reinit();

 __SEV();

in my bootloader, since I don't have the file shci.c in my project. I don't have the appe_Tl_init function or its contents either.

So I tried to implement it at the start of my main app, with no success.

How can I know if CPU2 started in bootloader, is there any register that can indicates that to me?

Do you have any other idea about what could be my problem?

Thanks,

Xavier

Remi QUINTIN
ST Employee

shci.c file is under STM32Cube_FW_WB_V1.9.0\Middlewares\ST\STM32_WPAN\interface\patterns\ble_thread\shci.

Now if you concern is to include additional files that can draw other additional files, you can implement the same sequence somewhere at the beginning of the application. It should work. It is just a matter of waiting for the ready event ahead of the M0+ core completing its initialization phase.

A related question: why do you want to build your own bootloader?

Yes, what I meant in my previous message was that I don't wan to include a lot of files in my project, I'd like it to be the most simple possible.

I tried to implement it at the very start of my application at 0x0800A000, but I had no success. How can I wait for the ready event of the M0+? How long should it take?

I use my custom bootloader because I use SD card for update: I plug my SD card with my new software on it, and if my bootloader detects a newer version on my SD card, it updates the application. If no newer version is detected, it jumps into tha app.