Attitude Monitor Project with XIAO_nRF54L15 Sense

I’ve gotten a bit more comfortable using the development tools, so I built an attitude monitor using the XIAO_nRF54L15_sense and XIAO expansion board for practice. For the battery voltage and IMU, I referenced the sample project. For the rest, I reused Arduino libraries: the Madgwick filter to convert acceleration and gyro data into attitude, and the U8g2 driver for the SSD1306.
Using the U8g2 allows for various fonts like the ones shown on the title screen. Pressing the user switch on the expansion board toggles between displaying attitude data and the accelerometer/gyro data.

I hope this serves as a useful reference for anyone interested.

Development Environment
  Visual Studio Code 1.104.2
  nRF Connect SDK v3.1.1
  Installation Directories
    C:/ncs/platform-seeedboards
    C:/ncs/toolchains
    C:/ncs/v3.1.1
    C:/ncs/Projects/POST_nRF54_AttitudeMonitor

Project files are attached here
POST_nRF54_AttitudeMonitor.zip (10.2 KB)
The U8g2 file is too large to attach, so please download it from “GitHub - olikraus/u8g2: U8glib library for monochrome displays, version 2” and copy the csrc folder to POST_nRF54_AttitudeMonitor/lib/U8g2/ for use.


4 Likes

Hi there,

So Nice , work I will definitely get the Park IMU demo going on it, Awesome too , I knew once you got some chair time with the newer tools you would go from , Mason to a Master in NO time at all. :+1:

You building with the West commands, just VS-code or using the NRF_SDK GUI?
That project folder structure is key too for users who don’t know.
The BLE stuff is Next, That should Flex some improved Muscle in that area :crossed_fingers:

I did manage to Lock one up and West would’nt and OpenOcd could’nt access some base memory address, (i’ll post a complet info onit ) but sufice to Say I had to connect it to the nrf54L15_DK (EXT) SWD to Get it back. After I wrote a known good merged.hex to it all is well and using it again. (no bricks yet)
:brick:
:grin: :+1:

GL :v: PJ

Had to switch to a shorter cable to get it to read the Xiao with the internal JLink on the DK board.

Can you post the Merged.hex from the Zephyr build folder.
this way users can flash it and see without building it too :+1:

I installed the nRF Connect for VS Code Extension Pack in VS Code and have been operating solely through the GUI, so I rarely use the west command.
I spent the past month understanding the folder structure and path relationships, and I’ve finally reached a point where I can build reliably.
However, uploads still fail several times a day.

I’m attaching the hex file here.
zephyr.zip (92.2 KB)

2 Likes

Hi there,

Awesome, and it works like a BOSS,


:person_fencing:

Interesting, on the Flashing,
I unzipped everything in a folder , opened a Nrf Ver 3.1…1 terminal

Working directory: d:\Nordic\myapps\workspace\watchface
SDK:               nRF Connect SDK v3.1.1
Toolchain:         nRF Connect SDK Toolchain v3.1.1

PS D:\Nordic\myapps\workspace\watchface> cd..
PS D:\Nordic\myapps\workspace> cd Attitude_imu
PS D:\Nordic\myapps\workspace\Attitude_imu> west build -p always -d build_xiao `
  -b xiao_nrf54l15/nrf54l15/cpuapp . -- `
  -D BOARD_ROOT=C:/ncs/Seeed/platform-seeedboards/zephyr `
  -DSB_CONFIG_BOOTLOADER_MCUBOOT=n `
  -DCONFIG_BOOTLOADER_MCUBOOT=n

then a flash command

west flash -d build_xiao -r openocd

and after about 30 or so( a days worth) I would say I got an error, that OpenOCD couldn’t write to a memory location after a halt command, I went XIAO>SWD>JLINK>DK_Board< and got it back. I will experiment to see if I can reproduce it with the code I was using, was for the round-display.

also in between builds I do a REMOVE (to be clean)
typical looks like this,

# from D:\Nordic\myapps\workspace\watchface
Remove-Item -Recurse -Force .\build_xiao -ErrorAction SilentlyContinue

west build -p always -b xiao_nrf54l15/nrf54l15/cpuapp -d build_xiao . -- `
  -DSHIELD=seeed_xiao_round_display `
  -D BOARD_ROOT=C:/ncs/Seeed/platform-seeedboards/zephyr `
  -DSB_CONFIG_BOOTLOADER_MCUBOOT=n `
  -DCONFIG_BOOTLOADER_MCUBOOT=n

west flash -d build_xiao -r openocd

after I just use the UP arrow key to cycle through the commands each iteration. :+1:, IMO no excuse for not learning one method or another.

GL :slight_smile: PJ :v:

Awesome work! I’m gathering a set of overlays and working samples for the Xiao nrf54L15, hope you don’t mind if I include this in the expansion board samples folder. With credit in readme file of course.

Hi PJ,
Unlike the Arduino IDE, the nRFConnect SDK does not appear to be a stable environment that everyone can use with confidence.
I always perform a pristine build when compiling. Furthermore, issues preventing uploads occur multiple times a day, and each time I run the rescue script.

Hi Toastee0,
Of course. Please use it.

I absolutely cannot use the SD card. I’m eagerly waiting for someone to make the SD card usable.

I have only had to use the unbrick once recently, but I’ve also had random flashing issues from time to time, but I just run West flash a few times and it’ll usually succeed eventually.

I’m building NCS SDK with 3.1.99* from my own repos and 3.1.1 stock to test things.

Thanks for the reminder, I just got the SD card board yesterday, I’ll look into it tonight!

Hi there,

Wow, Something is NOT right there. I myself have had only one " SOFT Brick/ Lock out" since the beginning(recovered with SWD NRF_Programmer- reported it as Locked,(my bad code suspected) I did an erase all first that unwedged it and I flashed the WatchFace.hex straight to it) went back to using the three west Commands and 100% repeatable and stable, I will make a video (desktop recording) doing my process you can see and comment perhaps there is an in between method that is more beginner friendly I agree.
I have created several projects all with the same way and no issue’s in any phases of the process getting to flashing, after it becomes a Rinse & Repeat 3 step. Yes always a -p pristine build 2nd, but I also remove any previous build remnants 1st the command "Remove-Item " may not be needed but i saw it on the Dev academy demo and adopted it ever since.
PITA for debugging SWD, OpenOCD, Seeed Debugger(OpenOcd wrapper) I haven’t arrived at a firm choice WIP

I want to update the “Grab Me” and "IMU Park w/sleep demo also so thanks for the head start :+1:
and I got the full ROLO watch going and I’ll post it up with code.

HTH
GL :slight_smile: PJ :v:

I haven’t recorded the exact circumstances when the problem occurs, so this might not be entirely accurate:but it seems to happen most often when I build first, then connect XIAO to USB to upload. It might just be necessary to build and upload while it’s connected to the USB.

1 Like

Hi there,

I see, I never disconnect unless it’s a battery test or something along those line… for example the Video is me Iterating about 6 times to move the date location over on the watch face palette :grin: (formating) no other way but to adjust it, I Remove, build, flash , LOOK at it , and Remove, build, flash… Look again (nope needs more) adjust coordinates in the main.c and Cycle again. It’s a one click process too

You will see it, like the TV show the “Profit”
The People, The Process and The Product! makes a great company.

HTH
GL :slight_smile: PJ :v:


That little Freaking Rascal “B” means BLE is ON… :+1: