diff --git a/docs/extra-build-config.md b/docs/extra-build-config.md index 3d66ffde..dfb86f16 100644 --- a/docs/extra-build-config.md +++ b/docs/extra-build-config.md @@ -340,6 +340,13 @@ Some modules may require setting the frequency of the crystal oscillator used on CAN_OSCILLATOR="8000000" +Configure the interrupt pin to the one connected to the CAN module. By default, +the pins are set to 25 for can0 and 24 for can1. To change them to 12 and 16, +the following variables also have to be set: + + CAN0_INTERRUPT_PIN = "12" + CAN1_INTERRUPT_PIN = "16" + Tested modules: * PiCAN2 (16 MHz crystal): diff --git a/recipes-bsp/bootfiles/rpi-config_git.bb b/recipes-bsp/bootfiles/rpi-config_git.bb index ee0f407b..23594960 100644 --- a/recipes-bsp/bootfiles/rpi-config_git.bb +++ b/recipes-bsp/bootfiles/rpi-config_git.bb @@ -30,6 +30,8 @@ GPIO_IR ?= "18" GPIO_IR_TX ?= "17" CAN_OSCILLATOR ?= "16000000" +CAN0_INTERRUPT_PIN ?= "25" +CAN1_INTERRUPT_PIN ?= "24" ENABLE_UART ??= "" @@ -268,12 +270,12 @@ do_deploy() { # ENABLE DUAL CAN if [ "${ENABLE_DUAL_CAN}" = "1" ]; then echo "# Enable DUAL CAN" >>$CONFIG - echo "dtoverlay=mcp2515-can0,oscillator=${CAN_OSCILLATOR},interrupt=25" >>$CONFIG - echo "dtoverlay=mcp2515-can1,oscillator=${CAN_OSCILLATOR},interrupt=24" >>$CONFIG + echo "dtoverlay=mcp2515-can0,oscillator=${CAN_OSCILLATOR},interrupt=${CAN0_INTERRUPT_PIN}" >>$CONFIG + echo "dtoverlay=mcp2515-can1,oscillator=${CAN_OSCILLATOR},interrupt=${CAN1_INTERRUPT_PIN}" >>$CONFIG # ENABLE CAN elif [ "${ENABLE_CAN}" = "1" ]; then echo "# Enable CAN" >>$CONFIG - echo "dtoverlay=mcp2515-can0,oscillator=${CAN_OSCILLATOR},interrupt=25" >>$CONFIG + echo "dtoverlay=mcp2515-can0,oscillator=${CAN_OSCILLATOR},interrupt=${CAN0_INTERRUPT_PIN}" >>$CONFIG fi