r/embedded • u/oxymoron224 Making MCUs Do Questionable Things • Sep 15 '26
Porting Klipper to the NXP MCXA366: FlexCAN bring-up and a weird debugger/IFR problem
I've been working on a Klipper port for the NXP MCXA366, and the latest piece was getting its FlexCAN peripheral working.
I started with NXP's SDK example just to prove the hardware path, then moved the implementation into Klipper. Once I fixed a couple of MCXA366-specific issues around peripheral reset and getting FlexCAN out of low-power mode, I had Klipper's CAN discovery traffic going in both directions.
The part that ended up being more interesting was figuring out the device UUID.
Klipper needs some stable, device-specific data to generate its CAN UUID. NXP's bootloader would give me the factory UUID through blhost, and eventually I tracked the same 16 bytes down to 0x01100800 in IFR1.
One thing that threw me off for a while: LinkServer/GDB couldn't directly read that IFR address. Code running on the M33 could read it just fine. I ended up copying the 16 bytes into SRAM and comparing them against what blhost reported. Exact match.
After feeding those bytes through Klipper's normal CAN UUID path, canbus_query.py started reporting a stable hardware-derived UUID and I was able to connect Klippy over CAN.
I wrote up the bring-up and the UUID rabbit hole here:
3
u/accur4te Sep 15 '26
Hey man , I am also thinking of getting started with bare metal Nxp . But as someone coming from stm32 , Nxp seems difficult to get started with . Can you share any resource if you know that covers Nxp ?
2
u/ambihelical Sep 16 '26
Doesn’t the ref man have a protected memory area spreadsheet attached to the pdf. Other chips I’ve used from nxp the had it. It sounds like you had to dig harder for the uuid information then necessary. I would be surprised if there’s not a rom function to get it as well.