cancel
Showing results for 
Search instead for 
Did you mean: 

Start Range 2 mode in STM32WB55

KKIM.6
Senior

I'm trying to use Range 2 mode in my custom STM32WB55 board to reduce power consumption in my board.

I found the protocol that switchs Range 1 to Range 2 mode in RM0434 document.

The basic protocol is like below and I found that three register should be changed to use Range 2 mode, which is RCC clock control, Flash ACR, and PWR control register (+PWR status register).

image.png

So, my question is how to change these registers and is there any example for change these or CubeMX to help change these value?

In addtion, I tried to change RCC clock using CubeMX but HCLK2 cannot be 16 MHz. Why?

1 ACCEPTED SOLUTION

Accepted Solutions
IIRHO.1
ST Employee

Hello again 

After verification, is impossible to use RF communication in Range 2. Sytem clock in Range 2 should be under 16MHz but in RF transmittion CPU2 CLOCK must be 32MHz. What means system clock should be 32MHz.

Best Regards.

Issam

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

10 REPLIES 10
IIRHO.1
ST Employee

Hello @KKIM.6 and welcome to ST Community.

go from Range 1 to Range 2 you have to:

  • Reduce the system frequency to a value lower or equal to 16 MHz. as you can see bellow.

IIRHO1_0-1690876984075.png

  • Write 010 to the Bits 2:0 of the Flash_ACR register to have two wait states ( refer to the Table 4 of the RM0434).
  • Write 10 to the Bits 2:0 of the PWR_CR1 register to select RANGE 2.

you can do this importing some modification on your code's source files. 

For your second question, the answer is in screenshot below.

Issam

 

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

KKIM6_0-1690900425846.png

Still, my cubeMX shows error in HCLK2 in 16 MHz.

 

Where can I write Flash_ACR register and PWR_CR1 register? 

Should I use cubeProgrammer after importing program to the microcontroller?

Hello again

I suggest you to:

  • Update your CubeMX to the last version.
  • Is always better to change the registers value in your code before importing the program to the microcontroller.

Best Regards.

Issam

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

I found that the use of RCC caused the problem in HCLK2. 

However, I cannot turn on RF if I do not use RCC. 

What should I do?

or is it not mandatory to use HCLK2 in 16 MHz?

 

 

Hello again,

You have to keep your system frequency to 16MHz or lower. But if you go lower you need to check the Table 4 in the RM0434 to make sure about the wait states.

Can you add your RCC Mode and Configuration

Best Regards

Issam

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

image.png

I upgraded CubeMX in the 6.9.1 version but still the problem doesn't be solved.

Here is my RCC  configuration.

 

image.png

I created a new project and I'm changing each setup to find the reason.

The error disappear when RF is deactivated......OMG..

IIRHO.1
ST Employee

Hello again 

After verification, is impossible to use RF communication in Range 2. Sytem clock in Range 2 should be under 16MHz but in RF transmittion CPU2 CLOCK must be 32MHz. What means system clock should be 32MHz.

Best Regards.

Issam

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

That means....we cannot use BLE in range 2 mode...that's too bad.