Skip to content

Implementing CCU Fixes#437

Open
amysaffer wants to merge 86 commits intomainfrom
CCU_Fixes
Open

Implementing CCU Fixes#437
amysaffer wants to merge 86 commits intomainfrom
CCU_Fixes

Conversation

@amysaffer
Copy link
Copy Markdown
Contributor

@amysaffer amysaffer commented Apr 21, 2026

Various CCU Fixes

Problem and Scope

Fixing the issues identified with the CCU during the rules review meeting.

Description

GR Code Review Fixes:

New Changes Added

  • PRECHARGE_SET_TS_ACTIVE_FLAG removed entirely
  • SendPrechargeStatus(true) called directly on recv_charge_cmd, which is then cleared
  • Periodic SendPrechargeStatus(false) added in IDLE using millis_since_boot
  • recv_stop_cmd added as explicit exit condition in CHARGING, replacing !recv_charge_cmd
  • IR_Check() replaced with direct BCU_S2_IR_MINUS && BCU_S2_IR_PLUS flag checks
  • Stop command now checked before critical error in CHARGING
  • SetSoftwareLatch is now TripSoftwareLatch
  • VCP OneLiner
  • Impossible IR state added to CriticalErrors()
  • Implemented new HOOTL Tests

CANdler.c

  • Turn switch into if-not statement
  • Dont log "message received"
  • Rename CANDler.c to CANdler.c

StateData.h:

  • Delete the 5 uint8 variables
  • Rename BCU_Precharge_Set_TS_Active to CCU_Precharge
  • Rename BCU_S2_SoftwareLatch to SoftwareLatch
  • Need to stop charging after IR+- flags, set up in statedata
  • Only keep one can_cfg.h

StateTicks.c

  • Line 44: delete semicolon
  • For state_idle func, set second if statement to else if
  • Line 72: change to else if
  • Rate Limiting on CAN msg

StateUtils.c

  • Rewrite setSoftwareLatch because we dont need if statement
  • Move volatile request_print_statedata to StateData.h
  • extern variable should be volatile

gpio.c

  • Keep only pins we use (keep LED_Test) and delete rest

stm32g4xx_it.c

  • Check with Aagrim if extern variables needed

Other

  • Delete fixme

Testing

  • HOOTL testing
  • HITL testing
  • Human tested

Testing Details

@dchansen06 dchansen06 marked this pull request as draft April 21, 2026 03:11
@dchansen06 dchansen06 added this to the GR26 milestone Apr 23, 2026
@dchansen06 dchansen06 added Enhancement New feature or request 2 PRIORITY Important and a priority, but less than URGENT Boards Related to or involving any physical boards Bug Something is doing a thing but doing it wrong or otherwise incorrectly labels Apr 23, 2026
dwilson765 and others added 18 commits May 1, 2026 02:11
… byte / `unsigned char` / `uint8_t` value since actual characters are being handled

Signed-off-by: Daniel Hansen <dchansen06@gmail.com>
# DBC Identifier Fix

## Problem and Scope
DBC message identifiers are incorrect

## Description
Cause by an incorrect bit shifting (`16` instead of `20`) for the sender
node ID

## Gotchas and Limitations
May be a larger problem but probably not

## Testing

- [x] HOOTL testing
- [ ] HITL testing
- [x] Human tested

### Testing Details
Select DBC message identifier fields are correct

## Larger Impact
LV testing

## Additional Context and Ticket
Found by @an0tv

---------

Signed-off-by: Daniel Hansen <dchansen06@gmail.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
# `DELETE FROM Boards WHERE name = "DashPanel"`

## Problem and Scope
GR26 Dash Panel is now based on the GR24 Arduino-based dash panel,
involving no STM32 code

## Description
Soft remove dash panel with comments and fatal error warning message

## Gotchas and Limitations
Can be added back trivially, but underlying CAN has changed around it so
it should be deleted eventually

## Testing

- [x] HOOTL testing
- [ ] HITL testing
- [x] Human tested

### Testing Details
Does not build `DashPanel` on `make all`

## Larger Impact
Allows moving CAN forward without compile errors

## Additional Context and Ticket
Replaced by [`GR24_Dash_Panel` ->
`GR26_DASH`](https://github.com/Gaucho-Racing/GR24_Dash_Panel/tree/main/GR26_DASH)

---------

Signed-off-by: Daniel Hansen <dchansen06@gmail.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
# CAN Filter Fix

## Problem and Scope
Setup for simple non-extended ID with basic filter

## Description
Replaced with two extended ID filters on `GRCAN_ALL` and `GRCAN_(E|C)CU`

## Gotchas and Limitations
Needs testing of course, getting it into `LV-test` will be helpful

## Testing

- [x] HOOTL testing
- [ ] HITL testing
- [ ] Human tested

### Testing Details
Hardware tests pending

## Larger Impact
Less interrupts for things we do not care about (but honestly these
nodes get most things anyway)

## Additional Context and Ticket
Found while investigating #350

---------

Signed-off-by: Daniel Hansen <dchansen06@gmail.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
@dwilson765 dwilson765 marked this pull request as ready for review May 5, 2026 05:36
Copy link
Copy Markdown
Contributor

@dchansen06 dchansen06 left a comment

Choose a reason for hiding this comment

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

Looking solid, small tweaks

Comment thread CCU/Test/Src/StateUtilsTests.c
Comment thread CCU/Test/Src/StateUtilsTests.c Outdated
Comment thread CCU/Application/Src/CANdler.c Outdated
Comment on lines 41 to 45
// FIXME: Might need to double check we are doing this v
// cast *data to whatever msg dti control 10 struct there is
// copy data from that struct into the ccu state data struct (eg GETBIT)

// What the rewrite would look like: STATUS 2
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment no longer needed

Comment thread CCU/Application/Src/StateTicks.c
Comment thread CCU/Application/Src/StateUtils.c Outdated
@dchansen06 dchansen06 marked this pull request as draft May 5, 2026 15:29
@dwilson765 dwilson765 marked this pull request as ready for review May 8, 2026 04:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2 PRIORITY Important and a priority, but less than URGENT Boards Related to or involving any physical boards Bug Something is doing a thing but doing it wrong or otherwise incorrectly Enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants