User Guide - BHDynamics/rfm_radio_dongle GitHub Wiki
Having already seen an overview of the device, this section aims to provide you with a more detailed guide of how to get started with DynaLoRa-USB.
You’ll get the assembled DynaLoRa-USB, a 2.54 mm 7-pin header in case you want to solder it to have an external interface, and a monopole antenna of the selected frequency.
- Plug the board to a computer USB port. The Power LED should turn on.
- A disk drive unit called CIRCUITPY should appear. In addition, the RGB LED should begin to emit a slow pulsating green light.
- Open the CIRCUITPY drive and you will see a file called code.py. Just open it with your favourite code editor and start coding!
- If you want to use libraries, just put them in the lib folder inside the CIRCUITPY drive. Although you can technically use libraries in raw .py format, in order to save memory we recommend you use them cross compiled to the .mpy format using mpy-cross.
We recommend that you use Mu, a simple but functional IDE for CircuitPython with official support for DynaLoRa-USB. It integrates the serial console to check logs and access the REPL, and it also automatically recognizes the boards.
- Open the latest version of the Arduino IDE. You will have to download our board definitions. Don’t worry, it’s really easy!
- Open the File -> Preferences window. In the Additional Boards Manager URLs field, add the URL to the JSON containing our boards:
https://bhdynamics.github.io/board_index/package_bhdynamics_index.json
- Install the board definition. Go to Tools -> Board -> Boards Manager… and search for “BH Dynamics”. Select and install the package called BH Dynamics SAMD Boards.
- Plug the board to the computer USB port. If you’ve not used the Arduino Framework before or if the CircuitPython firmware is active, a CIRCUITPY disk drive will appear. You can safely ignore it, since you’re not going to use CircuitPython for now.
- In case the board has booted to CircuitPython, press the Reset button twice to enter the UF2 bootloader. The RGB LED should turn green and the blue LED should turn on.
- Then, you just have to select the board on Tools -> Board menu. Be sure you also select the right COM port (if you don’t have any other serial device plugged in your computer, it will be the only one on the list).
- Done! You can start sketching right away.
Please note that if you upload an Arduino sketch, the CircuitPython image will be erased and you will have to flash it again!
| Number | Pin name | ATSAMD Pin | Comments |
| Digital | |||
| 0 | D0 | PA00 | |
| 1 | D1 | PA01 | |
| 2 | D2 | PA02 | Also A0 |
| 3 | D3 | PA30 | SWCLK |
| 4 | D4 | PA31 | SWDIO |
| 5 | D5/BUTTON | PA15 | USR Button |
| 6 | D6/RADIO_INT | PA09 | Radio module interrupt |
| 7 | D7/RADIO_RESET | PA10 | Radio module reset |
| 8 | D8/RADIO_CS | PA11 | Radio module chip select |
| 9 | D9/SD_CS | PA03 | SD Card chip select |
| Miscellaneous | |||
| 10 | LED_PIN/D13 | PA27 | Blue LED |
| 11 | NEOPIXEL_PIN | PA19 | NeoPixel RGB LED |
| SPI | On-Board SPI | Radio & SD Card | |
| 12 | SDI/MISO | PA18 | SERCOM3.2 |
| 13 | SDO/MOSI | PA16 | SERCOM3.0 |
| 14 | SCK | PA17 | SERCOM3.1 |
| Analog | |||
| 15 | A0 | PA02 | DAC |
| SPI1 | Flash SPI | ||
| 19 | FLASH_SDI/SDI1 | PA05 | SERCOM0.1 |
| 20 | FLASH_SDO/SDO1 | PA04 | SERCOM0.0 |
| 21 | FLASH_SCK/SCK1 | PA07 | SERCOM0.3 |
| 22 | FLASH_CS/SS1 | PA06 | Digital IO, active low |
| Wire | Pin Header I2C | ||
| 0 | SDA | PA00 | SERCOM1.0 |
| 1 | SCL | PA01 | SERCOM1.1 |
| Serial1 | Pin Header UART | ||
| 0 | TX | PA00 | SERCOM1.0 |
| 1 | RX | PA01 | SERCOM1.1 |
| SPI2 | Pin Header SPI | ||
| 3 | SDI2/MISO2 | PA30 | SERCOM1.2 |
| 0 | SDO2/MOSI2 | PA00 | SERCOM1.0 |
| 1 | SCK2 | PA01 | SERCOM1.1 |
The SD card reader is connected to the main, on-board SPI bus (the same one as the radio module!).
The above definitions are the default ones included in the provided CircuitPython build and Arduino core , but you can use the pins as any supported peripheral. In order to know what peripherals are supported on each pin, refer to the datasheet of the microcontrollers, I/O Multiplexing and Considerations section. You can also refer to the excellent Adafruit documentation in that regard!
DynaLoRa USB has a simple power supply scheme. It takes power from the USB port (5V) and converts it to 3.3V thanks to a DC/DC buck converter. Those 3.3V are used to power everything on the board, and are also present on the pin header to supply external power to any peripheral you want to connect. It is designed to supply up to 1A of continuous current, so you have plenty of power!
The board has two buttons: one labeled as USR, which is connected to D5 pin (PA15) with a pull-up resistor that can be used for anything you like (for example, triggering a radio message); and the other labeled as RST, which pulls the nRESET line of the ATSAMD21 low, resetting the board.
If you press the reset button twice, the board will enter bootloader mode. A disk drive unit called DYLORABOOT will appear on your PC, where you can just drag and drop the .uf2 firmware files without the hassle of needing an external programmer.
It’s time to get your first program running on DynaLoRa-USB! We’re assuming you will be using Windows, but the procedure on other operating systems is basically the same.
The first time you plug the board to the computer, Windows will automatically install the USB drivers. When the process is finished (it should take no more than 30 seconds), you will have a new USB device in the form of a 4 MB disk drive called CIRCUITPY, and a Virtual COM Port available:

