Skip to content

Overflow in S2LPRadioSetPALeveldBm #13

@IBims1NicerTobi

Description

@IBims1NicerTobi

In the function S2LPRadioSetPALeveldBm from S2LP_Radio.c this

if(lPowerdBm> 14)
{
  paLevelValue = 1;
}
else {
  paLevelValue = (uint8_t)((int32_t)25-2*lPowerdBm);
}

does not guard against overflow and for the values of 13, 14 resulting in paLevelValue = 1 for 12dBm, paLevelValue = 255 for 13dBm and paLevelValue = 253 for 14dBm which does not make sense, especially since the highest bit of PA_POWER[1-8] is marked as reserved.
I could not find any documentation for how those register values correlate to the output power not how the chip needs to be configured in order to achieve output power above 12dBm while the chips datasheet states that a maximum of 16dBm should be achivable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions