Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
4f9ba40
RSM change to C++
Oct 4, 2025
2266939
Merge branch 'master' into shun/RSM-app
Oct 4, 2025
7983dac
Finished RSM App
Oct 4, 2025
da4da17
RSM App Ready For Test
Oct 5, 2025
a6f91e1
App for TireTemp
Oct 11, 2025
9f96309
namespaces
Oct 15, 2025
539c28f
ready for testing
Oct 15, 2025
72bba54
Unit testing
Oct 19, 2025
b30ad91
unit test continue
Oct 22, 2025
9e46e22
Merge branch 'master' into shun/RSM-app
SAki2007 Oct 22, 2025
9367f1e
fake functions created
Oct 22, 2025
f6aa9ad
finished fake functions and test cases
Oct 25, 2025
31679ed
Before updating imu
Oct 29, 2025
e4977ad
ALMOST DONE DEBUGGING UNIT TEST
Oct 29, 2025
16fb0c8
pump testing
Nov 1, 2025
47dbb02
Ready for testing
Nov 2, 2025
a0af21f
All Testing Complete
Nov 5, 2025
1f8448d
Changing imu
Nov 5, 2025
8cf9727
Finished app + updating imu + testing
Nov 19, 2025
8e87f12
fixed formatting
Nov 19, 2025
68616df
merging with master
Nov 19, 2025
c154421
fixing
Nov 19, 2025
bc946e6
sdf
Nov 19, 2025
c802193
embedded build compiled
Nov 22, 2025
2dd5652
RSM change to C++
Oct 4, 2025
8846c6f
Finished RSM App
Oct 4, 2025
935929a
RSM App Ready For Test
Oct 5, 2025
a27580e
App for TireTemp
Oct 11, 2025
a95841d
namespaces
Oct 15, 2025
1b80b0b
ready for testing
Oct 15, 2025
9a95826
Unit testing
Oct 19, 2025
3e096fb
unit test continue
Oct 22, 2025
f41a9af
fake functions created
Oct 22, 2025
e710d05
finished fake functions and test cases
Oct 25, 2025
ae315b0
Before updating imu
Oct 29, 2025
f2d3fbe
ALMOST DONE DEBUGGING UNIT TEST
Oct 29, 2025
1d64a1a
pump testing
Nov 1, 2025
07fd7ca
Ready for testing
Nov 2, 2025
8e3348c
All Testing Complete
Nov 5, 2025
42a15da
Changing imu
Nov 5, 2025
871c728
Finished app + updating imu + testing
Nov 19, 2025
457d2c9
fixed formatting
Nov 19, 2025
c241a6b
fixing
Nov 19, 2025
be4cd3d
sdf
Nov 19, 2025
cf70f58
embedded build compiled
Nov 22, 2025
2b22162
removed quintuna changes
Nov 23, 2025
5ac67be
dsisdkngkdsn
Nov 23, 2025
e4a14f2
sdkanfkdn
Nov 23, 2025
8c3ff60
dsnfkadsn
Nov 23, 2025
a16516f
dsf
Nov 23, 2025
5fba806
hskdfdsknf
Nov 23, 2025
03b3970
sdf
Nov 23, 2025
7eea30e
dsfds
Nov 23, 2025
383d5d7
dsfs
Nov 23, 2025
6ffb65b
sdfsd
Nov 23, 2025
d1caa98
dsf
Nov 23, 2025
7dc1ed2
hopeuflly last commit
Nov 23, 2025
465a1a9
THIS IS LAST
Nov 23, 2025
6fa5435
last
Nov 23, 2025
5deb01f
please
Nov 23, 2025
e5646bd
started hw
Dec 3, 2025
19b3d75
first commit
Dec 3, 2025
5c83c90
first commit
Dec 3, 2025
f318a5f
finished hw_adcs.cpp
SAki2007 Dec 7, 2025
506e6b2
hw_cans complete
SAki2007 Dec 25, 2025
e079a4b
missing cubeMX reload for gpio
SAki2007 Dec 25, 2025
0c43c83
gpio basically done
SAki2007 Dec 25, 2025
2fb6ade
completed i2c and gpio
SAki2007 Dec 28, 2025
0856e83
spi finished
SAki2007 Jan 7, 2026
54d8104
rebasing
SAki2007 Jan 10, 2026
a5b9b8b
fix
SAki2007 Jan 10, 2026
705d988
update after inline error
SAki2007 Jan 14, 2026
65cdff9
test
SAki2007 Jan 14, 2026
1ca33c7
merging
SAki2007 Jan 14, 2026
0f267d3
pwm finished
SAki2007 Jan 17, 2026
efa4568
merging
SAki2007 Jan 17, 2026
cb8e48a
moving it over to app
SAki2007 Jan 17, 2026
7c247b2
fixing
SAki2007 Jan 17, 2026
a753e8c
sdfs
SAki2007 Jan 17, 2026
636a3b5
likhkj
SAki2007 Jan 17, 2026
9c34e85
merging
SAki2007 Jan 24, 2026
76b7970
about to merge
SAki2007 Jan 28, 2026
5bbcec2
merging with master
SAki2007 Jan 28, 2026
928fb4b
finished half of chimera
SAki2007 Jan 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vscode/settings.json
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove the stuff added here

Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
"--query-driver=/usr/local/bin/arm-none-eabi-gcc"
],
"cortex-debug.variableUseNaturalFormat": false,
}
}
19 changes: 14 additions & 5 deletions firmware/chimera_v2/proto/hexray_proto/rsm.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ enum GpioNetName {
GPIO_LED = 1;
GPIO_BRAKE_LIGHT_EN= 2;
GPIO_RL_INT = 3;
GPIO_IMU_INT1 = 4;
GPIO_IMU_INT2 = 5;
GPIO_BOOT = 6;
GPIO_IMU_CS = 4;
GPIO_IMU_INT = 5;
GPIO_IMU_FSYNC = 6;
GPIO_SUSP_TRAVEL_RR_OCSC = 7;
GPIO_SUSP_TRAVEL_RL_OCSC = 8;
GPIO_BRAKE_OCSC_OK = 9;
GPIO_D_P_PULLUP = 10;
}

