The Sparrow family consists of one or more Sensors which communicate JSON-formatted Notes using a LoRa radio to a Gateway with which they have been manually paired. A Sparrow Gateway will forward messages received from its paired Sensors to the cloud via Notecard. Conversely, it will also forward messages received from the cloud via Notecard to an associated Sensor.
...
Notecarrier | Sparrow Gateway | Qwiic Color |
---|---|---|
<VIO | <VIO | RED |
GND | GND | BLACK |
SCL | SCL | YELLOW |
SDA | SDA | BLUE |
NOTE: If you have a Qwiic connector breakout, you can connect to the Qwiic connector of the Sparrow, and the same pins on the Notecarrier as above.
...
[LINUX ONLY] Utilizing the Containerized Development Environment
Once you have installed the “Remote - Containers” VSCode extension, then you can click the small green box in the lower-left corner of the VSCode window.
NOTE: Be sure to attach your Sparrow device to your machine before you launch the development environment, so
/dev/bus/usb
can be captured by the container.
...
Once you have installed the “Remote - Containers” VSCode extension, then you can click the small green box in the lower-left corner of the VSCode window.
...
...
...
Then select “Reopen in Container” from the dropdown drop-down menu.
...
...
Troubleshooting
Update Build Defines
NOTE: If you
...
have
...
Windows VM Troubleshooting
Repo Error during container Build (on Virtual Host, e.g. Parallels running Windows on OSX)
FIX: This is a clock synchronization problem. Restart the virutal Windows Host.
=> [internal] load build definition from Dockerfile 0.1s => => transferring dockerfile: 32B 0.0s => [internal] load .dockerignore 0.1s => => transferring context: 2B 0.0s => [internal] load metadata for docker.io/library/debian:stable-slim 10.6s => CACHED [1/6] FROM docker.io/library/debian:stable-slim@sha256:608a500 0.0s => ERROR [2/6] RUN ["dash", "-c", " apt-get update --quiet && apt-ge 3.9s
[2/6] RUN ["dash", "-c", " apt-get update --quiet && apt-get install --as sume-yes --no-install-recommends --quiet bzip2 ca-certificates cm ake curl git make && apt-get clean && apt-get purge && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* "]: #4 2.751 Get:1 http://security.debian.org/debian-security stable-security InRele ase [44.1 kB] #4 3.110 Get:2 http://deb.debian.org/debian stable InRelease [116 kB] #4 3.580 Get:3 http://deb.debian.org/debian stable-updates InRelease [39.4 kB] #4 3.854 Reading package lists...E: Release file for http://security.debian.org/ debian-security/dists/stable-security/InRelease is not valid yet (invalid for an other 30d 15h 8min 20s). Updates for this repository will not be applied. #4 3.875 E: Release file for http://deb.debian.org/debian/dists/stable/InRelease is not valid yet (invalid for another 13d 9h 11min 47s). Updates for this repos itory will not be applied. #4 3.875 E: Release file for http://deb.debian.org/debian/dists/stable-updates/I nRelease is not valid yet (invalid for another 31d 12h 46min 3s). Updates for th is repository will not be applied. #4 3.884
executor failed running [dash -c apt-get update --quiet && apt-get install --assume-yes --no-install-recommends --quiet bzip2 ca-certificates cmake curl git make && apt-get clean && apt-get purge && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* ]: exit code: 100
Invalid Mount Config for type bind
The fix here is to be sure there is a Linux subsystem installed in addition to the ones installed by Docker Desktop. Running
wsl —install -d ubuntu
Will fix this. (And be sure to enable docker integration for that WSL distro in docker desktop.)
[27174 ms] Start: Run: docker run --sig-proxy=false -a STDOUT -a STDERR --mount type=bind,source=z:\b\sparrow-sensor-framework,target=/workspaces/sparrow-sensor-framework,consistency=cached --mount type=volume,src=vscode,dst=/vscode -l vsch.local.folder=z:\b\sparrow-sensor-framework -l vsch.quality=stable -l vsch.remote.devPort=0 --entrypoint /bin/sh vsc-sparrow-sensor-framework-506417bf5f9c63e2c9ace81a4b8205bf -c echo Container started ; trap "exit 0" 15; while sleep 1 & wait $!; do :; done docker: Error response from daemon: invalid mount config for type "bind": bind s ource path does not exist: /run/desktop/mnt/host/uC/Mac/Home/b/sparrow-sensor-fr amework. See 'docker run --help'. [28619 ms] Start: Run: docker ps -q -a --filter label=vsch.local.folder=z:\b\sparrow-sensor-framework --filter label=vsch.quality=stable [29547 ms] Command failed: docker run --sig-proxy=false -a STDOUT -a STDERR --mount type=bind,source=z:\b\sparrow-sensor-framework,target=/workspaces/sparrow-sensor-framework,consistency=cached --mount type=volume,src=vscode,dst=/vscode -l vsch.local.folder=z:\b\sparrow-sensor-framework -l vsch.quality=stable -l vsch.remote.devPort=0 --entrypoint /bin/sh vsc-sparrow-sensor-framework-506417bf5f9c63e2c9ace81a4b8205bf -c echo Container started ; trap "exit 0" 15; while sleep 1 & wait $!; do :; done
If the drive containing the project is a network drive it may not be mounted by default in the linux distro enabled for docker. https://www.public-health.uiowa.edu/it/support/kb48568/
Oh, but even that is not enough - seems network drives (parallels mapping Mac drive to a local Windows drive) doesn’t show up when opening the project in the container. Whether opened from the Explorer, or from a mounted drive in WSL (e.g. /mnt/z )
What does work:
opening VSCode on a local Windows drive, and then re-opening as a container
opening wsl, and cd’ing to the same folder in the windows mount (e.g. /mnt/c/blues/sparrow-sensor-framework) and running
code .
copying the project to a linux folder under ~/ and runinng
code .
from there. (e.g. to \\wsl$\ubuntu\home\mat\blues\sparrow-sensor-framework)
What does not work
trying to run from a network drive (at least, the Parallels network drive did not work.)
Update Build Defines
NOTE: If you have the v1.1 hardware then you may skip this section...
...
Identify the value associated with your “current board” from the following table:
Board Value Nucleo 0 Sparrow v1.0 1 Sparrow v1.1 2
...
Update the CMakeLists.txt
file in the root folder of the workspace.
Add an entry for “CURRENT_BOARD” (e.g. CURRENT_BOARD=1
) in the following block...
Code Block |
---|
# Set global compile settings
add_compile_definitions(
STM32WL55xx
CORE_CM4
) |
[OPTIONAL][Intellisense Only] Update the .vscode/c-cpp-properties.json
file.
Add an entry for “CURRENT_BOARD” (e.g. "CURRENT_BOARD=1",
) in the following block...
...
the v1.1 hardware then you may skip this section...
Current Board | Value |
---|---|
Nucleo | 0 |
Sparrow v1.0 | 1 |
Sparrow v1.1 | 2 |
Identify the value associated with your “current board” from the proceeding table.
Update the
CMakeLists.txt
file in the root folder of the workspace.Add an entry for “CURRENT_BOARD” (e.g.
CURRENT_BOARD=1
) in the following block...Code Block # Set global compile settings add_compile_definitions( STM32WL55xx CORE_CM4 )
[OPTIONAL][Intellisense Only] Update the
.vscode/c-cpp-properties.json
file.Add an entry for “CURRENT_BOARD” (e.g.
"CURRENT_BOARD=1",
) in the following block...Code Block "defines": [ "CMAKE_TOOLCHAIN_FILE=${workspaceFolder}/arm-gcc-toolchain.cmake", "CORE_CM4", "STM32WL55xx" ],
Build Sparrow Firmware
...
Manual CMake and Make build instructions, look here.
The Sparrow project works just as any standard CMake project, to build it you will:
Create a build folder
Enter the build folder
Call
cmake
from inside the build folderCall
make
from inside the build folder
Example (from the root folder):
mkdir build && cd build/ && cmake .. && make -j
Install Sparrow Firmware
Navigate to, Terminal > Run Task...
Select, Sparrow: Flash Firmware Using STM32_Programmer_CLI
Manual
STM32_Programmer_CLI
flash instructions, click here.STM32_Programmer_CLI --connect port=SWD reset=HWrst --write sparrow.elf --verify --go
Debug Sparrow Firmware
Hotkey: Ctrl+Shift+D
Select Run and Debug menu from the leftmost toolbar.
Press the green “Play” button next to Cortex Debug.
...
My debugger is not working!
The first run of the v1.1 Sparrow Reference Sensor Boards had the 2x7-pin debug connectors installed backwards. As they are installed, the keyed Cortex debug connector can not be plugged-in correctly. The connectors were reworked, so be sure to plugin the debugger with keyed tab slotted into the “rough” side.
&& cmake .. && make -j
Install Sparrow Firmware
Navigate to, Terminal > Run Task...
Select, Sparrow: Flash Firmware Using STM32_Programmer_CLI
Manual
STM32_Programmer_CLI
flash instructions, click here.STM32_Programmer_CLI --connect port=SWD reset=HWrst --write sparrow.elf --verify --go
Debug Sparrow Firmware
Hotkey: Ctrl+Shift+D
Select Run and Debug menu from the leftmost toolbar.
Press the green “Play” button next to Cortex Debug.
...
Collecting Logs
Use an STLINK-V3MINI to connect to your device, you can use a terminal emulator to view the debugging output on the serial port that appears on your computer.
...
Connect your computer to STLINK-V3MINI using a USB A-to-Micro, then connect the STLINK-V3MINI to your device using the Cortex debug connector.
v1.0 HARDWARE ONLY
FTDI
Pin Mapping
Sparrow FTDI Cable Color GND GND BLACK LPRX TXD ORANGE LPTX RXD YELLOW
...
.