Skip to main content
DLan.1
Associate
Jul 11, 2022 8:55 AM UTC
Solved

STM32WB55 Formula for converting RAW RSSI value in dBm

Dear Sir,

I'm new to STM32WB55 and using STM32CubeMonitor-RF.

We see the value of RAW RSSI from the Value parameter of Command Complete of ACI_HAL_READ_RAW_RSSI in STM32CubeMonitor-RF and it results in the RSSI dBm.

Such as:

(RAW RSSI) --> (RSSI dBm)

0x000006 --> -107.00 dBm

0x000007 --> -107.00 dBm

0x00000A --> -106 dBm

0x00000B --> -105.00 dBm

0x000012 --> -103.00 dBm

0x000014 --> -102.00 dBm

0x000017 --> -100.00 dBm

0x00001C --> -98.00 dBm

0x00001D --> -98.00 dBm

0x000021 --> -97.00 dBm

0x000024 --> -97.00 dBm

0x000029 --> -96.00 dBm

...

0x0001A9 --> -75.00 dBm

May we ask you about the formula for converting RAW RSSI value in dBm? Thank you.

Sincerely yours,

David 

This topic has been closed for replies.
Sean Park
Sean ParkBest answer
ST Employee
Jul 12, 2022 3:59 AM UTC
 int32_t rsi_dbm;
 uint32_t rssi_int16;
 uint32_t reg_agc;
 
 // extract the data rssi_int16 + agc
 rssi_int16 = ((rssi_level[0]) >> 16) & 0xFFFFU ;
 reg_agc = (rssi_level[1]) & 0xffU;
 
 // check if rssi is too low
 if((rssi_int16 == 0U) || (reg_agc > 0xbU))
 {
 rsi_dbm = 127 ;
 }
 else
 {
 rsi_dbm = (int32_t)reg_agc * 6 - 127 ;
 while(rssi_int16 > 30U)
 {
 rsi_dbm += 6 ;
 rssi_int16 = (rssi_int16 >> 1) ;
 }
 
 rsi_dbm += (int32_t)(uint32_t)((417U*rssi_int16 + 18080U)>>10) ;
 }
 
 // result is in rsi_dbm ;

Ex) RSSI Level : 0x0701BF

rssi_int16 = 0x01BF (lower 2 bytes of RSSI Level value)

reg_agc = 0x07 (High 1 byte of RSSI Level value)

result -> -33.00dBm

You can refer to the above formula.

9 replies

Andrew Neil
Super User
Jul 11, 2022 10:15 AM UTC

is there nothing in the datasheet about this?

or the documentation of ACI_HAL_READ_RAW_RSSI  ?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
DLan.1
DLan.1Author
Associate
Jul 12, 2022 12:22 AM UTC

We noticed the description in an5270 adhere:

This command of ACI_HAL_READ_RAW_RSSI returns the raw value of the RSSI

and an5378 for Figure 10. ACI_HAL_READ_RAW_RSSI in STM32CubeMonitor-RF packet rate exchange configuration.

We can see the ACI_HAL_READ_RAW_RSSI Command Complete returns the raw value of the RSSI and STM32CubeMonitor-RF performs an RSSI dBm measurement.

Is there datasheet about the Formula for converting the RAW RSSI value in dBm? Thank you.

Sincerely yours,

David

Sean Park
Sean ParkBest answer
ST Employee
Jul 12, 2022 3:59 AM UTC
 int32_t rsi_dbm;
 uint32_t rssi_int16;
 uint32_t reg_agc;
 
 // extract the data rssi_int16 + agc
 rssi_int16 = ((rssi_level[0]) >> 16) & 0xFFFFU ;
 reg_agc = (rssi_level[1]) & 0xffU;
 
 // check if rssi is too low
 if((rssi_int16 == 0U) || (reg_agc > 0xbU))
 {
 rsi_dbm = 127 ;
 }
 else
 {
 rsi_dbm = (int32_t)reg_agc * 6 - 127 ;
 while(rssi_int16 > 30U)
 {
 rsi_dbm += 6 ;
 rssi_int16 = (rssi_int16 >> 1) ;
 }
 
 rsi_dbm += (int32_t)(uint32_t)((417U*rssi_int16 + 18080U)>>10) ;
 }
 
 // result is in rsi_dbm ;

Ex) RSSI Level : 0x0701BF

rssi_int16 = 0x01BF (lower 2 bytes of RSSI Level value)

reg_agc = 0x07 (High 1 byte of RSSI Level value)

result -> -33.00dBm

You can refer to the above formula.

Andrew Neil
Super User
Jul 12, 2022 8:46 AM UTC

@Sean Park​ - even ST Employees don't know how to properly post source code to their own forum? :\

0693W000008xsqBQAQ.png

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Sean Park
ST Employee
Jul 12, 2022 8:52 AM UTC

I'm sorry. thanks for pointing out

DLan.1
DLan.1Author
Associate
Jul 13, 2022 12:04 AM UTC

Sincerely thank you for your kind solution.

Sincerely yours,

David

Andrew Neil
Super User
Jul 13, 2022 8:04 AM UTC

@DLan.1​ - Please mark the solution:

0693W000008y9fZQAQ.png

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
DLan.1
DLan.1Author
Associate
Jul 14, 2022 2:48 AM UTC

Dear Sir,

Thank you for your kind help.