|
| 1 | +# LR11xx SDK |
| 2 | + |
| 3 | +The LR11xx SDK contains several simple examples for LR11xx transceivers. |
| 4 | + |
| 5 | +## Examples |
| 6 | + |
| 7 | +### Radio |
| 8 | + |
| 9 | +| Name | Description | Documentation | |
| 10 | +| -------------------- | --------------------------------------------------------------- | --------------------------------------------- | |
| 11 | +| CAD | Perform a Channel Activity Detection (CAD) - LoRa only | [README](apps/cad/README.md) | |
| 12 | +| PER | Perform a Packet Error Rate (PER) test - both Tx and Rx roles | [README](apps/per/README.md) | |
| 13 | +| Ping pong | Launch an exchange between two devices | [README](apps/ping-pong/README.md) | |
| 14 | +| Sprectral scan | Get inst-RSSI values in RX mode to form a heat map | [README](apps/spectral_scan/README.md) | |
| 15 | +| Spectrum display | Get inst-RSSI values in RX mode to form a dyamic spectrum curve | [README](apps/spectrum_display/README.md) | |
| 16 | +| Tx continuous wave | Configure the chip to transmit a single tone | [README](apps/tx_cw/README.md) | |
| 17 | +| Tx infinite preamble | Configure the chip to transmit an infinite preamble | [README](apps/tx_infinite_preamble/README.md) | |
| 18 | + |
| 19 | +A demonstration of the LR-FHSS capability of the chip can be found [here](https://github.com/Lora-net/SWDM001). |
| 20 | + |
| 21 | +### Geolocation |
| 22 | + |
| 23 | +| Name | Description | Documentation | |
| 24 | +| ---------------------- | ----------------------------- | ----------------------------- | |
| 25 | +| GNSS - Assisted scan | Perform GNSS assisted scans | [README](apps/gnss/README.md) | |
| 26 | +| GNSS - Autonomous scan | Perform GNSS autonomous scans | [README](apps/gnss/README.md) | |
| 27 | +| Wi-Fi passive scan | Perform Wi-Fi passive scans | [README](apps/wifi/README.md) | |
| 28 | + |
| 29 | +## Configuration |
| 30 | + |
| 31 | +Each example has its own set of parameters - see `apps/<example>/main_<example>.h`. |
| 32 | + |
| 33 | +There is also [a common configuration file](apps/common/apps_configuration.h) where parameters can be set, among which: |
| 34 | + |
| 35 | +* Packet type |
| 36 | +* RF frequency |
| 37 | +* Output power |
| 38 | +* Packet and modulation parameters for different modulations |
| 39 | + |
| 40 | +## Requirements |
| 41 | + |
| 42 | +### Supported boards |
| 43 | + |
| 44 | +This SDK is developed on the ST Microeletronic [NUCLEO-L476RG development board](https://www.st.com/en/evaluation-tools/nucleo-l476rg.html) |
| 45 | + |
| 46 | +### Supported shields |
| 47 | + |
| 48 | +The list of compatible Semtech LR1110 shields is: |
| 49 | + |
| 50 | +| Shield | PCB | Frequency matching | |
| 51 | +| ------------ | ----------------------------------------------------- | ------------------ | |
| 52 | +| LR1110MB1DIS | PCB_E655V01A - GNSS with LNA for Passive GNSS Antenna | 868/915MHz | |
| 53 | +| LR1110MB1DJS | PCB_E656V01A - GNSS without LNA | 868/915MHz | |
| 54 | +| LR1110MB1GIS | PCB_E655V01A - GNSS with LNA for Passive GNSS Antenna | 490MHz | |
| 55 | +| LR1110MB1GJS | PCB_E656V01A - GNSS without LNA | 490MHz | |
| 56 | + |
| 57 | +The list of compatible Semtech LR1120 shields is: |
| 58 | + |
| 59 | +| Shield | PCB | Frequency matching | |
| 60 | +| ------------ | ----------------------------------------------------- | ------------------ | |
| 61 | +| LR1120MB1DIS | PCB_E655V01A - GNSS with LNA for Passive GNSS Antenna | 868/915MHz | |
| 62 | +| LR1120MB1DJS | PCB_E656V01A - GNSS without LNA | 868/915MHz | |
| 63 | +| LR1120MB1GIS | PCB_E655V01A - GNSS with LNA for Passive GNSS Antenna | 490MHz | |
| 64 | +| LR1120MB1GJS | PCB_E656V01A - GNSS without LNA | 490MHz | |
| 65 | + |
| 66 | +### Firmware |
| 67 | + |
| 68 | +This SDK requires the transceiver to run the following version |
| 69 | + |
| 70 | +* LR1110: firmware version ([0x0307](https://github.com/Lora-net/radio_firmware_images/tree/master/lr1110/transceiver)) |
| 71 | +* LR1120: firmware version ([0x0101](https://github.com/Lora-net/radio_firmware_images/tree/master/lr1120/transceiver)) |
| 72 | + |
| 73 | +To update the transceiver with the desired firmware version, please use [the updater tool application](https://github.com/Lora-net/lr1110_updater_tool/). |
| 74 | + |
| 75 | +### Toolchain |
| 76 | + |
| 77 | +Each example can be compiled with the following toolchains: |
| 78 | + |
| 79 | +* [Keil MDK ARM](https://www2.keil.com/mdk5) - Keil project file available in `apps/<example>/MDK-ARM/` |
| 80 | +* [GNU Arm Embedded toolchain](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm) - makefile available in `apps/<example>/makefile/` |
| 81 | + |
| 82 | +## Getting started |
| 83 | + |
| 84 | +### Configure |
| 85 | + |
| 86 | +Before starting to build an example, check the parameters in both the common and the example-specific configuration files. |
| 87 | + |
| 88 | +### Build |
| 89 | + |
| 90 | +#### Keil MDK ARM |
| 91 | + |
| 92 | +Each example is delivered with a Keil project file - see `apps/<example>/MDK-ARM/lr11xx-sdk_<example>.uvprojx`. |
| 93 | + |
| 94 | +To build a project: |
| 95 | + |
| 96 | +1. Launch Keil IDE |
| 97 | +2. Open the project file |
| 98 | +3. Select the target |
| 99 | +4. Compile |
| 100 | + |
| 101 | +Each project has different targets ([Keil manual](https://www.keil.com/support/man/docs/uv4/uv4_ca_projtargfilegr.htm)), each one allowing to choose the shield the example is compiled for. |
| 102 | + |
| 103 | +The name of the targets is taken from the column `shield` of the table available [here](#supported-shields). |
| 104 | + |
| 105 | +#### GNU Arm embedded toolchain |
| 106 | + |
| 107 | +Examples are built from their respective subfolder in the `apps` directory. For instance, the makefile for the `per` example is available in `apps/per/makefile/Makefile`. |
| 108 | + |
| 109 | +Build settings, compile time and configuration options are specified in the project's Makefile. |
| 110 | + |
| 111 | +The output files of the build process are stored in the `build` folder with firmware binary file having the same name as the project with a .bin extension. |
| 112 | + |
| 113 | +Here are the parameters available at compile time: |
| 114 | + |
| 115 | +| Parameter | Description | Default value | |
| 116 | +| ------------ | ---------------------------------------- | ------------- | |
| 117 | +| TARGET_BOARD | Board for which the example is compiled | NUCLEO_L476RG | |
| 118 | +| RADIO_SHIELD | Shield for which the example is compiled | LR1120MB1DIS | |
| 119 | + |
| 120 | +For instance, to build the project `per` with LR1110MB1GJS shield: |
| 121 | + |
| 122 | +To build a project, simply run make |
| 123 | + |
| 124 | +```shell |
| 125 | +$ cd $SDK_FOLDER/apps/per/makefile |
| 126 | +$ make RADIO_SHIELD=LR1110MB1GJS |
| 127 | +``` |
| 128 | + |
| 129 | +### Load |
| 130 | + |
| 131 | +After a project is built, it can be loaded onto a device. |
| 132 | + |
| 133 | +There are multiple ways to do it, among which: |
| 134 | + |
| 135 | +* Drag and drop the binary file to the USB drive listed by our OS - usually shows up as `NODE_L476RG`. |
| 136 | +* Load it through the Keil IDE |
| 137 | + |
| 138 | +### View debug output |
| 139 | + |
| 140 | +On the NUCLEO-L476RG development board, the firmware prints debug information to the UART that is connected via the ST-LINK to the host computer. The configuration is 921600/8-N-1: |
| 141 | + |
| 142 | +* On Linux, this device usually shows up as `/dev/ttyACM0` |
| 143 | +* On Windows, the port can be obtained from the device manager |
| 144 | + |
| 145 | +For instance, using stty on Linux with a device available in `/dev/ttyACM0`: |
| 146 | + |
| 147 | +```shell |
| 148 | +$ stty -echo raw speed 921600 < /dev/ttyACM0 && cat /dev/ttyACM0 |
| 149 | +``` |
0 commit comments