Skip to content

Dash Panel - 4 Extra Buttons + IRQ Changes#402

Draft
horizon-ab wants to merge 24 commits intomainfrom
CleanUpDashPanel
Draft

Dash Panel - 4 Extra Buttons + IRQ Changes#402
horizon-ab wants to merge 24 commits intomainfrom
CleanUpDashPanel

Conversation

@horizon-ab
Copy link
Copy Markdown
Contributor

@horizon-ab horizon-ab commented Apr 7, 2026

Dash Panel - 4 Extra Buttons + IRQ Changes

Problem and Scope

  • 4 Extra Buttons are configured to trigger interrupts and send flags to the ECU in the DashPanel CAN message
  • Apparently the G474 doesn't have individual interrupt handlers for EXTI 5-7, so we had to wrap them in EXTI9_5

Description

  • 4 Extra Buttons are configured for pins PA5, PA6, PA7, PC4. Since PC4 and PA4 share the same EXTI line, there is additional code to check which pin actually triggered the interrupt
  • The 3 IRQ handlers for EXTI 5-7 is now just 1 IRQ Handler for EXTI9_5 which essentially comprises of the bodies of the 3 individual IRQs

Gotchas and Limitations

Testing

  • HOOTL testing
  • HITL testing
  • Human tested

Testing Details

Not tested btw, but it does build

Larger Impact

Should be the last big addition to Dash Panel unless something else comes up.

Additional Context and Ticket

None

dchansen06 and others added 20 commits March 28, 2026 03:41
Signed-off-by: Daniel Hansen <dchansen06@gmail.com>
Signed-off-by: Daniel Hansen <dchansen06@gmail.com>
Signed-off-by: Daniel Hansen <dchansen06@gmail.com>
Co-authored-by: David Uzunov <DavidUzunov@users.noreply.github.com>
# <Feature Name>

## Problem and Scope


## Description
Added the "?" functionality to vcp so it LOGMATIC's out the state data.

## Gotchas and Limitations


## Testing

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

### Testing Details


## Larger Impact


## Additional Context and Ticket

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Daniel Hansen <105574022+dchansen06@users.noreply.github.com>
# Make ADC implementation memory safe

## Problem and Scope
Remove dynamic memory allocation and unneeded memory allocation

## Description
Initial ADC implementation was allocating memory dynamically which
could've lead to runtime errors. Removing unused array and, by
association, unsafe memory allocation

## Gotchas and Limitations


## Testing

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

### Testing Details


## Larger Impact


## Additional Context and Ticket

---------

Co-authored-by: Daniel Hansen <105574022+dchansen06@users.noreply.github.com>
# ECU Numeric Type Change

## Problem and Scope
Change incorrect numeric types to correct ones for ECU (floats, ints)

## Description


## Gotchas and Limitations


## Testing

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

### Testing Details


## Larger Impact


## Additional Context and Ticket

---------

Co-authored-by: Casey Zwicker <caseypzwicker@gmail.com>
Co-authored-by: Thomas Xu <thomasxu070224@gmail.com>
Co-authored-by: Daniel Hansen <105574022+dchansen06@users.noreply.github.com>
# CAN External Testing

## Problem and Scope

Testing that the CAN API works normally instead of in loopback mode. 

## Description

## Gotchas and Limitations

Was only able to test on CCU (Big Bird 25), by connecting CAN1 and CAN2
pins together. To test with multiple nodes, will need to verify that
these nodes have CAN transceivers and have proper termination.

## Testing

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

### Testing Details

Each can instance in CCU sent 5 messages. The test checked if the other
instance received all messages. The messages were extremely small, (only
1 byte).

## Larger Impact

## Additional Context and Ticket
[link to external
tests](https://github.com/Gaucho-Racing/Firmware/compare/can_external_testing?expand=1#diff-3706ffe622d45ef230c73318a1a14a4f1bade3cc8e1c9d4a4cb8a9437943ff87)

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
# FIXING GRCAN editor

## Problem and Scope
GRCAN editor is broken which makes it useless for modifying our format. 

## Description
Fixing GRCAN editor 

## Gotchas and Limitations


## Testing

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

### Testing Details
Had Claude run a bunch of unit tests it wrote and then manually ran 12
tests with deleting/adding nodes routes buses etc.


https://htmlpreview.github.io/?https://github.com/Gaucho-Racing/Firmware/blob/GRCANDO_editor_refinement/Web/index.html

## Larger Impact
Help other teams deal with CAN data. 

## Additional Context and Ticket

---------

Signed-off-by: Daniel Hansen <dchansen06@gmail.com>
Signed-off-by: Daniel Hansen <105574022+dchansen06@users.noreply.github.com>
Signed-off-by: coderask <62189577+coderask@users.noreply.github.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Daniel Hansen <105574022+dchansen06@users.noreply.github.com>
Co-authored-by: Daniel Hansen <dchansen06@gmail.com>
Co-authored-by: Caroline Mao <maoninii@gmail.com>
Co-authored-by: krai19 <kr9stride@gmail.com>
Co-authored-by: Nandini <nandinim.dharwadkar@gmail.com>
…0 in the actions-updates group (#396)

Bumps the actions-updates group with 1 update:
[yuzutech/annotations-action](https://github.com/yuzutech/annotations-action).

Updates `yuzutech/annotations-action` from 0.5.0 to 0.6.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/yuzutech/annotations-action/releases">yuzutech/annotations-action's
releases</a>.</em></p>
<blockquote>
<h2>v0.6.0</h2>
<h2>What's Changed</h2>
<ul>
<li>chore(deps): Bump dependencies by <a
href="https://github.com/ggrossetie"><code>@​ggrossetie</code></a> in <a
href="https://redirect.github.com/yuzutech/annotations-action/pull/71">yuzutech/annotations-action#71</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/yuzutech/annotations-action/compare/v0.5.0...v0.6.0">https://github.com/yuzutech/annotations-action/compare/v0.5.0...v0.6.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/yuzutech/annotations-action/commit/00b2d488bcba3bd01014dc073d276ef4a45d5c6c"><code>00b2d48</code></a>
chore(deps): Bump dependencies (<a
href="https://redirect.github.com/yuzutech/annotations-action/issues/71">#71</a>)</li>
<li>See full diff in <a
href="https://github.com/yuzutech/annotations-action/compare/0e061a6e3ac848299310b6429b60d67cafd4e7f8...00b2d488bcba3bd01014dc073d276ef4a45d5c6c">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=yuzutech/annotations-action&package-manager=github_actions&previous-version=0.5.0&new-version=0.6.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Migrate away from old CAN specification to new (auto-generated) one

Transitioning from `GR_OLD_CAN_MESSAGES` to `CANfigurator` interface
link library

Each group will work on migrating their own board on this PR to avoid
merge conflicts (separate from other boards), this can be done by having
a VS Code Live Share on this branch and only fixing code in their scope
and syncing often

Subject to change, this is first pass

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

Compilation and groups checking their projects

Migrating fully to URCA and new CAN implementation

Resolves #261

---------

Signed-off-by: Daniel Hansen <dchansen06@gmail.com>
Signed-off-by: Daniel Hansen <105574022+dchansen06@users.noreply.github.com>
Signed-off-by: coderask <62189577+coderask@users.noreply.github.com>
Signed-off-by: Bailey Say <baileyasay@gmail.com>
Co-authored-by: Aarnav Koushik <mailtomeask@gmail.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Caroline Mao <maoninii@gmail.com>
Co-authored-by: krai19 <kr9stride@gmail.com>
Co-authored-by: Nandini <nandinim.dharwadkar@gmail.com>
Co-authored-by: coderask <62189577+coderask@users.noreply.github.com>
Co-authored-by: Anthony Ma <anthony497@ucsb.edu>
Co-authored-by: David Uzunov <DavidUzunov@users.noreply.github.com>
Co-authored-by: captainwerty <harsha.werty25@gmail.com>
Co-authored-by: Bailey Say <baileyasay@gmail.com>
Co-authored-by: David Wilson <wilsondavid0611@gmail.com>
Co-authored-by: Thomas Xu <thomasxu070224@gmail.com>
Co-authored-by: kzwicker <kzwicker@users.noreply.github.com>
Co-authored-by: khoulihan27 <khoulihan27@users.noreply.github.com>
Co-authored-by: khoulihan27 <khoulihan@ucsb.edu>
# SPI Peripheral Abstraction

## Problem and Scope

This library abstracts the SPI protocol to use LL libraries and create
an extendable, easy-to-understand API that utilizes circular byte arrays
to queue SPI messages during intense workloads. The library is intended
to provide future support for all internal GR needs related to SPI
firmware.

## Description

This library establishes an easy interface to implement SPI in any GR
Project (that utilizes the STM32G4 board). Users simply have to define
SPI and pin configurations in their project and call
`GR_SPI_Initialize()`, which will return a `handler` that can be used to
send and receive data.

To use this library with CMake, one must link the library `SPI_Lib` as
an `INTERFACE` to their targets with `target_link_libraries()`.

How to use GR_SPI library:

1. Make GR_SPI_Handler and GR_SPI_Pins structs (1 of each, both designed
by GR Firmware)
2. Make a LL_SPI_InitTypeDef struct (requires non-GR LL API and library)
3. Populate the LL_SPI_InitTypeDef struct with values for:

• uint32_t TransferDirection
• uint32_t Mode (very important! - really the only thing you need to
change from example code)
• uint32_t DataWidth
• uint32_t ClockPolarity
• uint32_t ClockPhase
• uint32_t NSS (should always be LL_SPI_NSS_SOFT unless the GR_SPI
library is updated to support hardware control)
• uint32_t BaudRate (increase DIV# to decrease communication rate for
better stability)
• uint32_t BitOrder
• uint32_t CRCCalculation
• uint32_t CRCPoly

4. Set the GR_SPI_Pins struct values:

• SPI_TypeDef * SPIx
• GPIO_TypeDef ** GPIOx (this is an array of GPIOx pointers!)
• uint32_t pin_nums[4]
• uint32_t num_pins
• uint32_t alternate_function_number

5. Call GR_SPI_Initialize() with handle, config, and pins arguments.
This function sets the handle struct you created earlier with the values
in the config and enables all necessary hardware configuration and
clocks.
6. Make a GR_SPI_Message struct and populate the values:

• uint8_t * data (this is an array of bytes!)
• uint16_t size (this has a max size of GR_SPI_MAX_MSG_BYTE_SIZE)

7. Either call GR_SPI_Send(handle, msg) or
while(GR_SPI_IsRxEmpty(handle)) and GR_SPI_Receive(handle, msg). Note
that when you are receiving a message, make sure to check
GR_SPI_Get_RxMsgSize(handle) to get the size of the message on the top
of the RX buffer.
8. Make sure to call free() on any msg->data arrays you malloc'd.
9. Teardown the SPI connection via GR_SPI_Close(handle). This will free
any memory allocated within the handle struct, but it will NOT free the
handle struct you may have declared yourself. The LL_SPI_InitTypeDef
config and GR_SPI_Pins pins structs must also be freed manually if
necessary.

## Gotchas and Limitations

The GR_SPI library currently only supports a single controller and a
single peripheral P2P connection. The GR_SPI library initializes a
decently sized chunk of byte arrays on initialization
(GR_SPI_Initialize), but it does not cause any heap memory fragmentation
during message transaction (internally). You can still fragment heap
memory by constantly allocating and deallocating your own GR_SPI_Message
structs or their byte arrays (do not do that). The library's support for
slave mode pushes a new message on the rx circular buffer for every byte
received (it can't predict message length at the moment). This causes
the rx circular buffer to have an effective 50% usable capacity based on
internal implementation. Future updates should support rx message size
predictions (possibly by using timers or a configurable predefined
receive message size parameter).

## Testing

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

### Testing Details

Wrote unit tests (HOOTL) for MsgBuffer library. Conducted same-board
same-channel, same-board different-channel, and different-board
different-channel hardware tests involving master to self and master to
slave communication. Tested sending and receiving byte arrays of length
1 up to 64.

## Larger Impact

Future Plans:
1. Add support multiple boards (STM32U5, STM32L4)
2. Conduct robust race condition testing
3. Support more complex SPI features such as SIMPLEX RX only
4. Update the RX message buffer to utilize predictive message sizing on
unsoliticed messages (slave mode only)

## Additional Context and Ticket
Resolves #32

---------

Signed-off-by: Daniel Hansen <105574022+dchansen06@users.noreply.github.com>
Signed-off-by: Daniel Hansen <dchansen06@gmail.com>
Co-authored-by: Aaryan Rennie Srekumar <aaryan121@ucsb.edu>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Daniel Hansen <105574022+dchansen06@users.noreply.github.com>
Co-authored-by: Bailey Say <baileyasay@gmail.com>
Co-authored-by: ars-24 <ars-24@users.noreply.github.com>
Co-authored-by: Colin-Bickel <Colin-Bickel@users.noreply.github.com>
Co-authored-by: Daniel Hansen <dchansen06@gmail.com>
Co-authored-by: AniSaligrama <asaligrama@ucsb.edu>
Co-authored-by: Ani-8712 <asaligrama03@gmail.com>
Signed-off-by: Daniel Hansen <dchansen06@gmail.com>
Signed-off-by: Daniel Hansen <dchansen06@gmail.com>
Co-authored-by: David Uzunov <DavidUzunov@users.noreply.github.com>
@horizon-ab horizon-ab requested a review from dchansen06 as a code owner April 7, 2026 05:12
@dchansen06 dchansen06 added Enhancement New feature or request 2 PRIORITY Important and a priority, but less than URGENT Small Fry Something that is small, could include bug fixes or smaller changes Sensors Something involved with or related to sensors labels Apr 7, 2026
@dchansen06 dchansen06 added Peripheral Related to or involving a peripheral including abstractions Boards Related to or involving any physical boards labels Apr 7, 2026
@dchansen06 dchansen06 marked this pull request as draft April 7, 2026 06:33
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 Enhancement New feature or request Peripheral Related to or involving a peripheral including abstractions Sensors Something involved with or related to sensors Small Fry Something that is small, could include bug fixes or smaller changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants