Skip to content

Commit

Permalink
F4 and F7 CAN HAL (#75)
Browse files Browse the repository at this point in the history
* Port of L4 CAN HAL to F4 and F7

* Tested and added fun PDU stuff

* Added Hardfault light

* Added Fault Library initialization

* Quick SPI change so you can send w/o recieving using DMA

* reset to last actual change

* Fixed L471 not Building, Renaming Navigation (#76)

---------

Co-authored-by: AdityaAsGithub <[email protected]>

---------

Co-authored-by: Chris McGalliard <[email protected]>
Co-authored-by: AdityaAsGithub <[email protected]>
  • Loading branch information
3 people authored Dec 16, 2023
1 parent 4560da9 commit 77d3c5c
Show file tree
Hide file tree
Showing 22 changed files with 1,070 additions and 204 deletions.
19 changes: 19 additions & 0 deletions common/daq/can_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,25 @@
],
"rx": []
},
{
"node_name": "PDU",
"node_ssa":31,
"tx": [
{
"msg_name":"pdu_test",
"msg_desc":"periodic dashboard heartbeat",
"signals":[
{"sig_name": "test_1", "type":"uint8_t"},
{"sig_name": "test_2", "type":"uint8_t"},
{"sig_name": "test_3", "type":"uint8_t"}
],
"msg_period":15,
"msg_hlp":1,
"msg_pgn":1040
}
],
"rx": [ ]
},
{
"node_name": "Acceleration",
"can_peripheral": "CAN1",
Expand Down
39 changes: 27 additions & 12 deletions common/daq/per_dbc.dbc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
VERSION ""


NS_ :
NS_ :
NS_DESC_
CM_
BA_DEF_
Expand Down Expand Up @@ -423,6 +423,15 @@ BO_ 688 LWS_Standard: 5 Steering
SG_ LWS_SPEED : 16|8@1+ (4,0) [0|0] "deg/s" Vector__XXX
SG_ LWS_ANGLE : 0|16@1- (0.1,0) [0|0] "deg" Vector__XXX

BO_ 2214659103 pdu_test: 3 PDU
SG_ test_3 : 16|8@1+ (1,0) [0|0] "" Vector__XXX
SG_ test_2 : 8|8@1+ (1,0) [0|0] "" Vector__XXX
SG_ test_1 : 0|8@1+ (1,0) [0|0] "" Vector__XXX

BO_ 2148059999 fault_sync_pdu: 3 PDU
SG_ latched : 16|1@1+ (1,0) [0|0] "" Vector__XXX
SG_ idx : 0|16@1+ (1,0) [0|0] "" Vector__XXX

BO_ 372 Y_Accel: 8 Acceleration
SG_ Reserved_3 : 56|8@1+ (1,0) [0|0] "" Vector__XXX
SG_ Reserved_2 : 48|8@1+ (1,0) [0|0] "" Vector__XXX
Expand Down Expand Up @@ -797,7 +806,7 @@ BO_ 2147488308 adc_values: 5 TEST_NODE
BO_ 2347693088 car_state: 1 TEST_NODE
SG_ car_state : 0|8@1+ (1,0) [0|0] "" Vector__XXX

BO_ 2148060031 fault_sync_test_node: 3 TEST_NODE
BO_ 2148060095 fault_sync_test_node: 3 TEST_NODE
SG_ latched : 16|1@1+ (1,0) [0|0] "" Vector__XXX
SG_ idx : 0|16@1+ (1,0) [0|0] "" Vector__XXX

Expand Down Expand Up @@ -841,6 +850,7 @@ CM_ BU_ OrionBMS "";
CM_ BU_ torque_vector "";
CM_ BU_ Dashboard "";
CM_ BU_ Steering "";
CM_ BU_ PDU "";
CM_ BU_ Acceleration "";
CM_ BU_ bootloader "";
CM_ BU_ BMS_LV "";
Expand Down Expand Up @@ -899,11 +909,11 @@ CM_ SG_ 2415925569 LV5_I "";
CM_ SG_ 2415925569 LV24_I "";
CM_ BO_ 2415925633 "performance metrics of MCU";
CM_ SG_ 2415925633 can_tx_fails "Number of CAN transmit failures";
CM_ SG_ 2415925633 sched_error "PSCHED Error Flags (bit #)
0 - N/A
1 - no free task
2 - FG Miss
3 - BG Miss
CM_ SG_ 2415925633 sched_error "PSCHED Error Flags (bit #)
0 - N/A
1 - no free task
2 - FG Miss
3 - BG Miss
4 - Individual FG Miss";
CM_ SG_ 2415925633 background_use "Percent of the 1ms loop time used by background tasks";
CM_ SG_ 2415925633 foreground_use "Percent of the 1ms loop time used by foreground tasks";
Expand Down Expand Up @@ -1179,6 +1189,13 @@ CM_ SG_ 688 Cal "";
CM_ SG_ 688 Ok "";
CM_ SG_ 688 LWS_SPEED "";
CM_ SG_ 688 LWS_ANGLE "";
CM_ BO_ 2214659103 "periodic dashboard heartbeat";
CM_ SG_ 2214659103 test_3 "";
CM_ SG_ 2214659103 test_2 "";
CM_ SG_ 2214659103 test_1 "";
CM_ BO_ 2148059999 "Fault status message";
CM_ SG_ 2148059999 latched "";
CM_ SG_ 2148059999 idx "";
CM_ BO_ 372 "Y Acceleration Update";
CM_ SG_ 372 Reserved_3 "";
CM_ SG_ 372 Reserved_2 "";
Expand Down Expand Up @@ -1472,9 +1489,9 @@ CM_ SG_ 2147488308 pot2 "";
CM_ SG_ 2147488308 pot1 "";
CM_ BO_ 2347693088 "state of the car";
CM_ SG_ 2347693088 car_state "";
CM_ BO_ 2148060031 "Fault status message";
CM_ SG_ 2148060031 latched "";
CM_ SG_ 2148060031 idx "";
CM_ BO_ 2148060095 "Fault status message";
CM_ SG_ 2148060095 latched "";
CM_ SG_ 2148060095 idx "";
CM_ BO_ 2550136831 "daq response from node TEST_NODE";
CM_ SG_ 2550136831 daq_response "";
CM_ BO_ 2483028093 "test_msg desc";
Expand Down Expand Up @@ -1520,5 +1537,3 @@ SIG_VALTYPE_ 2214593731 P_c : 1;
SIG_VALTYPE_ 2348810751 left_speed : 1;
SIG_VALTYPE_ 2348810751 right_speed : 1;
SIG_VALTYPE_ 2483028349 test_sig5_3 : 1;


14 changes: 14 additions & 0 deletions common/faults/fault_config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
{
"$schema":"./fault_schema.json",
"modules": [
{
"node_name": "pdu",
"faults": [
{
"fault_name": "pdu_mcu_temp_high",
"max": 50,
"min": 0,
"priority": "warning",
"time_to_latch": 1000,
"time_to_unlatch": 2000,
"lcd_message": "HIGH PDU MCU TEMP"
}
]
},
{
"node_name": "main_module",
"faults": [
Expand Down
Loading

0 comments on commit 77d3c5c

Please sign in to comment.