2019-11-11 07:12 AM
Hello,
I'm testing a custom board implementing a BLE Server. The binary for CPU2 is the stm32wb5x_BLE_Stack_fw 1.3.0. All the radio system seem work well, tested with STM32CubeMonitor-RF and a nucleo dongle (Packet Error Test below 1%). The advertising phase work well too. But when I try to connect a BLE Client, it connects and disconnects immediately after. The reason code of HCI Event is 0x3E (Connection failed to be established).
After some investigations, tring to load my firmware on the STM32WB Nucleo Board, I found the problem. I use LSI2 as source clock of RF WAKEUP, this seem not work also on the nucleo board, but switching to LSE (on Cube MX clock configuration), all works well. On my board I can't use the LSE, in reference manual I saw that LSI2 was suitable to source the RF WAKEUP.
I already trim the LSI2 with factory value stored at 0x1FFF7548, but the frequency is 30kHz not 32Khz. Could be a problem?
It doesn't work also with HSE/1024 as source of RF WAKEUP CLOCK
Why I can't use the LSI2 or HSE/1024? Is there any workaround?
Thank you in advance.
Solved! Go to Solution.
2019-11-13 03:01 PM
Greetings.
I believe the errata mentions that LSI2 cannot be used to wake-up the CPU:
2.2.1 LSI2 not usable as RF low-power clock
Description
Due to its calibration mechanism and peaks of jitter, the LSI2 clock exceeds 500 ppm maximum frequency deviation specified in the Bluetooth® Low Energy standard for low-speed clock.
Workaround
To clock the Bluetooth® peripheral, use the LSE oscillator, instead of the LSI2.
If the LSE is not useable, I'm not sure there is a work-around. I was advised by ST to install a 32KHz crystal in my design because of this errata, which I did, even though I would have preferred to leave out the component.
Cheers
2019-11-13 03:01 PM
Greetings.
I believe the errata mentions that LSI2 cannot be used to wake-up the CPU:
2.2.1 LSI2 not usable as RF low-power clock
Description
Due to its calibration mechanism and peaks of jitter, the LSI2 clock exceeds 500 ppm maximum frequency deviation specified in the Bluetooth® Low Energy standard for low-speed clock.
Workaround
To clock the Bluetooth® peripheral, use the LSE oscillator, instead of the LSI2.
If the LSE is not useable, I'm not sure there is a work-around. I was advised by ST to install a 32KHz crystal in my design because of this errata, which I did, even though I would have preferred to leave out the component.
Cheers
2019-11-14 12:10 AM
Thank you. In my prototype I will try to source the LSE with LPTIM2 clocked by MSI, both configured in order to have the 32.768 Khz clock. This is just to test the functions are left over. In the new release I will install the 32Khz too.
Daniele
2019-12-17 03:54 AM
Greetings,
Do I understand correctly that I cannot use the Bluetooth functionality without an LSE? There is no LSE in the board I made. The published note states that only the LSI2 cannot be used. However, LSI1 and HSE/32 do not work in my tests. Is it possible to generate the RF clock with the MSI and LPTIM2, as DBell.1140 suggested?
FP
2019-12-17 06:18 AM
Yes, you understand correctly. The radio works well but the packet framing of BLE stack need an high precision 32,768 Khz reference clock. I tested my prototype with workaround I suggested and it works, but I will use it only for debug pourpose. I physically connected with an external wire the LPTIM2_OUT with RCC_OSC32_IN. In nex board revison I wil put an external crystal source for LSE.