Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,5 @@ AllowShortFunctionsOnASingleLine: Inline
AllowShortLambdasOnASingleLine: Inline
ShortNamespaceLines: 1
FixNamespaceComments: true
InsertNewlineAtEOF: true
KeepEmptyLinesAtEOF: true
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:

jobs:
release:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
timeout-minutes: 25
env:
ARM_GCC_DIR: /usr
Expand Down
28 changes: 24 additions & 4 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"isDefault": true
},
"options": {
"cwd": "${workspaceFolder}"
"cwd": "${workspaceFolder:firmware}"
},
"type": "process",
"command": "west",
Expand All @@ -25,7 +25,7 @@
"isDefault": true
},
"options": {
"cwd": "${workspaceFolder}"
"cwd": "${workspaceFolder:firmware}"
},
"type": "process",
"command": "west",
Expand All @@ -42,7 +42,7 @@
"isDefault": true
},
"options": {
"cwd": "${workspaceFolder}"
"cwd": "${workspaceFolder:firmware}"
},
"type": "process",
"command": "west",
Expand All @@ -57,7 +57,7 @@
"isDefault": true
},
"options": {
"cwd": "${workspaceFolder}"
"cwd": "${workspaceFolder:firmware}"
},
"type": "process",
"command": "west",
Expand All @@ -68,6 +68,26 @@
"dependsOn": [
"West update"
]
},
{
"label": "Select SDK by vscode workspace",
"group": {
"kind": "none",
"isDefault": true
},
"options": {
"cwd": "${workspaceFolder:firmware}"
},
"runOptions": {
"runOn": "folderOpen"
},
"type": "process",
"command": "west",
"args": [
"config",
"manifest.file",
"west_${config:firmware.startupSdk}.yml"
]
}
]
}
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ BUILD_DIR=device/build/uhk-80-right; west flash --build-dir $BUILD_DIR

It is recommended to start development in the IDE once a successful build is available, as the build parameters
aren't trivial to pass to the IDE, but it does pick up existing build configurations.
To get started, choose *Open Workspace from File...*, then select the `firmware.code-workspace` file.
To get started, choose *Open Workspace from File...*, then select either the `mcuxsdk.code-workspace` (for UHK60 and modules) or the `nrfsdk.code-workspace` (for UHK80 and dongle) file.
Install the recommended extensions or pick the one for your single device depending on the SDK.

> Note that using *MCUXpresso for VS Code* extension currently overwrites the `mcux_includes.json` file,
Expand All @@ -217,12 +217,10 @@ On a first try, this error might manifest:
> Could not start GDB. Check that the file exists, and it can be manually started.
Error: Error: spawn $env{ARM_GCC_DIR}/bin/arm-none-eabi-gdb ENOENT

