Skip to content

DISCO_L072CZ_LRWAN1: enable LORA by default #14049

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions connectivity/drivers/lora/COMPONENT_SX126X/mbed_lib.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"name": "SX126X-lora-driver",
"config": {
"radio": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand this correctly this provides the override of "lora.radio"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I don't find any clean way to override some config value defined in another lib....

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a longstanding issue 😞 .

"value": "SX126X",
"macro_name" : "MBED_CONF_LORA_RADIO"
},
"spi-frequency": {
"help": "SPI frequency, Default: 16 MHz",
"value": 16000000
Expand All @@ -24,6 +28,39 @@
"standby-mode": {
"help": "Default: STDBY_RC = 0, STDBY_XOSC = 1",
"value": 0
},
"spi-mosi": {
"value": "NC"
},
"spi-miso": {
"value": "NC"
},
"spi-sclk": {
"value": "NC"
},
"spi-cs": {
"value": "NC"
},
"reset": {
"value": "NC"
},
"dio1": {
"value": "NC"
},
"busy": {
"value": "NC"
},
"freq-select": {
"value": "NC"
},
"device-select": {
"value": "NC"
},
"crystal-select": {
"value": "NC"
},
"ant-switch": {
"value": "NC"
}
}
}
37 changes: 19 additions & 18 deletions connectivity/drivers/lora/COMPONENT_SX1272/SX1272_LoRaRadio.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,24 +65,25 @@ class SX1272_LoRaRadio: public LoRaRadio {
* The pins that are marked NC are optional. It is assumed that these
* pins are not connected until/unless configured otherwise.
*/
SX1272_LoRaRadio(PinName mosi,
PinName miso,
PinName sclk,
PinName nss,
PinName reset,
PinName dio0,
PinName dio1,
PinName dio2,
PinName dio3,
PinName dio4,
PinName dio5,
PinName rf_switch_ctl1 = NC,
PinName rf_switch_ctl2 = NC,
PinName txctl = NC,
PinName rxctl = NC,
PinName ant_switch = NC,
PinName pwr_amp_ctl = NC,
PinName tcxo = NC);
SX1272_LoRaRadio(PinName mosi = MBED_CONF_SX1272_LORA_DRIVER_SPI_MOSI,
PinName miso = MBED_CONF_SX1272_LORA_DRIVER_SPI_MISO,
PinName sclk = MBED_CONF_SX1272_LORA_DRIVER_SPI_SCLK,
PinName nss = MBED_CONF_SX1272_LORA_DRIVER_SPI_CS,
PinName reset = MBED_CONF_SX1272_LORA_DRIVER_RESET,
PinName dio0 = MBED_CONF_SX1272_LORA_DRIVER_DIO0,
PinName dio1 = MBED_CONF_SX1272_LORA_DRIVER_DIO1,
PinName dio2 = MBED_CONF_SX1272_LORA_DRIVER_DIO2,
PinName dio3 = MBED_CONF_SX1272_LORA_DRIVER_DIO3,
PinName dio4 = MBED_CONF_SX1272_LORA_DRIVER_DIO4,
PinName dio5 = MBED_CONF_SX1272_LORA_DRIVER_DIO5,
PinName rf_switch_ctl1 = MBED_CONF_SX1272_LORA_DRIVER_RF_SWITCH_CTL1,
PinName rf_switch_ctl2 = MBED_CONF_SX1272_LORA_DRIVER_RF_SWITCH_CTL2,
PinName txctl = MBED_CONF_SX1272_LORA_DRIVER_TXCTL,
PinName rxctl = MBED_CONF_SX1272_LORA_DRIVER_RXCTL,
PinName ant_switch = MBED_CONF_SX1272_LORA_DRIVER_ANT_SWITCH,
PinName pwr_amp_ctl = MBED_CONF_SX1272_LORA_DRIVER_PWR_AMP_CTL,
PinName tcxo = MBED_CONF_SX1272_LORA_DRIVER_TCXO
);

/**
* Destructor
Expand Down
58 changes: 58 additions & 0 deletions connectivity/drivers/lora/COMPONENT_SX1272/mbed_lib.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"name": "sx1272-lora-driver",
"config": {
"radio": {
"value": "SX1272",
"macro_name" : "MBED_CONF_LORA_RADIO"
},
"spi-frequency": {
"help": "SPI frequency, Default: 8 MHz",
"value": 8000000
Expand All @@ -12,6 +16,60 @@
"radio-variant": {
"help": "Use to set the radio variant if the antenna switch input is not connected.",
"value": "SX1272UNDEFINED"
},
"spi-mosi": {
"value": "NC"
},
"spi-miso": {
"value": "NC"
},
"spi-sclk": {
"value": "NC"
},
"spi-cs": {
"value": "NC"
},
"reset": {
"value": "NC"
},
"dio0": {
"value": "NC"
},
"dio1": {
"value": "NC"
},
"dio2": {
"value": "NC"
},
"dio3": {
"value": "NC"
},
"dio4": {
"value": "NC"
},
"dio5": {
"value": "NC"
},
"rf-switch-ctl1": {
"value": "NC"
},
"rf-switch-ctl2": {
"value": "NC"
},
"txctl": {
"value": "NC"
},
"rxctl": {
"value": "NC"
},
"ant-switch": {
"value": "NC"
},
"pwr-amp-ctl": {
"value": "NC"
},
"tcxo": {
"value": "NC"
}
}
}
37 changes: 19 additions & 18 deletions connectivity/drivers/lora/COMPONENT_SX1276/SX1276_LoRaRadio.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,24 +80,25 @@ class SX1276_LoRaRadio: public LoRaRadio {
* setting SX1276 radio module gets connected to an external power amplifier
* or radio latch controls are connected.
*/
SX1276_LoRaRadio(PinName mosi,
PinName miso,
PinName sclk,
PinName nss,
PinName reset,
PinName dio0,
PinName dio1,
PinName dio2,
PinName dio3,
PinName dio4,
PinName dio5,
PinName rf_switch_ctl1 = NC,
PinName rf_switch_ctl2 = NC,
PinName txctl = NC,
PinName rxctl = NC,
PinName ant_switch = NC,
PinName pwr_amp_ctl = NC,
PinName tcxo = NC);
SX1276_LoRaRadio(PinName mosi = MBED_CONF_SX1276_LORA_DRIVER_SPI_MOSI,
PinName miso = MBED_CONF_SX1276_LORA_DRIVER_SPI_MISO,
PinName sclk = MBED_CONF_SX1276_LORA_DRIVER_SPI_SCLK,
PinName nss = MBED_CONF_SX1276_LORA_DRIVER_SPI_CS,
PinName reset = MBED_CONF_SX1276_LORA_DRIVER_RESET,
PinName dio0 = MBED_CONF_SX1276_LORA_DRIVER_DIO0,
PinName dio1 = MBED_CONF_SX1276_LORA_DRIVER_DIO1,
PinName dio2 = MBED_CONF_SX1276_LORA_DRIVER_DIO2,
PinName dio3 = MBED_CONF_SX1276_LORA_DRIVER_DIO3,
PinName dio4 = MBED_CONF_SX1276_LORA_DRIVER_DIO4,
PinName dio5 = MBED_CONF_SX1276_LORA_DRIVER_DIO5,
PinName rf_switch_ctl1 = MBED_CONF_SX1276_LORA_DRIVER_RF_SWITCH_CTL1,
PinName rf_switch_ctl2 = MBED_CONF_SX1276_LORA_DRIVER_RF_SWITCH_CTL2,
PinName txctl = MBED_CONF_SX1276_LORA_DRIVER_TXCTL,
PinName rxctl = MBED_CONF_SX1276_LORA_DRIVER_RXCTL,
PinName ant_switch = MBED_CONF_SX1276_LORA_DRIVER_ANT_SWITCH,
PinName pwr_amp_ctl = MBED_CONF_SX1276_LORA_DRIVER_PWR_AMP_CTL,
PinName tcxo = MBED_CONF_SX1276_LORA_DRIVER_TCXO
);

/**
* Destructor
Expand Down
75 changes: 75 additions & 0 deletions connectivity/drivers/lora/COMPONENT_SX1276/mbed_lib.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"name": "sx1276-lora-driver",
"config": {
"radio": {
"value": "SX1276",
"macro_name" : "MBED_CONF_LORA_RADIO"
},
"spi-frequency": {
"help": "SPI frequency, Default: 8 MHz",
"value": 8000000
Expand All @@ -12,6 +16,77 @@
"radio-variant": {
"help": "Use to set the radio variant if the antenna switch input is not connected.",
"value": "SX1276UNDEFINED"
},
"spi-mosi": {
"value": "NC"
},
"spi-miso": {
"value": "NC"
},
"spi-sclk": {
"value": "NC"
},
"spi-cs": {
"value": "NC"
},
"reset": {
"value": "NC"
},
"dio0": {
"value": "NC"
},
"dio1": {
"value": "NC"
},
"dio2": {
"value": "NC"
},
"dio3": {
"value": "NC"
},
"dio4": {
"value": "NC"
},
"dio5": {
"value": "NC"
},
"rf-switch-ctl1": {
"value": "NC"
},
"rf-switch-ctl2": {
"value": "NC"
},
"txctl": {
"value": "NC"
},
"rxctl": {
"value": "NC"
},
"ant-switch": {
"value": "NC"
},
"pwr-amp-ctl": {
"value": "NC"
},
"tcxo": {
"value": "NC"
}
},
"target_overrides": {
"DISCO_L072CZ_LRWAN1": {
"spi-mosi": "PA_7",
"spi-miso": "PA_6",
"spi-sclk": "PB_3",
"spi-cs": "PA_15",
"reset": "PC_0",
"dio0": "PB_4",
"dio1": "PB_1",
"dio2": "PB_0",
"dio3": "PC_13",
"txctl": "PC_2",
"rxctl": "PA_1",
"pwr-amp-ctl": "PC_1",
"tcxo": "PA_12"
}
}
}
3 changes: 3 additions & 0 deletions connectivity/lorawan/mbed_lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"help": "LoRa PHY region: EU868, AS923, AU915, CN470, CN779, EU433, IN865, KR920, US915",
"value": "EU868"
},
"radio": {
"help": "value set in radio driver : SX126X, SX1272, SX1276"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happen if a value is provided in mbed_app.json ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will not be used as define will be MBED_CONF_APP_xxx

},
"over-the-air-activation": {
"help": "When set to 1 the application uses the Over-the-Air activation procedure, default: true",
"value": true
Expand Down
3 changes: 2 additions & 1 deletion connectivity/lorawan/tests/TESTS/lorawan/loraradio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ The default mbed_app.json file provides configuration for some already supported

You can use the following command to run tests:

`mbed test -n mbed-os-tests-lorawan-loraradio -m TARGET -t GCC_ARM --app-config mbed-os/TESTS/lorawan/loraradio/template_mbed_app.txt`
`mbed test -n connectivity-lorawan-tests-tests-lorawan-loraradio -m TARGET -t GCC_ARM -v --app-config connectivity/lorawan/tests/TESTS/lorawan/loraradio/template_mbed_app.txt
`

Replace TARGET with the target device.
Loading