Unfortunately I don’t see anything pre-existing on git.
To the _internal_bxcan.h file I added:
#define CANARD_STM32_CAN3 ((volatile CanardSTM32CANType*)0x40003400U) //Memory location of CAN3 config register from stm32f767xx.h.
I added another build config macro to canard_stm32.h for using CAN3 and set it to 1. The build config macros for CAN1 and 2 are set to zero.
I adjusted the #defines at the top of canard_stm32.c to look like this:
#define BXCAN CANARD_STM32_CAN3
#define BXCAN CANARD_STM32_CAN2
#define BXCAN CANARD_STM32_CAN1
However, the canardSTM32Init function errors out at the first instance of: if(!waitMSRINAKBitStateChange(BXCAN, true))
It appears the value of the MCR register at this point is incorrect. I expect MCR to end in 01 (not sleep mode, request init), but instead it ends in 10 (sleep mode, not requesting init). The lines immediately preceeding the if statement are:
BXCAN->MCR &= ~CANARD_STM32_CAN_MCR_SLEEP; // Exit sleep mode
BXCAN->MCR |= CANARD_STM32_CAN_MCR_INRQ; // Request init
I expect these lines to change the last two bits of MCR from 10 to 01, but these lines have no effect on the value of MCR. Any thoughts on why this might be? I don’t think the MCR register is locked somehow.