enum AdcNetName {
Expand All @@ -20,10 +22,17 @@ enum AdcNetName {
ADC_SUSP_TRAVEL_RL_3V3 = 2;
ADC_SUSP_TRAVEL_RR_3V3 = 3;
ADC_BPS_3V3 = 4;
ADC_nBSPD_BRAKE_PRESSED = 5;
}

enum I2cNetName {
I2C_NET_NAME_UNSPECIFIED = 0;
I2C_IMU_I2C = 1;
I2C_R_PUMP_I2C = 2;
I2C_R_PUMP_I2C = 1;
}

enum SpiNetName {
SPI_NET_NAME_UNSPECIFIED = 0;
SPI_IMU = 1;
}


4 changes: 3 additions & 1 deletion firmware/hexray/RSM/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ list(APPEND HW_SRCS
"${SHARED_HW_INCLUDE_DIR}/hw_error.c"
)
set(HW_INCLUDE_DIRS
# "${CMAKE_CURRENT_SOURCE_DIR}/src/hw"
"${CMAKE_CURRENT_SOURCE_DIR}/src/hw"
"${SHARED_HW_INCLUDE_DIR}" "${SHARED_HW_INCLUDE_DIR_CPP}"
)

Expand Down Expand Up @@ -75,6 +75,8 @@ if ("${TARGET}" STREQUAL "binary")
"stm32h5xx_hal_adc.c"
"stm32h5xx_hal_adc_ex.c"
"stm32h5xx_hal_gpio.c"
"stm32h5xx_hal_fdcan.c"
"stm32h5xx_hal_spi.c"
)
stm32h562xx_cube_library(
"hexray_RSM_stm32"
Expand Down
2 changes: 1 addition & 1 deletion firmware/hexray/RSM/src/app/app_heartbeatMonitors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
#include "app_heartbeatMonitor.hpp"
#include "io_heartbeatNode.hpp"

extern const app::heartbeat::monitor<1> hb_monitor;
extern const app::heartbeat::monitor<1> hb_monitor;
2 changes: 1 addition & 1 deletion firmware/hexray/RSM/src/app/app_imu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ namespace app::imu
void broadcast();
}

extern io::imu::Imu imu_config;
extern io::imu::Imu imu_config;
73 changes: 71 additions & 2 deletions firmware/hexray/RSM/src/chimera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,80 @@ class RSMChimeraConfig : public chimera_v2::config
{
public:
~RSMChimeraConfig() override = default;
std::optional<std::reference_wrapper<const hw::Gpio>> id_to_gpio(const _GpioNetName *gnn) const override;
std::optional<std::reference_wrapper<const hw::Gpio>> id_to_gpio(const _GpioNetName *gnn) const override
{
if (gnn->which_name != gpio_net_name_tag)
{
LOG_ERROR("Chimera: Expected GPIO net name with tag %d, got %d", gpio_net_name_tag, gnn->which_name);
return std::nullopt;
}
switch (gnn->name.rsm_net_name)
{
case rsm_GpioNetName_GPIO_LED:
return std::cref(led);
case rsm_GpioNetName_GPIO_BRAKE_LIGHT_EN:
return std::cref(brake_light_en);
case rsm_GpioNetName_GPIO_RL_INT:
return std::cref(rl_int);
case rsm_GpioNetName_GPIO_IMU_CS:
return std::cref(imu_cs);
case rsm_GpioNetName_GPIO_IMU_INT:
return std::cref(imu_int);
case rsm_GpioNetName_GPIO_IMU_FSYNC:
return std::cref(imu_fsync);
case rsm_GpioNetName_GPIO_SUSP_TRAVEL_RR_OCSC:
return std::cref(susp_travel_rr_ocsc);
case rsm_GpioNetName_GPIO_SUSP_TRAVEL_RL_OCSC:
return std::cref(susp_travel_rl_ocsc);
case rsm_GpioNetName_BRAKE_OCSC_OK:
return std::cref(brake_ocsc_ok);
case rsm_GpioNetName_GPIO_D_P_PULLUP:
return std::cref(d_p_pullup);
default:
case rsm_GpioNetName_GPIO_NET_NAME_UNSPECIFIED:
LOG_INFO("Chimera: Unspecified GPIO net name");
return std::nullopt;
}
}
std::optional<std::reference_wrapper<const hw::Adc>> id_to_adc(const _AdcNetName *ann) const override
{
if (ann->which_name != adc_net_name_tag)
{
LOG_ERROR("Chimera: Expected ADC netname with tag %d, got %d", ann->which_name, adc_net_name_tag)
return std::nullopt;
}
switch (ann->name.rsm_net_name)
{
case rsm_AdcNetName_ADC_LC3_OUT:
return std::cref(lc3_out);
case rsm_AdcNetName_ADC_SUSP_TRAVEL_RL_3V3:
return std::cref(susp_travel_rl_3v3);
case rsm_AdcNetName_ADC_SUSP_TRAVEL_RR_3V3:
return std::cref(susp_travel_rr_3v3);
case rsm_AdcNetName_ADC_BPS_3V3:
return std::cref(bps_3v3);
case rsm_AdcNetName_ADC_nBSPD_BRAKE_PRESSED:
return std::cref(nBSPD_brake_pressed);
default:
case rsm_AdcNetName_ADC_NET_NAME_UNSPECIFIED:
return LOG_INFO("Chimera: Unspecified ADC net name");
return std::nullopt;
}
}

public:
RSMChimeraConfig()
{
gpio_net_name_tag = GpioNetName_rsm_net_name_tag;
adc_net_name_tag = AdcNetName_rsm_net_name_tag;
}
} rsm_config;

void tasks_preInit() {}
void tasks_init()
{
chimera_v2::task(rsm_config);
}
}

//what is a protobuf generated tags
//how does this system actually work with python
57 changes: 55 additions & 2 deletions firmware/hexray/RSM/src/cubemx/Inc/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,66 @@ extern "C"
/* Exported functions prototypes ---------------------------------------------*/
void Error_Handler(void);

/* USER CODE BEGIN EFP */

/* USER CODE BEGIN EFP */
extern ADC_HandleTypeDef hadc1;
extern FDCAN_HandleTypeDef hfdcan1;
extern I2C_HandleTypeDef hi2c2;
extern SPI_HandleTypeDef hspi3;
extern TIM_HandleTypeDef htim1;
extern TIM_HandleTypeDef htim3;
/* USER CODE END EFP */

