Some LoRaWAN modem like SX1272 can receive downlink packets with RSSI level less than -127. So "int8_t" is not enough for store all possible RSSI values. For example, SX1272 has sensitivity at -137 dBm.
Problem was manifested in the file "SX1272_LoRaRadio.cpp" at SX1272_LoRaRadio::handle_dio0_irq() method.
When value of _rf_settings.lora_packet_handler.rssi_value calculated incorrect RSSI will be stored. Example case:
Value readen from register REG_LR_PKTSNRVALUE _rf_settings.lora_packet_handler.snr_value equals -47.
Value readen from register REG_LR_PKTRSSIVALUE equals 17.
RSSI_OFFSET equals "-139", snr equals "-11".
For case MODEM_LORA value calculated by formula:
_rf_settings.lora_packet_handler.rssi_value = RSSI_OFFSET + rssi + (rssi >> 4) + snr;
and result value will be "124" because of int8_t overflow so it's not correct value (too high).
Correct value must be:
-139 + 17 + (1) + (-11) = -132.
Another motivation: at all other places int16_t type used to store RSSI value.
Fix the following issues in TF-M to avoid emergence in the future:
1. Enable initial stack not located in SRAM bank0
On reset, only SRAM bank0 is enabled. And SRAM bank1/2 will be enabled in immediately following SystemInit().
When initial stack is located in SRAM bank1/2, we will meet trouble because SystemInit() itself needs to use initial stack.
To conquer the dilemma, we add preceding code in front of original Systeminit(), which is responsible for enabling SRAM bank1/2 and guarantees no using initial stack.
2. Fix sector maps of internal/external (SDH) Flash are incompatible, caused by TF-M's MCUboot port.
This is done by adapting external (SDH) Flash sector size to internal Flash's.
3. Enlarge firmware upgrade scratch size. There are two advantages:
(1) Get around MCUboot limit which requires scratch size not smaller than image trailer size
(2) Improve wear leveling for the scratch area
Full verbosity is adding a console line for each lock/unlock API call
- stats can be enabled with json config
- default configuration is full verbosity and add a console line for each lock/unlock command
- for STM32 targets, verbosity is reduced by default
When decimal_prec is 0 and the value is negative and needs rounding subtract 1, instead of adding 1
When decimal_prec > 0 round before printing the integer part, instead of after
1. In TF-M, enlarge ITS max asset number/size
NOTE: RSA key size is larger
2. In TF-M, enlarge mbedtls dedicated heap
NOTE: RSA algorithm needs more memory.
NOTE: psa_aead_decrypt() (for mbedtls_ssl_read()) needs memory proportional to data size.
As a default implementation is already provided by
NetworkStack, stub implementations in the child classes
are not required. Furthermore, they return unsupported for
all cases instead of redirecting to the non-control API,
which is plainly wrong.
We have clash with needs work and needs CI labels. If CI fails, we need to be in CI stage. Check for needs: CI label and apply work only if it was CI.
Otherwise we would be in the loop.