STM32WL55 Power issue
I am working on STM32WL55 dual core in which the current consumption is as not as expected as according to the datasheet. It is hardcoded for high power only. and the current consumption is coming for +17dBm and +14dBm as expected which is 58mA and 45mA approax but when switching to the +20dBm and +22dBm it is getting capped at 68mA only. It is not going above 68mA at any way. I have hardcoded it to 22dBm but it is still getting capped to 68mA only. I want to do changes in the code in such a way that the current consumption changes. what are the possible reasons of it and what are the functions where the code modification can help in changing the current consumption. Is there that ST has capped it to +18dBm or +17dBM and will never work above it?
void SUBGRF_SetTxParams( uint8_t paSelect, int8_t power, RadioRampTimes_t rampTime )
{
uint8_t buf[2];
int32_t max_power;
if (paSelect == RFO_LP)
{
max_power = RBI_GetRFOMaxPowerConfig(RBI_RFO_LP_MAXPOWER);
if (power > max_power)
{
power = max_power;
}
if (max_power == 14)
{
SUBGRF_SetPaConfig(0x04, 0x00, 0x01, 0x01);
power = 0x0E - (max_power - power);
}
else if (max_power == 10)
{
SUBGRF_SetPaConfig(0x01, 0x00, 0x01, 0x01);
power = 0x0D - (max_power - power);
}
else /*default 15dBm*/
{
SUBGRF_SetPaConfig(0x07, 0x00, 0x01, 0x01);
power = 0x0E - (max_power - power);
}
if (power < -17)
{
power = -17;
}
SUBGRF_WriteRegister(REG_OCP, 0x18); /* current max is 80 mA for the whole device*/
}
else /* rfo_hp*/
{
/* WORKAROUND - Better Resistance of the RFO High Power Tx to Antenna Mismatch, see STM32WL Erratasheet*/
SUBGRF_WriteRegister(REG_TX_CLAMP, SUBGRF_ReadRegister(REG_TX_CLAMP) | (0x0F << 1));
/* WORKAROUND END*/
max_power = RBI_GetRFOMaxPowerConfig(RBI_RFO_HP_MAXPOWER);
if (power > max_power)
{
power = max_power;
}
if (max_power == 20)
{
SUBGRF_SetPaConfig(0x03, 0x05, 0x00, 0x01);
power = 0x16 - (max_power - power);
}
else if (max_power == 17)
{
SUBGRF_SetPaConfig(0x02, 0x03, 0x00, 0x01);
power = 0x16 - (max_power - power);
}
else if (max_power == 14)
{
SUBGRF_SetPaConfig(0x02, 0x02, 0x00, 0x01);
power = 0x0E - (max_power - power);
}
else /*22dBm*/
{
SUBGRF_SetPaConfig(0x04, 0x07, 0x00, 0x01);
power = 0x16 - (max_power - power);
}
if (power < -9)
{
power = -9;
}
SUBGRF_WriteRegister(REG_OCP, 0x38); /*current max 160mA for the whole device*/
}
buf[0] = power;
buf[1] = (uint8_t)rampTime;
SUBGRF_WriteCommand(RADIO_SET_TXPARAMS, buf, 2);
}
static void RadioInit( RadioEvents_t *events )
{
RadioEvents = events;
SubgRf.RxContinuous = false;
SubgRf.TxTimeout = 0;
SubgRf.RxTimeout = 0;
/*See STM32WL Errata: RadioSetRxDutyCycle*/
SubgRf.RxDcPreambleDetectTimeout = 0;
#if( RADIO_LR_FHSS_IS_ON == 1 )
SubgRf.lr_fhss.is_lr_fhss_on = false;
#endif /* RADIO_LR_FHSS_IS_ON == 1 */
SUBGRF_Init( RadioOnDioIrq );
/*SubgRf.publicNetwork set to false*/
SubgRf.PublicNetwork.Current = false;
SubgRf.PublicNetwork.Previous = false;
RADIO_IRQ_PROCESS_INIT();
SUBGRF_SetRegulatorMode( );
SUBGRF_SetBufferBaseAddress( 0x00, 0x00 );
SUBGRF_SetTxParams( RFO_HP, 0, RADIO_RAMP_200_US );
SUBGRF_SetDioIrqParams( IRQ_RADIO_ALL, IRQ_RADIO_ALL, IRQ_RADIO_NONE, IRQ_RADIO_NONE );
RadioSleep();
// Initialize driver timeout timers
TimerInit( &TxTimeoutTimer, RadioOnTxTimeoutIrq );
TimerInit( &RxTimeoutTimer, RadioOnRxTimeoutIrq );
TimerStop( &TxTimeoutTimer );
TimerStop( &RxTimeoutTimer );
}What are the possibilities in the code for the above situation