If you open the CIRCUITPY drive, you will find, among others, a file called code.py. That’s the main source code file, where you have to put your CircuitPython code. You can just open the file with your favourite text editor (NotePad++, VS Code, Sublime, etc.) and begin writing code; when you save the file the board will automatically begin execution. If you open a serial console on the right port (such as Termite), you will see CircuitPython’s output there.
Anyway, a more convenient way of writing CircuitPython code exists. The open-source, user-friendly Mu Editor has native CircuitPython support and has an integrated serial terminal, which makes it the ideal choice for developing with these boards.
Important note: the build you can download from Mu's website is an old build that does not include the latest features, among them DynaLoRa-USB support. For now, until a new build is released, you'll have to use the latest nightly build. Scroll to the bottom of this page, select your operating system and download the latest executable.
If not, you just need to click the Mode button and select CircuitPython. It will automatically recognize any connected CircuitPython device.
Then, you just need to click Load to open the code.py file present in the CIRCUITPY drive and start coding. Open the Serial console with the corresponding button to access the output of the board and the command line (REPL).
For more details about CircuitPython and what to do next, please refer to the Adafruit's documentation page. There you can find things like how to install libraries, common REPL commands, etc.
Please note that, before unplugging the USB cable, it is necessary to eject the CIRCUITPY drive. Operating with an SPI flash like the one the OBC and the EPS carry is not the same as working with a real USB drive. Because of that, it’s more susceptible to corruption and I/O errors, rendering your device unusable in the worst case.
While tinkering with the board, sometimes the worst happens, the flash memory gets corrupted and you lose access to the CIRCUITPY drive. You may still boot into the UF2 bootloader and load firmware, but CircuitPython won’t work because the flash is stuck.
Luckily, you can easily fix this doing a flash mass erase. You can do it in a few different ways:
- If you have access to the REPL (i.e, CircuitPython is working but just without access to the CIRCUITPY drive) through Mu or any serial terminal, just type:
>>> import storage
>>> storage.erase_filesystem()
The flash will be erased and the CIRCUITPY drive should appear again after a reset.
- If you don’t have access to the REPL, you can write a small Arduino program that performs the erase. To ease things, we provide a .uf2 file that you can just drag to the bootloader’s DYLORABOOT drive (press the reset button twice and it should appear). Here is the GitHub link to the source .ino file and the precompiled .uf2 binary:
SOON
- If that does not work because the flash is truly corrupted or damaged, you can replace it with a soldering iron. You can get those flash chips (GD25Q32CNIGR) from Mouser or LCSC for cheap.
Lastly, if things go REALLY wrong, the bootloader itself gets corrupted and the board doesn’t boot anymore, you can flash it again using a J-Link programmer. We recommend using the official J-Link Mini EDU, which is small, reliable and cheap for non-commercial use (under 20€). You can find the latest version on our Github, both in its own repository (source code) and in the Arduino Core port, which provides compiled binaries.
If you don’t want to use CircuitPython, you can program the board using the Arduino Framework.
The first time you plug the board to the computer, Windows will automatically install the USB drivers. When the process is finished (it should take no more than 30 seconds), you will have a new USB device in the form of a 4 MB disk drive called CIRCUITPY, and a Virtual COM Port available. Since we won’t be using CircuitPython, you can safely ignore it, but we recommend entering the bootloader so the Arduino IDE gets the correct COM port. To do that, just press the reset button twice and you will see a new disk drive named OBCBOOT. The RGB LED will turn on green.
Before starting writing code, you will need to install the BH Dynamics Arduino core and board definitions to your IDE. It’s as easy as following these steps (note that I'm using the newest Arduino Pro IDE, hence the dark colors and aesthetic differences, but the procedure is the same):
- Start the Arduino IDE. Select File -> Preferences:
- In the “Additional Boards Manager URLs” text box, paste the URL where we store the files:
https://bhdynamics.github.io/board_index/package_bhdynamics_index.json
Important note: we have updated the board link. The previous one was https://bhdynamics.github.io/board_index/package_dynossat_index.json that NO LONGER WORKS. Please use the new one!
- Go to Tools->Board->Boards Manager. Search for "BH Dynamics" and install the packages:
- It’s done! You just have to select the board on Tools->Boards and the right COM port and start writing Arduino code. DynaLoRa-USB should be fully compatible with any SAMD21-based Arduino library (practically any Adafruit and Arduino Zero libraries).
Please note that uploading Arduino programs will delete CircuitPython from the board (but it won’t erase the SPI flash contents, so your Python code should be safe for later). To recover it, just enter the bootloader (remember, press reset twice) and drag and drop the CircuitPython .uf2 image file to the DYLORABOOT drive.