There are two problems to solve:
1. The arm-none-eabi package doesn't ship with gdb by default.
This is due to the arm-none-eabi apt package not shipping with gdb by default.
You can follow [this guide](https://interrupt.memfault.com/blog/installing-gdb#binaries-from-arm)
to get a full toolchain installed.
2. The extension doesn't expand the environment variable, so you'll need to modify the `.vscode/mcuxpresso-tools.json` file,
to have a hardcoded `toolchainPath` variable. (Don't push this change into the repository, obviously.)


### Releasing

Expand Down
10 changes: 6 additions & 4 deletions boards/ugl/uhk-60-right/Kconfig.board
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Copyright (c) 2018, Prevas A/S
# SPDX-License-Identifier: Apache-2.0
config BOARD_UHK_60_RIGHT_V1
bool "UHK 60 v1"
depends on SOC_SERIES_KINETIS_K2X
select SOC_PART_NUMBER_MK22FN512VLH12

config BOARD_UHK_60_RIGHT
bool "UHK 60 right"
config BOARD_UHK_60_RIGHT_V2
bool "UHK 60 v2"
depends on SOC_SERIES_KINETIS_K2X
select SOC_PART_NUMBER_MK22FN512VLH12
8 changes: 1 addition & 7 deletions boards/ugl/uhk-80/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,22 @@ endif # BT_DIS && BT_DIS_PNP
if BOARD_UHK_80_LEFT
config USB_DEVICE_PRODUCT
default "UHK 80 left half bootloader" if MCUBOOT
default "UHK 80 Left USB"
config USB_DEVICE_PID
default 0x0006 if !BT
default 0x0007
default 0x0006 if MCUBOOT
endif # BOARD_UHK_80_LEFT

if BOARD_UHK_80_RIGHT
config USB_DEVICE_PRODUCT
default "UHK 80 right half bootloader" if MCUBOOT
default "UHK 80 Right USB"
config USB_DEVICE_PID
default 0x0008 if MCUBOOT
default 0x0009
endif # BOARD_UHK_80_RIGHT

if BOARD_UHK_DONGLE
config USB_DEVICE_PRODUCT
default "UHK dongle bootloader" if MCUBOOT
default "UHK dongle"
config USB_DEVICE_PID
default 0x0004 if MCUBOOT
default 0x0005
endif # BOARD_UHK_DONGLE

if BT
Expand Down
35 changes: 15 additions & 20 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -158,17 +158,23 @@ function dealiasDeviceZephyr() {
}

function dealiasDeviceMcux() {
if [ "$DEBUG" == "1" ]; then
BUILD_TYPE="debug"
else
BUILD_TYPE="release"
fi

case $DEVICE in
uhk-60v1-right|rightv1|right)
DEVICE="uhk-60v1-right"
VARIANT="v1-release"
VARIANT="v1-$BUILD_TYPE"
BUILD_DIR="right/build/$VARIANT"
DEVICE_DIR="right"
USBDEVICEARG="--vid=0x37a8 --pid=1"
;;
uhk-60v2-right|rightv2|right)
DEVICE="uhk-60v2-right"
VARIANT="v2-release"
VARIANT="v2-$BUILD_TYPE"
BUILD_DIR="right/build/$VARIANT"
DEVICE_DIR="right"
USBDEVICEARG="--vid=0x37a8 --pid=3"
Expand Down Expand Up @@ -315,33 +321,22 @@ function performZephyrAction() {
case $ACTION in
build)
# reference version of the build process is to be found in scripts/make-release.mjs
nrfutil toolchain-manager launch --shell --ncs-version $NCS_VERSION << END
unset PYTHONPATH
unset PYTHONHOME
ZEPHYR_TOOLCHAIN_VARIANT=zephyr west build \
--build-dir "$ROOT/device/build/$DEVICE" "$ROOT/device" \
--pristine \
-- \
--preset $DEVICE
exit $?
END
ZEPHYR_TOOLCHAIN_VARIANT=zephyr west build \
--build-dir "$ROOT/device/build/$DEVICE" "$ROOT/device" \
--pristine \
-- \
--preset $DEVICE
exitOnFail $?
createCentralCompileCommands
;;
make)
nrfutil toolchain-manager launch --shell --ncs-version $NCS_VERSION << END
west build --build-dir $ROOT/device/build/$DEVICE device
exit $?
END
west build --build-dir $ROOT/device/build/$DEVICE device
exitOnFail $?
;;
flash)
export BUILD_DIR="$ROOT/device/build/$DEVICE"
export DEVICE="$DEVICE"
nrfutil toolchain-manager launch --shell --ncs-version $NCS_VERSION << END
west flash --softreset --build-dir $BUILD_DIR $DEVICEARG $OTHER_ARGS
exit $?
END
west flash --softreset --build-dir $BUILD_DIR $DEVICEARG $OTHER_ARGS
exitOnFail $?
;;
flashUsb)
Expand Down
24 changes: 24 additions & 0 deletions device/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "UHK80 Right Debug",
"cwd": "${workspaceFolder}",
"executable": "build/uhk-80-right/device/zephyr/zephyr.elf",
"request": "launch",
"type": "cortex-debug",
"runToEntryPoint": "main",
"servertype": "jlink",
"device": "nRF52840_xxAA",
"interface": "swd",
"speed": 4000,
"gdbPath": "/opt/zephyr-sdk-0.17.4/arm-zephyr-eabi/bin/arm-zephyr-eabi-gdb",
"svdPath": "/opt/west2/modules/hal/nordic/nrfx/mdk/nrf52840.svd",
"rtos": "/opt/SEGGER/JLink/GDBServer/RTOSPlugin_Zephyr.so",
"overrideLaunchCommands": [
"monitor halt",
"load"
]
}
]
}
76 changes: 29 additions & 47 deletions device/CMakePresets.json
Original file line number Diff line number Diff line change
@@ -1,93 +1,75 @@
{
"version": 2,
"version": 4,
"cmakeMinimumRequired": {
"major": 3,
"minor": 20
},
"configurePresets": [
{
"name": "uhk-80-right",
"displayName": "Build for UHK 80 right",
"name": "defaults",
"hidden": true,
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/uhk-80-right",
"binaryDir": "${fileDir}/build/${presetName}",
"cacheVariables": {
"CPM_SOURCE_CACHE": "${fileDir}/../../cpm",
"NCS_TOOLCHAIN_VERSION": "NONE",
"BOARD_ROOT": "${fileDir}/../",
"mcuboot_OVERLAY_CONFIG": "${fileDir}/sysbuild/mcuboot.conf"
}
},
{
"name": "uhk-80-right",
"displayName": "Build for UHK 80 right",
"inherits": "defaults",
"cacheVariables": {
"BOARD": "uhk-80-right",
"BOARD_ROOT": "${sourceParentDir}/",
"mcuboot_OVERLAY_CONFIG": "${sourceDir}/sysbuild/mcuboot.conf",
"CONF_FILE": "${sourceDir}/prj_release.conf",
"EXTRA_CONF_FILE": "${sourceDir}/prj.conf.overlays/nrf_shared.conf;${sourceDir}/prj.conf.overlays/c2usb.conf;${sourceDir}/prj.conf.overlays/uhk-80.conf;${sourceDir}/prj.conf.overlays/ble_nus.conf;${sourceDir}/prj.conf.overlays/ble_nus_client.conf;${sourceDir}/prj.conf.overlays/ble_hid.conf;prj.conf.overlays/uhk-80-right.conf"
"CONF_FILE": "${fileDir}/prj_release.conf",
"EXTRA_CONF_FILE": "${fileDir}/prj.conf.overlays/nrf_shared.conf;${fileDir}/prj.conf.overlays/c2usb.conf;${fileDir}/prj.conf.overlays/uhk-80.conf;${fileDir}/prj.conf.overlays/ble_nus.conf;${fileDir}/prj.conf.overlays/ble_nus_client.conf;${fileDir}/prj.conf.overlays/ble_hid.conf;${fileDir}/prj.conf.overlays/uhk-80-right.conf"
}
},
{
"name": "uhk-80-right-debug",
"displayName": "Debug build for UHK 80 right",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/uhk-80-right-debug",
"inherits": "uhk-80-right",
"cacheVariables": {
"NCS_TOOLCHAIN_VERSION": "NONE",
"BOARD": "uhk-80-right",
"BOARD_ROOT": "${sourceParentDir}/",
"mcuboot_OVERLAY_CONFIG": "${sourceDir}/sysbuild/mcuboot.conf",
"CONF_FILE": "${sourceDir}/prj.conf",
"EXTRA_CONF_FILE": "${sourceDir}/prj.conf.overlays/nrf_shared.conf;${sourceDir}/prj.conf.overlays/c2usb.conf;${sourceDir}/prj.conf.overlays/uhk-80.conf;${sourceDir}/prj.conf.overlays/ble_nus.conf;${sourceDir}/prj.conf.overlays/ble_nus_client.conf;${sourceDir}/prj.conf.overlays/ble_hid.conf,prj.conf.overlays/uhk-80-right.conf"
"CONF_FILE": "${fileDir}/prj.conf"
}
},
{
"name": "uhk-80-left",
"displayName": "Build for UHK 80 left",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/uhk-80-left",
"inherits": "defaults",
"cacheVariables": {
"NCS_TOOLCHAIN_VERSION": "NONE",
"BOARD": "uhk-80-left",
"BOARD_ROOT": "${sourceParentDir}/",
"mcuboot_OVERLAY_CONFIG": "${sourceDir}/sysbuild/mcuboot.conf",
"CONF_FILE": "${sourceDir}/prj_release.conf",
"EXTRA_CONF_FILE": "${sourceDir}/prj.conf.overlays/nrf_shared.conf;${sourceDir}/prj.conf.overlays/c2usb.conf;${sourceDir}/prj.conf.overlays/uhk-80.conf;${sourceDir}/prj.conf.overlays/ble_nus.conf"
"CONF_FILE": "${fileDir}/prj_release.conf",
"EXTRA_CONF_FILE": "${fileDir}/prj.conf.overlays/nrf_shared.conf;${fileDir}/prj.conf.overlays/c2usb.conf;${fileDir}/prj.conf.overlays/uhk-80.conf;${fileDir}/prj.conf.overlays/ble_nus.conf"
}
},
{
"name": "uhk-80-left-debug",
"displayName": "Debug build for UHK 80 left",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/uhk-80-left-debug",
"inherits": "uhk-80-left",
"cacheVariables": {
"NCS_TOOLCHAIN_VERSION": "NONE",
"BOARD": "uhk-80-left",
"BOARD_ROOT": "${sourceParentDir}/",
"mcuboot_OVERLAY_CONFIG": "${sourceDir}/sysbuild/mcuboot.conf",
"CONF_FILE": "${sourceDir}/prj.conf",
"EXTRA_CONF_FILE": "${sourceDir}/prj.conf.overlays/nrf_shared.conf;${sourceDir}/prj.conf.overlays/c2usb.conf;${sourceDir}/prj.conf.overlays/uhk-80.conf;${sourceDir}/prj.conf.overlays/ble_nus.conf"
"CONF_FILE": "${fileDir}/prj.conf"
}
},
{
"name": "uhk-dongle",
"displayName": "Build for UHK dongle",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/uhk-dongle",
"inherits": "defaults",
"cacheVariables": {
"NCS_TOOLCHAIN_VERSION": "NONE",
"BOARD": "uhk-dongle",
"BOARD_ROOT": "${sourceParentDir}/",
"mcuboot_OVERLAY_CONFIG": "${sourceDir}/sysbuild/mcuboot.conf",
"CONF_FILE": "${sourceDir}/prj_release.conf",
"EXTRA_CONF_FILE": "${sourceDir}/prj.conf.overlays/nrf_shared.conf;${sourceDir}/prj.conf.overlays/c2usb.conf;${sourceDir}/prj.conf.overlays/ble_nus_client.conf"
"CONF_FILE": "${fileDir}/prj_release.conf",
"EXTRA_CONF_FILE": "${fileDir}/prj.conf.overlays/nrf_shared.conf;${fileDir}/prj.conf.overlays/c2usb.conf;${fileDir}/prj.conf.overlays/ble_nus_client.conf"
}
},
{
"name": "uhk-dongle-debug",
"displayName": "Debug build for UHK dongle",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/uhk-dongle-debug",
"inherits": "uhk-dongle",
"cacheVariables": {
"NCS_TOOLCHAIN_VERSION": "NONE",
"BOARD": "uhk-dongle",
"BOARD_ROOT": "${sourceParentDir}/",
"mcuboot_OVERLAY_CONFIG": "${sourceDir}/sysbuild/mcuboot.conf",
"CONF_FILE": "${sourceDir}/prj.conf",
"EXTRA_CONF_FILE": "${sourceDir}/prj.conf.overlays/nrf_shared.conf;${sourceDir}/prj.conf.overlays/c2usb.conf;${sourceDir}/prj.conf.overlays/ble_nus_client.conf"
"CONF_FILE": "${fileDir}/prj.conf"
}
}
]
}
}
Loading