/* Private defines -----------------------------------------------------------*/
#define TIMx_FREQUENCY 64000000
#define TIM1_FREQUENCY 100
#define TIM1_PRESCALER 64
#define TIM1_ARR 1000
#define BPS_R_3V3_Pin GPIO_PIN_2
#define BPS_R_3V3_GPIO_Port GPIOC
#define LC3_OUT_Pin GPIO_PIN_0
#define LC3_OUT_GPIO_Port GPIOA
#define nBSPD_BRAKE_PRESSED_3V3_Pin GPIO_PIN_2
#define nBSPD_BRAKE_PRESSED_3V3_GPIO_Port GPIOA
#define BRAKE_OCSC_OK_3V3_Pin GPIO_PIN_3
#define BRAKE_OCSC_OK_3V3_GPIO_Port GPIOA
#define RL_INT_3V3_SENS_Pin GPIO_PIN_4
#define RL_INT_3V3_SENS_GPIO_Port GPIOA
#define SUSP_TRAVEL_RL_3V3_Pin GPIO_PIN_5
#define SUSP_TRAVEL_RL_3V3_GPIO_Port GPIOA
#define SUSP_TRAVEL_RR_3V3_Pin GPIO_PIN_6
#define SUSP_TRAVEL_RR_3V3_GPIO_Port GPIOA
#define SUSP_TRAVEL_RL_OCSC_Pin GPIO_PIN_7
#define SUSP_TRAVEL_RL_OCSC_GPIO_Port GPIOA
#define SUSP_TRAVEL_RR_OCSC_Pin GPIO_PIN_4
#define SUSP_TRAVEL_RR_OCSC_GPIO_Port GPIOC
#define RPUMP_SCL_Pin GPIO_PIN_10
#define RPUMP_SCL_GPIO_Port GPIOB
#define RPUMP_SDA_Pin GPIO_PIN_12
#define RPUMP_SDA_GPIO_Port GPIOB
#define IMU_CS_Pin GPIO_PIN_6
#define IMU_CS_GPIO_Port GPIOC
#define IMU_INT_Pin GPIO_PIN_7
#define IMU_INT_GPIO_Port GPIOC
#define IMU_FSYNC_Pin GPIO_PIN_8
#define IMU_FSYNC_GPIO_Port GPIOC
#define FLOW_METER_5V5_Pin GPIO_PIN_8
#define FLOW_METER_5V5_GPIO_Port GPIOA
#define BRAKE_LIGHT_EN_3V3_Pin GPIO_PIN_9
#define BRAKE_LIGHT_EN_3V3_GPIO_Port GPIOA
#define IMU_SPC_Pin GPIO_PIN_10
#define IMU_SPC_GPIO_Port GPIOC
#define IMU_SDO_Pin GPIO_PIN_11
#define IMU_SDO_GPIO_Port GPIOC
#define IMU_SDI_Pin GPIO_PIN_12
#define IMU_SDI_GPIO_Port GPIOC
#define D_P_PULLUP_Pin GPIO_PIN_2
#define D_P_PULLUP_GPIO_Port GPIOD
#define LED_Pin GPIO_PIN_4
#define LED_GPIO_Port GPIOB
#define CANTX_Pin GPIO_PIN_7
#define CANTX_GPIO_Port GPIOB
#define CANRX_Pin GPIO_PIN_8
#define CANRX_GPIO_Port GPIOB

/* USER CODE BEGIN Private defines */

Expand Down
6 changes: 3 additions & 3 deletions firmware/hexray/RSM/src/cubemx/Inc/stm32h5xx_hal_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ extern "C"
/*#define HAL_DCMI_MODULE_ENABLED */
/*#define HAL_DTS_MODULE_ENABLED */
/*#define HAL_ETH_MODULE_ENABLED */
/*#define HAL_FDCAN_MODULE_ENABLED */
#define HAL_FDCAN_MODULE_ENABLED
/*#define HAL_FMAC_MODULE_ENABLED */
/*#define HAL_GTZC_MODULE_ENABLED */
/*#define HAL_HASH_MODULE_ENABLED */
/*#define HAL_HCD_MODULE_ENABLED */
#define HAL_HCD_MODULE_ENABLED
/*#define HAL_IRDA_MODULE_ENABLED */
/*#define HAL_IWDG_MODULE_ENABLED */
#define HAL_I2C_MODULE_ENABLED
Expand All @@ -80,7 +80,7 @@ extern "C"
/*#define HAL_MMC_MODULE_ENABLED */
/*#define HAL_SMARTCARD_MODULE_ENABLED */
/*#define HAL_SMBUS_MODULE_ENABLED */
/*#define HAL_SPI_MODULE_ENABLED */
#define HAL_SPI_MODULE_ENABLED
/*#define HAL_SRAM_MODULE_ENABLED */
#define HAL_TIM_MODULE_ENABLED
/*#define HAL_RAMCFG_MODULE_ENABLED */
Expand Down
2 changes: 2 additions & 0 deletions firmware/hexray/RSM/src/cubemx/Inc/stm32h5xx_it.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ extern "C"
void UsageFault_Handler(void);
void DebugMon_Handler(void);
void ADC1_IRQHandler(void);
void FDCAN1_IT0_IRQHandler(void);
void FDCAN1_IT1_IRQHandler(void);
void TIM6_IRQHandler(void);
/* USER CODE BEGIN EFP */

Expand Down
Loading
Loading