Repository navigation
feat(boards): add AkidaTag hardware revision 2 as a build target - #97
Merged
Merged
Conversation
The disconnect handler called dk_set_led_off() on every board, while every other DK LED call is guarded by CONFIG_DK_BOARD. On the AkidaTag board the DK library's LED table came from the nRF5340 DK devicetree, so the call cleared the output latch of P0.29, the console UART's TX pin, which the UART owns while it runs. Without the DK devicetree the table is empty and the call would log an error at every disconnect instead.
…ition The AkidaTag board was built as the nRF5340 DK with an application overlay and an MCUboot overlay on top. Zephyr can only attach hardware revisions to a board of its own, and the nRF5340 DK has none, so the board now has a board definition in src/boards/brainchip/akidatag/, adapted from the DK's. Its devicetree is split into what every revision shares and a revision 1 overlay, and board.yml declares revision 1 as the default. MCUboot's changes move into the sysbuild configuration directory src/sysbuild/mcuboot/, whose boards/ overlays sysbuild finds by board and revision name. MCUboot then no longer reads its own prj.conf, so the directory restates it; the project's settings stay in mcuboot.conf. run.sh builds akidatag/nrf5340/cpuapp with src as the board root, and names the DK target explicitly instead of reading it from the environment. The revision 1 network core image is byte-identical to the one built from the overlays. MCUboot and the application differ only where the DK devicetree used to leak in: MCUboot no longer carries pin control code for the DK's PWM LED, and the application no longer carries the DK's LED table or its Arduino node labels.
Revision 2 is a Zephyr board revision of the AkidaTag board, selected with run.sh --rev 2 (akidatag@2/nrf5340/cpuapp). Revision 1 stays the default. The revision 2 overlay follows the revision 2 schematic, netlist and bill of materials: the camera on SPIM2 (P0.06, P0.07, P0.26, chip select P0.25), the camera supply switch on P1.06, the camera level shifter enable on P1.15 as active low, the user button on P1.01, the red, green, blue and white LEDs on P1.14, P0.27, P1.13 and P0.28, no akdreset line, and Winbond W25Q128JW flash in both positions. MCUboot on revision 2 uses the board's flash node directly. The firmware follows the description rather than fixed names: the camera driver takes the camera node's bus, the power-up sequence switches on the camera supply when the board has one, and the AKD1500 flash routines skip the Micron flag status commands when the flash is not a Micron part, since Winbond parts use those opcodes for other commands. The INA190 variant defaults to A3 on revision 2.
Describe --rev 2 wherever the build options are documented, and replace the statements that both boards build as the nRF5340 DK with the board definition and its revisions.
The datasheet described the firmware on main as not matching revision 2. Its pin table, flash, camera, power and current-sense notes now describe a revision 2 build and how to make one, and list where the default revision 1 build differs. The fuel gauge note states that both revisions share the same current-sign handling, which is checked on the first revision 2 board. Source references point at the board definition that replaces the removed overlays.
Main now keeps the published pages to the AkidaTag board. The developer guide's build section takes this branch's board definition and revision 2 wording without the DK build lines.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
AkidaTag hardware revision 2 becomes a build target next to revision 1:
To get there, the AkidaTag board stops being "the nRF5340 DK plus an overlay" and becomes a Zephyr board definition,
src/boards/brainchip/akidatag/, with revisions 1 and 2. Revision 1 stays the default inboard.yml, and release and CI builds are unchanged: nothing under.github/workflows/is touched.Revision 2 is not the default or the release target yet. That switch waits until the firmware has been tested on a real revision 2 board.
Why Zephyr board revisions
nRF Connect SDK v3.1.1 uses Zephyr's hardware model v2. HWMv2 handles hardware revisions as board revisions:
board.ymldeclares them (revision:withformat: number,default: "1",exact: true).akidatag@2/nrf5340/cpuapp.<board>_<qualifiers>_<revision>.overlay(and_defconfig) are picked up for the selected revision.BOARD_REVISIONis set in CMake and Kconfig.This PR uses that one mechanism and nothing alongside it:
src/sysbuild/mcuboot/boards/under the same revision file names. Sysbuild discovers them there.BOARD_REVISION.run.sh --rev Nonly appends@Nto the board target.Alternatives considered:
nrf5340dk, which has no revisions. A board extension can add variants to it, but not revisions.ns, not for different PCB revisions.run.shchoosing overlay files. Either would be a second selection mechanism outside Zephyr's, and it would not reach MCUboot or the network core consistently.The move to sysbuild's MCUboot configuration directory has one cost. That directory replaces MCUboot's own configuration directory, so
src/sysbuild/mcuboot/prj.confrestates MCUboot'sprj.conffrom NCS v3.1.1 unchanged.src/sysbuild/mcuboot.confstill carries the project's settings.Revision 2 differences
I checked the full nRF5340 pin map against the revision 2 schematic, netlist and bill of materials, not only the known list. The pins below differ from revision 1. Every other pin matches revision 1: UART, I2C, PDM, the AKD1500 host SPI, the rail enables, charger status, fuel gauge and IMU interrupts, and the ADC inputs.
cam_pwr_enbon P1.06, switched on just before the level shiftersakdresetThe Winbond deep power-down timings come from the W25Q128JW datasheet: 3 µs to enter, 30 µs to exit.
The firmware now reads these properties from the board description instead of hard-coding them:
spi3.akidatag_peripherals_power_enable()switches on the camera supply when the board has one.Revision 1 behaviour is unchanged
I built revision 1 from
mainand from this branch in the same container and compared the images:Network core (
hci_ipc): byte-identical.MCUboot: only the pin control function differs. It lost the PWM case, which came from the DK's PWM LED node, and gained the PDM case for the board's microphone. MCUboot configures only UART and SPIM pins, so no executed path changes. As a check, a throwaway build with those two nodes swapped back produced an MCUboot identical to
main.Application: three differences, all from DK devicetree content that the old overlay approach inherited:
arduino_i2candarduino_spilabels.dk_set_led_off(). Onmainthat call went through the DK's LED table and cleared the output latch of P0.29. That pin is the console UART's TX, which the UART owns while it runs. With the DK table gone, the call would have logged an error at every disconnect instead. It is now guarded byCONFIG_DK_BOARD, like every other DK LED call (the first commit).gpio.creports a different line number.With the DK LED table and labels put back in a throwaway build, the application was identical to
mainexcept for that line number.Devicetree: every enabled node that remains has the same pins and properties. The nodes that went away are DK leftovers with no driver in this firmware: the Arduino connectors, the PWM LED, USBD, NFCT, IEEE 802.15.4 and the boot-mode retention area.
DK build: MCUboot and the network core are byte-identical to
main. The application differs only by the guarded LED call.Builds and checks
CI builds two targets today: the AkidaTag release build in
release.ymland the DK build inhardware.yml. The DK has no hardware revisions, so the full matrix is revision 1, revision 2 and the DK, each built from the head of this branch.On the toolchain image: CI uses
ghcr.io/brainchip-inc/akidatag-ncs:v3.1.1-py3.12, but pulling it from this machine failed twice on the same layer. All builds below therefore ran inakidatag-ncs:v3.1.1-py3.12, built locally from the samedocker/Dockerfilewith NCS v3.1.1 and Python 3.12. The only toolchain-side change since that image was built is the host Python requirements../scripts/run.sh -d --release -b --app demo_apps./scripts/run.sh -d --release -b --rev 2 --app demo_appsCONFIG_BOARD_REVISION="2"andINA190_VARIANT_A3in the application, MCUboot and network core images../scripts/run.sh -d --release -b --dk --app demo_appsmain.main, revision 1 and DKmain(the published docs trim)npm run buildinsite/Checks:
akd_spi_flash.cppkeeps its CRLF line endings.scripts/run.sh: passed..github/ci-gates/check-subject.sh.--rev 2 --dkis rejected with an error.No board was flashed or connected for this PR.
To test on the first revision 2 board
power readwith the A3 default against a meter.Other changes
NOTICErecords that the board definition is adapted from Zephyr's nRF5340 DK board. Those files keep the upstream copyright and SPDX lines.The docs changes are limited to two kinds:
--rev 2build and flash commands, documented wherever build options are documented:docs/setup.md,docs/developer-guide.md,README.md,src/README.md,AGENTS.mdand therun.shhelp. The published pages underdocs/mention only the AkidaTag board. The DK appears only in firmware code, scripts,AGENTS.mdandsrc/README.md.docs/hardware/, the passages saying the firmware does not match revision 2. They now describe a revision 2 build.I also updated the file references in those docs that named the removed overlay files. After
maingained the published docs trim, the developer guide's statement that the AkidaTag builds asnrf5340dk/nrf5340/cpuappbecame the board definition wording.Noticed, not changed
docs/BOARD_OVERLAY_CHANGES.mdstill describes the removed overlay.flash@0name, because the device name is part of the image. Itsreg = <1>triggers a devicetree unit-address warning.