Enabling NuttX CAN drivers on Pixhawk4

I’m trying to get the NuttX CAN drivers built for my Pixhawk4 (px4_fmu-v5_default) and I can’t seem to get them to build. I verified that uavcan is disabled and that the NuttX CAN interfaces and STM32 CAN1 and CAN2 peripherals are enabled via boardconfig and menuconfig. However, it looks like the CAN drivers aren’t building and there’s no sign of /dev/can0 or /dev/can1 once I build it. What configuration options should I check?

ETA: CAN drivers are building but I can’t link my application in such a way that I can link the can_devinit() function nor do I see /dev/can0 or /dev/can1 on the Pixhawk once I load the code.

So… I got past this hurdle by modifying boards/px4/fmu-v5/src/init.c.
I added a local declaration for can_devinit():

extern int can_devinit(void);

And I added a call to it down at the bottom of board_app_initialize(). So now /dev/can0 exists and my code starts and appears to be able to open. However, I see no evidence of incoming packets, despite there being a talkative NMEA2000 device on the CAN bus.

Have you had any more success?

I’m trying to do the same. I made a new driver taking some inspiration from src/drivers/cyphal/CanardNuttXCDev.cpp. I can read and write to /dev/can0 without error, but nothing is written to the bus (connected to CAN1), nor are incoming messages read - so seems like the same result. I verified with a CAN adapter connected to my computer.