|
| 1 | +.. _migration_guide_addon_v110: |
| 2 | + |
| 3 | +Migration guide for moving to Sidewalk Add-on v1.1.0 |
| 4 | +#################################################### |
| 5 | + |
| 6 | + |
| 7 | +Semtech radio |
| 8 | +============= |
| 9 | + |
| 10 | +Starting from this release, the direct board overlay configuration for Semtech SX126x radio only was replaced with standardized DTS bindings for Semtech SX126x and LR1110 radios. |
| 11 | + |
| 12 | +Key changes: |
| 13 | +- **Architecture**: from single-radio to multi-radio architecture |
| 14 | +- **Devicetree Sources**: from basic GPIO and SPI label to advanced radio description |
| 15 | +- **Samples**: from board-specific to shield-based configuration |
| 16 | + |
| 17 | +Architecture |
| 18 | +************ |
| 19 | + |
| 20 | +SubGHz radio configuration in Sidewalk is based on `Zephyr Devicetree Sources <https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/lessons/lesson-2-reading-buttons-and-controlling-leds/topic/devicetree>`_ with a hardware description. It a common approach for all nRF Connect SDK applications. |
| 21 | + |
| 22 | +Starting from this release, Semtech radios devicetree bindings (YAML files) are based on `LoRa Basics Modem integration in Zephyr OS <https://github.com/Lora-net/LBM_Zephyr>`_. It standardize radio description and allows to faster transition form LoRaWAN to Sidewalk projects based on Zephyr OS. |
| 23 | + |
| 24 | +Sidewalk Platform Abstraction Layer for subGHz radio uses Sidewalk specific implementation (different than Lora Basic Modem in Zephyr). Sidewalk drivers doesn't follow Zephyr Device Driver model, instead hardware configuration form devicetree sources is translated to Sidewalk driver configuration structures in app_subGHz_config files. |
| 25 | + |
| 26 | +Semtech radio parameters configured in devicetree: |
| 27 | +- GPIOs |
| 28 | +- SPI |
| 29 | +- TCXO config |
| 30 | +- regulator mode |
| 31 | +- rx boost |
| 32 | +- rfswitch (lr110 only) |
| 33 | + |
| 34 | +Semtech radio parameters configured only in app_subGHz_config file: |
| 35 | +- lna gain |
| 36 | +- state timings |
| 37 | +- regional config |
| 38 | + |
| 39 | +File changes |
| 40 | +************ |
| 41 | + |
| 42 | +The following files was impacted by new radio approach: |
| 43 | +- app_subGHz_config: ``subsys/config/common/src/app_subGHz_config.c ``was deleted and replaced with radio specyfic files: ``app_subGHz_config_lr11xx.c`` and ``app_subGHz_config_sx126x.c``. |
| 44 | +- get_radio_cfg: ``const radio_sx126x_device_config_t* get_radio_cfg(void)`` was replaced with ``const void* get_radio_cfg(void);``. It affects sidewalk platform initialization in ``sidewalk_event_platform_init`` (from ``samples/sid_end_device/src/sidewalk_events.c``) and ``sid_pal_common_init``(from ``subsys/sal/sid_pal/src/sid_common.c``) |
| 45 | +- Devicetree: Added radio hardware description in: ``dts/bindings/lora_lbm`` and ``include/zephyr/dt-bindings/lora_lbm``. |
| 46 | +- Shields: Added Arduino compatible Semtech radio shields in ``sidewalk/boards/shields`` |
| 47 | + |
| 48 | +New radio lr1110 |
| 49 | +**************** |
| 50 | + |
| 51 | +The support for new Semtech radio was added. The major changes included: |
| 52 | + |
| 53 | +- DTS bindings dts/bindings/lora_lbm/semtech,lr1110.yaml |
| 54 | +- Driver subsys/semtech/lr1110 |
| 55 | +- Shield boards/shields/semtech_lr11xxmb1xxs/ |
| 56 | +- Radio config ubsys/config/common/src/app_subGHz_config_lr11xx.c |
| 57 | + |
| 58 | +Samples |
| 59 | +******* |
| 60 | + |
| 61 | +Sidewalk transport protocol configuration (BLE, FSK, LoRa) is chosen automatically based on hardware description. Use Zephyr `shield <https://docs.nordicsemi.com/bundle/ncs-3.0.0/page/zephyr/hardware/porting/shields.html#shield_activation>`_ to describe your hardware (nRF development boards and attached modules). |
| 62 | + |
| 63 | +.. tabs:: |
| 64 | + .. tab:: New Shield-based configuration |
| 65 | + |
| 66 | + BLE only |
| 67 | + |
| 68 | + .. code-block:: console |
| 69 | +
|
| 70 | + west build -b nrf52840dk/nrf52840 |
| 71 | +
|
| 72 | + Semtech sx1262 radio |
| 73 | + |
| 74 | + .. code-block:: console |
| 75 | +
|
| 76 | + west build -b nrf52840dk/nrf52840 --shield semtech_sx1262mb2cas |
| 77 | +
|
| 78 | + Semtech lr1110 radio |
| 79 | + |
| 80 | + .. code-block:: console |
| 81 | +
|
| 82 | + west build -b nrf52840dk/nrf52840 --shield semtech_lr1110mb1kas |
| 83 | +
|
| 84 | + Semtech radio on nRF54L15 DK |
| 85 | + |
| 86 | + .. code-block:: console |
| 87 | +
|
| 88 | + west build -b nrf54l15dk/nrf54l15/cpuapp --shield simple_arduino_adapter --shield semtech_sx1262mb2cas |
| 89 | +
|
| 90 | + .. tab:: Old board-specific configuration |
| 91 | + |
| 92 | + BLE only |
| 93 | + |
| 94 | + .. code-block:: console |
| 95 | +
|
| 96 | + west build -b nrf52840dk/nrf52840 -- -DCONFIG_SIDEWALK_SUBGHZ_SUPPORT=n |
| 97 | +
|
| 98 | + Semtech sx1262 radio |
| 99 | + |
| 100 | + .. code-block:: console |
| 101 | +
|
| 102 | + west build -b nrf52840dk/nrf52840 |
| 103 | +
|
| 104 | + Semtech lr1110 radio |
| 105 | + |
| 106 | + Not supported |
| 107 | + |
| 108 | + Semtech radio on nRF54L15 DK |
| 109 | + |
| 110 | + .. code-block:: console |
| 111 | +
|
| 112 | + west build -b nrf54l15dk/nrf54l15/cpuapp |
| 113 | +
|
| 114 | +Devicetree Sources |
| 115 | +****************** |
| 116 | + |
| 117 | +Example dts code snippet for nRF54l15 and sx126x hardware are shown below. |
| 118 | + |
| 119 | +.. tabs:: |
| 120 | + |
| 121 | + .. tab:: New radio description |
| 122 | + |
| 123 | + .. code-block:: dts |
| 124 | +
|
| 125 | + #include <zephyr/dt-bindings/lora_lbm/sx126x.h> |
| 126 | +
|
| 127 | + / { |
| 128 | + chosen { |
| 129 | + zephyr,lora-transceiver = &lora_semtech_sx126xmb2xxs; |
| 130 | + }; |
| 131 | + aliases { |
| 132 | + lora-transceiver = &lora_semtech_sx126xmb2xxs; |
| 133 | + }; |
| 134 | + }; |
| 135 | +
|
| 136 | + &spi30 { |
| 137 | + status = "okay"; |
| 138 | + pinctrl-0 = <&spi30_default_alt>; |
| 139 | + pinctrl-1 = <&spi30_sleep_alt>; |
| 140 | + pinctrl-names = "default", "sleep"; |
| 141 | + cs-gpios = <&gpio0 0 GPIO_ACTIVE_LOW>; |
| 142 | + lora_semtech_sx126xmb2xxs: lora@0 { |
| 143 | + reg = <0>; |
| 144 | + spi-max-frequency = <DT_FREQ_M(8)>; |
| 145 | + reset-gpios = <&gpio2 8 GPIO_ACTIVE_LOW>; |
| 146 | + busy-gpios = <&gpio2 6 GPIO_ACTIVE_HIGH>; |
| 147 | + dio1-gpios = <&&gpio1 11 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>; |
| 148 | + dio2-as-rf-switch; |
| 149 | + reg-mode = <SX126X_REG_MODE_LDO>; |
| 150 | + tcxo-wakeup-time = <0>; |
| 151 | + tcxo-voltage = <SX126X_TCXO_SUPPLY_1_8V>; |
| 152 | + }; |
| 153 | + }; |
| 154 | +
|
| 155 | + &pinctrl { |
| 156 | + spi30_default_alt: spi30_default_alt { |
| 157 | + group1 { |
| 158 | + psels = <NRF_PSEL(SPIM_SCK, 0, 3)>, |
| 159 | + <NRF_PSEL(SPIM_MISO, 0, 2)>, |
| 160 | + <NRF_PSEL(SPIM_MOSI, 0, 1)>; |
| 161 | + }; |
| 162 | + }; |
| 163 | +
|
| 164 | + spi30_sleep_alt: spi30_sleep_alt { |
| 165 | + group1 { |
| 166 | + psels = <NRF_PSEL(SPIM_SCK, 0, 3)>, |
| 167 | + <NRF_PSEL(SPIM_MISO, 0, 2)>, |
| 168 | + <NRF_PSEL(SPIM_MOSI, 0, 1)>; |
| 169 | + low-power-enable; |
| 170 | + }; |
| 171 | + }; |
| 172 | + }; |
| 173 | +
|
| 174 | + Notes: |
| 175 | + |
| 176 | + - Compatible with ``sidewalk/dts/bindings/lora_lbm`` |
| 177 | + - Semtech radio ``chosen`` as zephyr lora transceiver |
| 178 | + - Semtech radio is a sub-node for spi node |
| 179 | + |
| 180 | + .. tab:: Old GPIO and SPI labels |
| 181 | + .. code-block:: dts |
| 182 | +
|
| 183 | + /{ |
| 184 | + semtech_sx1262_gpios{ |
| 185 | + compatible = "gpio-keys"; |
| 186 | + semtech_sx1262_reset_gpios: reset { |
| 187 | + gpios = <&gpio2 8 (GPIO_ACTIVE_LOW|GPIO_PULL_UP)>; |
| 188 | + label = "semtech_sx1262 Reset"; |
| 189 | + }; |
| 190 | + semtech_sx1262_busy_gpios: busy { |
| 191 | + gpios = <&gpio2 6 (GPIO_ACTIVE_HIGH)>; |
| 192 | + label = "semtech_sx1262 Busy"; |
| 193 | + }; |
| 194 | + semtech_sx1262_antenna_enable_gpios: antena_enable { |
| 195 | + gpios = <&gpio2 10 (GPIO_ACTIVE_HIGH)>; |
| 196 | + label = "semtech_sx1262 Antena Enable"; |
| 197 | + }; |
| 198 | + semtech_sx1262_dio1_gpios: dio1 { |
| 199 | + gpios = <&gpio1 11 (GPIO_ACTIVE_HIGH|GPIO_PULL_DOWN)>; |
| 200 | + label = "semtech_sx1262 DIO1"; |
| 201 | + }; |
| 202 | + }; |
| 203 | + }; |
| 204 | +
|
| 205 | + sid_semtech: &spi30 { |
| 206 | + compatible = "nordic,nrf-spim"; |
| 207 | + status = "okay"; |
| 208 | + cs-gpios = <&gpio0 0 GPIO_ACTIVE_LOW>; |
| 209 | + pinctrl-0 = <&spi30_default_alt>; |
| 210 | + pinctrl-1 = <&spi30_sleep_alt>; |
| 211 | + pinctrl-names = "default", "sleep"; |
| 212 | + clock-frequency = <DT_FREQ_M(8)>; |
| 213 | + }; |
| 214 | +
|
| 215 | + &pinctrl { |
| 216 | + spi30_default_alt: spi30_default_alt { |
| 217 | + group1 { |
| 218 | + psels = <NRF_PSEL(SPIM_SCK, 0, 3)>, |
| 219 | + <NRF_PSEL(SPIM_MISO, 0, 2)>, |
| 220 | + <NRF_PSEL(SPIM_MOSI, 0, 1)>; |
| 221 | + }; |
| 222 | + }; |
| 223 | +
|
| 224 | + spi30_sleep_alt: spi30_sleep_alt { |
| 225 | + group1 { |
| 226 | + psels = <NRF_PSEL(SPIM_SCK, 0, 3)>, |
| 227 | + <NRF_PSEL(SPIM_MISO, 0, 2)>, |
| 228 | + <NRF_PSEL(SPIM_MOSI, 0, 1)>; |
| 229 | + low-power-enable; |
| 230 | + }; |
| 231 | + }; |
| 232 | + }; |
| 233 | +
|
| 234 | + Notes: |
| 235 | + |
| 236 | + - SPI instance alias ``sid_semtech`` |
| 237 | + - Semtech gpios defined separately |
| 238 | + |
| 239 | +SPI driver from nrfx instead of Zephyr |
| 240 | +************************************** |
| 241 | + |
| 242 | +The ``spi_nrfx`` `snippet <https://docs.nordicsemi.com/bundle/ncs-3.0.0/page/zephyr/build/snippets/using.html>`_ in Sidewalk sample added necessary changes in kconfigs and dts to use nrfx spi driver. The nrfx spi driver is recommended on nRF52 design with FSK transport protocol. |
| 243 | +It's important to add snippet to ``sid_end_device`` namespace only. In other case build issues in mcuboot image build fails. |
| 244 | + |
| 245 | +.. code-block:: console |
| 246 | +
|
| 247 | + west build -b nrf52840dk/nrf52840 -p -- -DSHIELD="semtech_sx1262mb2cas" -Dsid_end_device_SNIPPET="spi_nrfx" |
| 248 | +
|
| 249 | +.. TODO: Troubleshooting: |
| 250 | +.. no sidewalk in west (no boards, dts, sources) |
| 251 | +.. no lora-transceiver in zephyr, no spi |
| 252 | +.. etc |
0 commit comments