ST fw update for band selection at runtime #23
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The original version of the fw set the frequency region with a define. If the user had to change it, the firmware needed to be re-compiled and flashed with the new defined frequency.
In order to overcome these steps, the fw has been updated to store the region as a variable. The initial band is set to the European one. Whenever a different band is selected by the user, the Lora state machine is re-initialized and the desired band of frequency is enabled.
Command "+BAND" has been added to the predefined set of AT commands to perform the band update. MKRWAN library has been updated to support this command (arduino-libraries/MKRWAN#78).
The user can change the frequency region by using the funciton bool begin(lora_band band).
A simple test (https://github.com/giulcioffi/tests_MKRWAN) allows to continuously change the desired region, read back the frequency of the RX channel and compare it with the expected one.