From c49c5545b79df07321d098ca2540b72fbf6ca5c0 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Fri, 18 Oct 2024 11:14:10 -0700 Subject: [PATCH 1/3] build --- .github/workflows/test.yaml | 2 ++ board/safety/safety_chrysler.h | 53 +++++++++++++++++----------------- 2 files changed, 29 insertions(+), 26 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 12d956eecf..221bce0096 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -54,6 +54,8 @@ jobs: run: ${{ env.RUN }} "scons -j4 --ubsan" - name: Build jungle firmware with FINAL_PROVISIONING support run: ${{ env.RUN }} "FINAL_PROVISIONING=1 scons -j4 board/jungle" + - name: Build panda in release mode + run: ${{ env.RUN }} "CERT=certs/debug RELEASE=1 scons -j4" unit_tests: name: unit tests diff --git a/board/safety/safety_chrysler.h b/board/safety/safety_chrysler.h index 631dbecde9..74818fccbe 100644 --- a/board/safety/safety_chrysler.h +++ b/board/safety/safety_chrysler.h @@ -211,18 +211,6 @@ static safety_config chrysler_init(uint16_t param) { .CRUISE_BUTTONS = 0xB1, // Cruise control buttons }; - // CAN messages for the 5th gen RAM HD platform - static const ChryslerAddrs CHRYSLER_RAM_HD_ADDRS = { - .EPS_2 = 0x220, // EPS driver input torque - .ESP_1 = 0x140, // Brake pedal and vehicle speed - .ESP_8 = 0x11C, // Brake pedal and vehicle speed - .ECM_5 = 0x22F, // Throttle position sensor - .DAS_3 = 0x1F4, // ACC engagement states from DASM - .DAS_6 = 0x275, // LKAS HUD and auto headlight control from DASM - .LKAS_COMMAND = 0x276, // LKAS controls from DASM - .CRUISE_BUTTONS = 0x23A, // Cruise control buttons - }; - static RxCheck chrysler_ram_dt_rx_checks[] = { {.msg = {{CHRYSLER_RAM_DT_ADDRS.EPS_2, 0, 8, .check_checksum = true, .max_counter = 15U, .frequency = 100U}, { 0 }, { 0 }}}, {.msg = {{CHRYSLER_RAM_DT_ADDRS.ESP_1, 0, 8, .check_checksum = true, .max_counter = 15U, .frequency = 50U}, { 0 }, { 0 }}}, @@ -240,14 +228,6 @@ static safety_config chrysler_init(uint16_t param) { {.msg = {{CHRYSLER_ADDRS.DAS_3, 0, 8, .check_checksum = true, .max_counter = 15U, .frequency = 50U}, { 0 }, { 0 }}}, }; - static RxCheck chrysler_ram_hd_rx_checks[] = { - {.msg = {{CHRYSLER_RAM_HD_ADDRS.EPS_2, 0, 8, .check_checksum = true, .max_counter = 15U, .frequency = 100U}, { 0 }, { 0 }}}, - {.msg = {{CHRYSLER_RAM_HD_ADDRS.ESP_1, 0, 8, .check_checksum = true, .max_counter = 15U, .frequency = 50U}, { 0 }, { 0 }}}, - {.msg = {{CHRYSLER_RAM_HD_ADDRS.ESP_8, 0, 8, .check_checksum = true, .max_counter = 15U, .frequency = 50U}, { 0 }, { 0 }}}, - {.msg = {{CHRYSLER_RAM_HD_ADDRS.ECM_5, 0, 8, .check_checksum = true, .max_counter = 15U, .frequency = 50U}, { 0 }, { 0 }}}, - {.msg = {{CHRYSLER_RAM_HD_ADDRS.DAS_3, 2, 8, .check_checksum = true, .max_counter = 15U, .frequency = 50U}, { 0 }, { 0 }}}, - }; - static const CanMsg CHRYSLER_TX_MSGS[] = { {CHRYSLER_ADDRS.CRUISE_BUTTONS, 0, 3}, {CHRYSLER_ADDRS.LKAS_COMMAND, 0, 6}, @@ -260,12 +240,6 @@ static safety_config chrysler_init(uint16_t param) { {CHRYSLER_RAM_DT_ADDRS.DAS_6, 0, 8}, }; - static const CanMsg CHRYSLER_RAM_HD_TX_MSGS[] = { - {CHRYSLER_RAM_HD_ADDRS.CRUISE_BUTTONS, 2, 3}, - {CHRYSLER_RAM_HD_ADDRS.LKAS_COMMAND, 0, 8}, - {CHRYSLER_RAM_HD_ADDRS.DAS_6, 0, 8}, - }; - safety_config ret; bool enable_ram_dt = GET_FLAG(param, CHRYSLER_PARAM_RAM_DT); @@ -281,6 +255,33 @@ static safety_config chrysler_init(uint16_t param) { ret = BUILD_SAFETY_CFG(chrysler_ram_dt_rx_checks, CHRYSLER_RAM_DT_TX_MSGS); #ifdef ALLOW_DEBUG } else if (enable_ram_hd) { + + // CAN messages for the 5th gen RAM HD platform + static const ChryslerAddrs CHRYSLER_RAM_HD_ADDRS = { + .EPS_2 = 0x220, // EPS driver input torque + .ESP_1 = 0x140, // Brake pedal and vehicle speed + .ESP_8 = 0x11C, // Brake pedal and vehicle speed + .ECM_5 = 0x22F, // Throttle position sensor + .DAS_3 = 0x1F4, // ACC engagement states from DASM + .DAS_6 = 0x275, // LKAS HUD and auto headlight control from DASM + .LKAS_COMMAND = 0x276, // LKAS controls from DASM + .CRUISE_BUTTONS = 0x23A, // Cruise control buttons + }; + + static RxCheck chrysler_ram_hd_rx_checks[] = { + {.msg = {{CHRYSLER_RAM_HD_ADDRS.EPS_2, 0, 8, .check_checksum = true, .max_counter = 15U, .frequency = 100U}, { 0 }, { 0 }}}, + {.msg = {{CHRYSLER_RAM_HD_ADDRS.ESP_1, 0, 8, .check_checksum = true, .max_counter = 15U, .frequency = 50U}, { 0 }, { 0 }}}, + {.msg = {{CHRYSLER_RAM_HD_ADDRS.ESP_8, 0, 8, .check_checksum = true, .max_counter = 15U, .frequency = 50U}, { 0 }, { 0 }}}, + {.msg = {{CHRYSLER_RAM_HD_ADDRS.ECM_5, 0, 8, .check_checksum = true, .max_counter = 15U, .frequency = 50U}, { 0 }, { 0 }}}, + {.msg = {{CHRYSLER_RAM_HD_ADDRS.DAS_3, 2, 8, .check_checksum = true, .max_counter = 15U, .frequency = 50U}, { 0 }, { 0 }}}, + }; + + static const CanMsg CHRYSLER_RAM_HD_TX_MSGS[] = { + {CHRYSLER_RAM_HD_ADDRS.CRUISE_BUTTONS, 2, 3}, + {CHRYSLER_RAM_HD_ADDRS.LKAS_COMMAND, 0, 8}, + {CHRYSLER_RAM_HD_ADDRS.DAS_6, 0, 8}, + }; + chrysler_platform = CHRYSLER_RAM_HD; chrysler_addrs = &CHRYSLER_RAM_HD_ADDRS; ret = BUILD_SAFETY_CFG(chrysler_ram_hd_rx_checks, CHRYSLER_RAM_HD_TX_MSGS); From e9030e3631700de607e455c20f276b957c83f59a Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Fri, 18 Oct 2024 11:55:17 -0700 Subject: [PATCH 2/3] space --- board/safety/safety_chrysler.h | 1 - 1 file changed, 1 deletion(-) diff --git a/board/safety/safety_chrysler.h b/board/safety/safety_chrysler.h index 74818fccbe..013023bbbd 100644 --- a/board/safety/safety_chrysler.h +++ b/board/safety/safety_chrysler.h @@ -255,7 +255,6 @@ static safety_config chrysler_init(uint16_t param) { ret = BUILD_SAFETY_CFG(chrysler_ram_dt_rx_checks, CHRYSLER_RAM_DT_TX_MSGS); #ifdef ALLOW_DEBUG } else if (enable_ram_hd) { - // CAN messages for the 5th gen RAM HD platform static const ChryslerAddrs CHRYSLER_RAM_HD_ADDRS = { .EPS_2 = 0x220, // EPS driver input torque From 89f382520779f0d843a55b0adfbb5496ac2c0a3d Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Fri, 18 Oct 2024 13:16:08 -0700 Subject: [PATCH 3/3] better --- board/safety/safety_chrysler.h | 58 +++++++++++++++++----------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/board/safety/safety_chrysler.h b/board/safety/safety_chrysler.h index 013023bbbd..2bbc942715 100644 --- a/board/safety/safety_chrysler.h +++ b/board/safety/safety_chrysler.h @@ -240,47 +240,47 @@ static safety_config chrysler_init(uint16_t param) { {CHRYSLER_RAM_DT_ADDRS.DAS_6, 0, 8}, }; - safety_config ret; +#ifdef ALLOW_DEBUG + // CAN messages for the 5th gen RAM HD platform + static const ChryslerAddrs CHRYSLER_RAM_HD_ADDRS = { + .EPS_2 = 0x220, // EPS driver input torque + .ESP_1 = 0x140, // Brake pedal and vehicle speed + .ESP_8 = 0x11C, // Brake pedal and vehicle speed + .ECM_5 = 0x22F, // Throttle position sensor + .DAS_3 = 0x1F4, // ACC engagement states from DASM + .DAS_6 = 0x275, // LKAS HUD and auto headlight control from DASM + .LKAS_COMMAND = 0x276, // LKAS controls from DASM + .CRUISE_BUTTONS = 0x23A, // Cruise control buttons + }; - bool enable_ram_dt = GET_FLAG(param, CHRYSLER_PARAM_RAM_DT); + static RxCheck chrysler_ram_hd_rx_checks[] = { + {.msg = {{CHRYSLER_RAM_HD_ADDRS.EPS_2, 0, 8, .check_checksum = true, .max_counter = 15U, .frequency = 100U}, { 0 }, { 0 }}}, + {.msg = {{CHRYSLER_RAM_HD_ADDRS.ESP_1, 0, 8, .check_checksum = true, .max_counter = 15U, .frequency = 50U}, { 0 }, { 0 }}}, + {.msg = {{CHRYSLER_RAM_HD_ADDRS.ESP_8, 0, 8, .check_checksum = true, .max_counter = 15U, .frequency = 50U}, { 0 }, { 0 }}}, + {.msg = {{CHRYSLER_RAM_HD_ADDRS.ECM_5, 0, 8, .check_checksum = true, .max_counter = 15U, .frequency = 50U}, { 0 }, { 0 }}}, + {.msg = {{CHRYSLER_RAM_HD_ADDRS.DAS_3, 2, 8, .check_checksum = true, .max_counter = 15U, .frequency = 50U}, { 0 }, { 0 }}}, + }; + + static const CanMsg CHRYSLER_RAM_HD_TX_MSGS[] = { + {CHRYSLER_RAM_HD_ADDRS.CRUISE_BUTTONS, 2, 3}, + {CHRYSLER_RAM_HD_ADDRS.LKAS_COMMAND, 0, 8}, + {CHRYSLER_RAM_HD_ADDRS.DAS_6, 0, 8}, + }; -#ifdef ALLOW_DEBUG const uint32_t CHRYSLER_PARAM_RAM_HD = 2U; // set for Ram HD platform bool enable_ram_hd = GET_FLAG(param, CHRYSLER_PARAM_RAM_HD); #endif + safety_config ret; + + bool enable_ram_dt = GET_FLAG(param, CHRYSLER_PARAM_RAM_DT); + if (enable_ram_dt) { chrysler_platform = CHRYSLER_RAM_DT; chrysler_addrs = &CHRYSLER_RAM_DT_ADDRS; ret = BUILD_SAFETY_CFG(chrysler_ram_dt_rx_checks, CHRYSLER_RAM_DT_TX_MSGS); #ifdef ALLOW_DEBUG } else if (enable_ram_hd) { - // CAN messages for the 5th gen RAM HD platform - static const ChryslerAddrs CHRYSLER_RAM_HD_ADDRS = { - .EPS_2 = 0x220, // EPS driver input torque - .ESP_1 = 0x140, // Brake pedal and vehicle speed - .ESP_8 = 0x11C, // Brake pedal and vehicle speed - .ECM_5 = 0x22F, // Throttle position sensor - .DAS_3 = 0x1F4, // ACC engagement states from DASM - .DAS_6 = 0x275, // LKAS HUD and auto headlight control from DASM - .LKAS_COMMAND = 0x276, // LKAS controls from DASM - .CRUISE_BUTTONS = 0x23A, // Cruise control buttons - }; - - static RxCheck chrysler_ram_hd_rx_checks[] = { - {.msg = {{CHRYSLER_RAM_HD_ADDRS.EPS_2, 0, 8, .check_checksum = true, .max_counter = 15U, .frequency = 100U}, { 0 }, { 0 }}}, - {.msg = {{CHRYSLER_RAM_HD_ADDRS.ESP_1, 0, 8, .check_checksum = true, .max_counter = 15U, .frequency = 50U}, { 0 }, { 0 }}}, - {.msg = {{CHRYSLER_RAM_HD_ADDRS.ESP_8, 0, 8, .check_checksum = true, .max_counter = 15U, .frequency = 50U}, { 0 }, { 0 }}}, - {.msg = {{CHRYSLER_RAM_HD_ADDRS.ECM_5, 0, 8, .check_checksum = true, .max_counter = 15U, .frequency = 50U}, { 0 }, { 0 }}}, - {.msg = {{CHRYSLER_RAM_HD_ADDRS.DAS_3, 2, 8, .check_checksum = true, .max_counter = 15U, .frequency = 50U}, { 0 }, { 0 }}}, - }; - - static const CanMsg CHRYSLER_RAM_HD_TX_MSGS[] = { - {CHRYSLER_RAM_HD_ADDRS.CRUISE_BUTTONS, 2, 3}, - {CHRYSLER_RAM_HD_ADDRS.LKAS_COMMAND, 0, 8}, - {CHRYSLER_RAM_HD_ADDRS.DAS_6, 0, 8}, - }; - chrysler_platform = CHRYSLER_RAM_HD; chrysler_addrs = &CHRYSLER_RAM_HD_ADDRS; ret = BUILD_SAFETY_CFG(chrysler_ram_hd_rx_checks, CHRYSLER_RAM_HD_TX_MSGS);