common
: Shared common source used by multiple projectsflight-recorder
: Python tool to interface to the flight sensor firmware over BLElibs
: external dependencies used by the buildnRF5_SDK
: Nordic SDK 17.3projects
: All firmware applicationsflash-dev
: project used by flash debugging/developmentflight-sensor
: main firmware application for stream and recording flight data
This project is intended to be used as data collection and analysis platform for measuring the orientation of disc golf discs. A sensor node with a processor and an inertial measurment unit (IMU) is attached to a disc. During flight, the node records IMU data to local memory. After the disc is recovered, the flight data is retreived via Bluetooth using the flight-recorder
python tool. After data is collected, the flight-analysis
python tool is used to process, analyze, plot, and animate flight data.
The sensor node contains the following components:
Nordic nrf52840
: Bluetooth SoC build around ARM Cortex-M4 processorInvensense ICM20948
: 9-axis inertial measurement unit with on-chip Cortex-M0 digital motion processor for sensor fusionMacronix MX25R6435F
: 64 Mbit Serial NOR Flash with QSPI
To communicate with the sensor node via Bluetooth, the flight-recorder
tool uses the blatann
python library, a high level interface for performing bluetooth operations via Nordic's pc-ble-driver-py
and connectivity firmware running on a PCA10056
evaluation board. The flight-recorder
tool uses the imu-service
command set consisting of the following operations:
stream
: enables IMU and starts transmitting raw IMU data via BLE notificationsrecord
: enables IMU and starts saving raw IMU data to flashplayback
: retrieves IMU data from flash and transmits via BLE notificationscalibrate
: starts calibrations of IMU
- GNU ARM Embedded Toolchain here (Version: v10.3.1 10 2021)
- Segger J-Link Drivers here (Version V7.58b)
- Nordic Command Line Tools here
- Visual Studio Code here
GNU ARM Embedded Toolchain
- Verify that correct installer version is downloaded
- Run the installer using default options
- Ensure that the install path is here:
C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.10
Segger J-Link Drivers
- Run the installer using default options
Nordic Command Line Tools
- Run the installer using default options
Visual Studio Code
- Run the installer using default options
Make
- A copy of the make execute is located in
/libs
. Copy this to your local directory and add to path. - Run
make --version
to verify that it has been correctly added to your path.
Building
- Navigate to a project. Example:
projects/flight-sensor
- Run
make setup
to install necessary python packages - Run
make
to build the firmware - For Softdevice projects, run
make flash_softdevice
to program the softdevice - Run
make flash
to program the firmware application
Config Editor
- Run
make sdk_config
to run the config editor
C/C++ Properties
- Open the root directory in VS Code
- Select the Extensions view icon on the Activity bar
- Search for and install
C/C++
- Open the command palette (
CTRL
+SHIFT
+P
) and run>C/C++: Edit Configurations (JSON)
to generate ac_cpp_properties.json
file. - Update
.vscode/c_cpp_properties.json
to have the following settings:"compilerPath": "C:/Program Files (x86)/GNU Arm Embedded Toolchain/10 2021.10/bin/arm-none-eabi-gcc.exe"
"cStandard": "c11"
"cppStandard": "c++17"
"intelliSenseMode": "gcc-arm"
- Navigate to a project and run
make vscode
. This will update thec_cpp_properties.json
file with the correct include paths and defines for the project
Logging
- Under
C:\Program Files (x86)\SEGGER\JLink
, runJLinkRTTViewer.exe
- The log viewer can be buggy, use
F3
to disconnect andF2
to connect after programming the device
Debugger
- Select the Extensions view icon on the Activity bar
- Search for and install
C/C++
- Under the
.vscode
directory create a file,launch.json
- Update the file with the following text:
{
"version": "0.2.0",
"configurations": [
{
"name": "debug",
"type": "cortex-debug",
"request": "launch",
"cwd": "${workspaceRoot}",
"executable": "${workspaceRoot}/projects/flight-sensor/_build/nrf52840_xxaa.out",
"serverpath": "C:/Program Files (x86)/SEGGER/JLink/JlinkGDBServerCL.exe",
"armToolchainPath": "C:/Program Files (x86)/GNU Arm Embedded Toolchain/10 2021.10/bin",
"servertype": "jlink",
"device": "nrf52840_xxaa",
"interface": "swd",
"serialNumber": "", //If you have more than one J-Link probe, add the serial number here.
"jlinkscript":"",
"svdFile": ""
}
]
}
- In the
Run
tab, selectStart Debugging
or pressF5