Hi,
I suppose that you do not configure the CAN1 bus pins, on the LPCXpressoo54S018 card, this is the pins assignment.
J10 connector
PIO3_19: CAN0_RD
PIO3_18: CAN0_TD
J9 connector:
PIO1_18: CAN0_RD
PIO1_17: CAN0_TD
If you want to use the CAN1 bus which is connected to pin2 and 4 of J9, you have to configure the PIO1_18 and PIO1_17 pins with the code in pin_mux.c
#define IOCON_PIO_FUNC5 5
void BOARD_InitPins(void)
{
/* Enables the clock for the IOCON block. 0 = Disable; 1 = Enable.: 0x01u */
CLOCK_EnableClock(kCLOCK_Iocon);
const uint32_t port1_pin18_config = (/* Pin is configured as CAN1_RD*/
IOCON_PIO_FUNC5 |
/* No addition pin function */
IOCON_PIO_MODE_INACT |
/* Input function is not inverted */
IOCON_PIO_INV_DI |
/* Enables digital function */
IOCON_PIO_DIGITAL_EN |
/* Input filter disabled */
IOCON_PIO_INPFILT_OFF |
/* Standard mode, output slew rate control is enabled */
IOCON_PIO_SLEW_STANDARD |
/* Open drain is disabled */
IOCON_PIO_OPENDRAIN_DI);
IOCON_PinMuxSet(IOCON, 1U, 18U, port1_pin18_config);
const uint32_t port1_pin17_config = (/* Pin is configured as CAN1_TD*/
IOCON_PIO_FUNC5 |
/* No addition pin function */
IOCON_PIO_MODE_INACT |
/* Input function is not inverted */
IOCON_PIO_INV_DI |
/* Enables digital function */
IOCON_PIO_DIGITAL_EN |
/* Input filter disabled */
IOCON_PIO_INPFILT_OFF |
/* Standard mode, output slew rate control is enabled */
IOCON_PIO_SLEW_STANDARD |
/* Open drain is disabled */
IOCON_PIO_OPENDRAIN_DI);
IOCON_PinMuxSet(IOCON, 1U, 17U, port1_pin17_config);
..........
}
Pls have a try.
This is only my guess, if you still have issue, pls update the ticket.
BR
XiangJun Rong