|
|
# DPP2 SX1262 LoRa ComBoard Specs
|
|
|
# DPP2 SX1262 LoRa ComBoard
|
|
|
|
|
|
<img src="uploads/870ef7ee5c890830bc4797772bd26627/dpp2_lora.jpg" width="35%" />
|
|
|
|
... | ... | @@ -7,7 +7,7 @@ |
|
|
* Flash memory: 256 KB
|
|
|
* **Radio Chip**: Semtech SX1262 868 MHz LoRa transceiver ([datasheet](https://www.semtech.com/products/wireless-rf/lora-transceivers/sx1262))
|
|
|
* Tx Power: up to +22 dBm
|
|
|
* **BOLT**: TI MSP430FR5969 MCU ([BOLT](https://tec.ee.ethz.ch/research/networked-embedded-systems/bolt.html))
|
|
|
* **BOLT**: TI MSP430FR5969 MCU ([BOLT](BOLT))
|
|
|
* RF shield
|
|
|
* COM processor oscillators:
|
|
|
* HFXT: 12 MHz
|
... | ... | @@ -15,19 +15,71 @@ |
|
|
* Radio oscillator:
|
|
|
* default: 32 MHz XT
|
|
|
* optional 32 MHz TCXO (not installed)
|
|
|
* [Schematics (PCB design)](https://gitlab.ethz.ch/tec/public/dpp/blob/master/hardware/dpp2_sx1262/DPP2_ComBoard_SX1262_LoRa.pdf)
|
|
|
|
|
|
[Schematics (PCB design)](https://gitlab.ethz.ch/tec/public/dpp/blob/master/hardware/dpp2_sx1262/DPP2_ComBoard_SX1262_LoRa.pdf)
|
|
|
*Note: In order to work with the DPP2LoRa COM board, it needs to be stacked onto an application board (e.g. the [DevBoard](Application/DevBoard/DevBoard). Stack the COM board onto the application board and fix it with appropriate hardware (spacer, screw, nut).*
|
|
|
|
|
|
<br />
|
|
|
|
|
|
## Example Code
|
|
|
|
|
|
Basic code examples can be found in our [repository](https://gitlab.ethz.ch/tec/public/dpp/tree/master/software/com/stm32l4_sx1262).
|
|
|
* A basic blink LED code example (bare metal) can be found in our [repository](https://gitlab.ethz.ch/tec/public/dpp/tree/master/software/com/stm32l4_sx1262).
|
|
|
* More code is available in the [Flora](https://gitlab.ethz.ch/tec/public/flora) repository.
|
|
|
|
|
|
<br />
|
|
|
|
|
|
## Compilation & IDE
|
|
|
We use the [STM32CubeIDE](https://www.st.com/en/development-tools/stm32cubeide.html) software from to develop and compile code for the SX126x platform.
|
|
|
|
|
|
Compiled binary is located in the `Debug` directory of the project root after build.
|
|
|
|
|
|
### Convert `.elf` to `.hex`
|
|
|
```
|
|
|
objcopy -O ihex input.elf output.hex
|
|
|
```
|
|
|
|
|
|
<br />
|
|
|
|
|
|
## Programming the MCU (Flashing)
|
|
|
There are 2 options:
|
|
|
|
|
|
### SWD Programming
|
|
|
* Note: A [DPP DevBoard](Application/DevBoard/DevBoard) is required to connect a debugger to the SX126x COM board.
|
|
|
* Note: Only the SWD protocol is supported on the DevBoard. JTAG is *not* supported on the DPP2 DevBoard.
|
|
|
* Make sure that the small 10-pin COM JTAG connector (highlighted in red in the image below) is installed, solder it if necessary.
|
|
|
<img src="uploads/bbba9eb45c7c23e83e56b12e561c9cd3/dpp2_devboard_header.jpg" width="300"><br/>
|
|
|
|
|
|
The jumpers on the DevBoard VCC header can either be as shown above or with an additional jumper at the marker 'B'.
|
|
|
* **Software**: Programming with a debugger hardware is integrated into the STM32CubeIDE development IDE.
|
|
|
* In order to use the Segger J-Link for debugging, the target configuration needs to be adjusted. In STM32CubeIDE, go to project settings > *C/C++ Build* > *Settings*. Select the MCU (STM32L433CC) in the tab *Target Settings* and apply the changes. Then go to *Run/Debug Settings* and click *edit*. In the tab *Debugger*, make sure **SWD** is selected as interface (since JTAG is *not* supported on the DPP2 DevBoard).
|
|
|
* **Hardware**: Programming is supported and tested with Segger J-Link debuggers:
|
|
|
* [Segger J-Link EDU Mini debug emulator](https://www.segger.com/products/debug-probes/j-link/models/j-link-edu-mini/) with a 10-pin ribbon cable
|
|
|
* [Segger J-Link debug probe](https://www.segger.com/products/debug-probes/j-link/) with an [adapter from 20 to 10-pin](https://www.olimex.com/Products/ARM/JTAG/ARM-JTAG-20-10/).
|
|
|
|
|
|
### BSL Programming
|
|
|
* Note: A [DPP DevBoard](Application/DevBoard/DevBoard) is required to connect the micro-USB cable to the COM board.
|
|
|
* **Hardware**
|
|
|
* If you want to be able to program the MCU via USB (UART bootloader), then connect pin 7 of COM_JTAG and pin 7 of the DEBUG header with a jumper wire (as shown below).
|
|
|
<img src="uploads/77c0ee744b82ee611c861f643cab24fa/dpp2_devboard_cable.jpg" width="300"><br/>
|
|
|
In addition, make sure that the solder jumpers J500, J501, J502 and J503 on the backside of the DevBoard are closed (see below).
|
|
|
<img src="uploads/ff2fcf364d09614875049a47e1cbdf75/dpp2_devboard_bottom_side_jumper.jpg" width="300"><br/>
|
|
|
* **Software**
|
|
|
1. Install the following python packages:
|
|
|
`python3 -m pip install pyserial intelhex stm32loader`
|
|
|
2. Get the [STM32 programming script](https://gitlab.ethz.ch/tec/public/dpp/-/blob/master/software/tools/program_stm32.py). The script runs on Linux, but may need some adjustment on a Windows machine.
|
|
|
3. In order to flash a binary to the STM32L4 MCU on the DPP2LoRa COM board use the following command:
|
|
|
`./program_stm32.py <path to .hex or .elf>`
|
|
|
The script should automatically choose the right serial port. If you have more than one board connected, then you need to specify the serial port manually as a second argument.
|
|
|
|
|
|
<br />
|
|
|
|
|
|
## Power profiling
|
|
|
|
|
|
**DevBoard:** Notice that when using this ComBoard together with the [DPP DevBoard](https://gitlab.ethz.ch/tec/research/dpp/hardware/pcb/app_devboard), `BOLT_VCC` (VCC Select Pin 6) and `COM_VCC` (VCC Select Pin 8) are connected on the ComBoard. Therefore, for power measurements of the ComBoard, _both_ jumpers (`C` and `B`) must be disconnected.
|
|
|
**DevBoard:** Notice that when using this ComBoard together with the [DPP DevBoard](Application/DevBoard/DevBoard), `BOLT_VCC` (VCC Select Pin 6) and `COM_VCC` (VCC Select Pin 8) are connected on the ComBoard. Therefore, for power measurements of the ComBoard, _both_ jumpers (`C` and `B`) must be disconnected.
|
|
|
|
|
|
**FlockLab:** The boards that are available as targets on FlockLab (`DPP2LoRa` and `DPP2LoRaHG`) have the resistor `R200` (see [schematic](https://gitlab.ethz.ch/tec/public/dpp/blob/master/hardware/dpp2_sx1262/)) placed with a 220 Ohm part (measured on a single board). Therefore, it is essential that *Pin _PB.3_* (`COM_GPIO2`) is not left floating, as this can lead to significant observable leakage currents up to 50mA. Similarly, *Pin _PH.3_* (`COM_GPIO1`) should not be used and always remain cleared, as FlockLab is actively driving it low because it is connected to `TARGETx_PROG`.
|
|
|
|
|
|
**FlockLab:** The boards that are available as targets on FlockLab (`DPP2LoRa` and `DPP2LoRaHG`) have the resistor `R200` (see [schematic](https://gitlab.ethz.ch/tec/research/dpp/hardware/pcb/com_lora/blob/master/outputs/DPP2_ComBoard_LoRa_rev_1.PDF)) placed with a 220 Ohm part (measured on a single board). Therefore, it is essential that *Pin _PB.3_* (`COM_GPIO2`) is not left floating, as this can lead to significant observable leakage currents up to 50mA. Similarly, *Pin _PH.3_* (`COM_GPIO1`) should not be used and always remain cleared, as FlockLab is actively driving it low because it is connected to `TARGETx_PROG`.
|
|
|
<br />
|
|
|
|
|
|
## Pin mapping (STM32L433)
|
|
|
|
... | ... | @@ -44,6 +96,7 @@ Basic code examples can be found in our [repository](https://gitlab.ethz.ch/tec/ |
|
|
| PB3 | COM_GPIO2 | Pin #8 on debug header (input or output) | FLOCKLAB_LED2 (tracing output) |
|
|
|
| PH3 | COM_GPIO1 | Pin #7 on debug header (input or output) | BSL entry pin |
|
|
|
|
|
|
<br />
|
|
|
|
|
|
## Recommended pin configuration (STM32L433)
|
|
|
|
... | ... | @@ -52,7 +105,7 @@ Basic code examples can be found in our [repository](https://gitlab.ethz.ch/tec/ |
|
|
| PA0 | COM_IND, BOLT input queue indicator | Input |
|
|
|
| PA1 | Unused | Analog |
|
|
|
| PA2 | Unused (test point) | Analog |
|
|
|
| PA3 | COM_TREQ, BOLT time request line | Input with pulldown |
|
|
|
| PA3 | COM_TREQ, BOLT time request line | Input with pulldown |
|
|
|
| PA4 | APP_IND, BOLT output queue indicator | Input |
|
|
|
| PA5 | COM_SCK, BOLT SPI serial clock | Module function (on FlockLab: output low) |
|
|
|
| PA6 | COM_MISO, BOLT SPI master input | Module function (on FlockLab: output low) |
|
... | ... | @@ -87,4 +140,37 @@ Basic code examples can be found in our [repository](https://gitlab.ethz.ch/tec/ |
|
|
| PH0 | HFXT_IN, 12MHz crystal oscillator | OSC_IN |
|
|
|
| PH1 | HFXT_IN, 12MHz crystal oscillator | OSC_OUT |
|
|
|
| PH3 | COM_GPIO1, GPIO pin or BOOT0 | - |
|
|
|
| NRST | COM_RST, MCU reset | - | |
|
|
\ No newline at end of file |
|
|
| NRST | COM_RST, MCU reset | - |
|
|
|
|
|
|
<br />
|
|
|
|
|
|
## Hardware patches for rev1.1
|
|
|
|
|
|
### Hardware patch for Baseboard
|
|
|
|
|
|
In order to program the LoRa ComBoard on the Baseboard, a minor hardware patch is required. Connect the pins 18 and 22 of the board-to-board connector with a resistor (~1k ohm):
|
|
|
<img src="uploads/c96f08028e29087ce713f1b7b9c5eaa5/dpp2lora_baseboard_patch.jpg" width="240"><br/>
|
|
|
|
|
|
### Hardware patch for FlockLab
|
|
|
|
|
|
Before installing a DPP2 LoRa comboard on a FlockLab observer, the following patch needs to be applied:
|
|
|
* make sure the resistor R200 is removed
|
|
|
* connect PA15 with COM_GPIO1 via a 220 ohm resistor. You can do that by using a 0603 sized resistor and placing it such that one pad of R200 is connected with one pad of R201 as shown in the photo below.
|
|
|
<img src="uploads/80f8151c701da79207edb5c61bf549cd/dpp2_lora_flocklab_patch.jpg" width="240"><br/>
|
|
|
|
|
|
<br />
|
|
|
|
|
|
## Serial Output (UART)
|
|
|
* For the use together with a DevBoard: see [DPP SerialOutput](SerialOutput) info.
|
|
|
|
|
|
<br />
|
|
|
|
|
|
## Initial Setup
|
|
|
1. Assemble SX126x COM board and DPP DevBoard
|
|
|
2. Make sure hardware is ready for SWD and BSL programming (see [above](#programming-the-mcu-flashing))
|
|
|
3. Flash blink LED test application (see [above](#programming-the-mcu-flashing))
|
|
|
4. Make sure [BOLT](BOLT) is flashed with default image.
|
|
|
5. Make sure deepsleep image is flashed to APP processor on the DPP [DevBoard](Application/DevBoard/DevBoard)
|
|
|
|
|
|
## Misc
|
|
|
* [SX126x LoRa DevKit HowTo](LoraDevkit) |
|
|
\ No newline at end of file |