Skip to content

Commit

Permalink
Merge branch 'main' into feature/fault-timer-CAN
Browse files Browse the repository at this point in the history
  • Loading branch information
jr1221 authored Jan 5, 2025
2 parents b597d7b + f1fb165 commit 31c14bf
Show file tree
Hide file tree
Showing 20 changed files with 21,294 additions and 529 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/build_calypso.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Check CAN, build Calypso
on:
push:
paths:
- 'cangen/**'

jobs:
run-build:
runs-on: ubuntu-latest
steps:
- name: Clone Calypso
uses: actions/checkout@v4
with:
repository: Northeastern-Electric-Racing/Calypso

- name: Clone Embedded-base
uses: actions/checkout@v4
with:
path: "./Embedded-Base"

- name: Build Calypso
run: cargo build --locked
39 changes: 14 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,22 @@
# Embedded-Base
Embedded-Base is a collection of drivers & middleware designed for use across various systems.
Embedded-Base is a collection of drivers, middlewares, and communication definitions designed for use across various systems.

This repository houses custom drivers and middleware that can be utilized in multiple projects.
Most firmware projects define Embedded-Base as a submodule.

To use this repository in any project, it should be set up as a submodule.
## Getting Started With NER Firmware

## Getting Started
All you need is on confluence [here](https://nerdocs.atlassian.net/wiki/spaces/NER/pages/1343533/Firmware+Onboarding+Embedded+Software#Development-Environment-Setup).

#### 1. Clone Embbeded-Base:
~~~
git clone https://github.com/Northeastern-Electric-Racing/Embedded-Base.git
~~~
### Notable items in this repository

#### 2. Initialize submodule
Within the application directory, run the following command to initialize the submodule:
~~~
git submodule update --init
~~~

## Development Guidelines

When developing in the parent directory, it's recommended to frequently run the following command to update all submodules in case changes have been made:
~~~
git submodule update --remote
~~~


**When making changes to a driver located within Embedded-Base, always make those changes directly within the Embedded-Base repository. Avoid making changes to a submodule from the parent directory.** Although it's technically possible, doing so can lead to disorganization, which we want to avoid.

This approach ensures that changes to Embedded-Base are tracked properly and can be easily integrated into your projects using it as a submodule.
- `cangen`: All JSON definitions of in-car CAN data as well as documentation and parsing utilities.
- `dev`: The manual version of the NER build system, compatible up circuit boards in competition 22A
- `ner_environment`: The NER developer environment compatible with all boards from 22A onwards and cross platform support.
- `general`: Cross-platform C source files for all peripheral drivers used by NER.
- `middleware`: Cross-platform C source files common utilities used across various platforms.
- `platforms`: C source files specific to STM HAL versions.
- `clang-format`: The organization wide clang-format definition.
- `ftdi_flash.cfg`: An openocd script to assist in FTDI flashing.
- `openocd.cfg`: A openocd stub to load GDB onto a target.


3 changes: 2 additions & 1 deletion cangen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,9 @@ Within the `points` member of a NetField object, there is a list of Point object
- `size`, an integer representing the size to be read in bits
- `signed` (optional), boolean representing whether or not the number is signed in two's complement form (`false` by default)
- `endianness` (optional), string representing the byte endianness of the bits being read, either `"big"` or `"little"` (`"big"` by default)
- `format` (optional, not recommended), string representing the final type of the data (`"f32"` by default)
- `format` (optional), string representing the format of the bits (e.g. `divide100`) (blank by default)
- `default_value` (optional, only for Encodable Messages), float representing the default value to be sent before a command is received or when an empty command is received. This is ignored when decoding the Point (`0` by default)
- `ieee754_f32` (optional), boolean indicating if the bits in the Point should be interpreted as an IEEE754 32-bit float. **Be sure to endian swap the float before sending!!** (`false` by default)

#### Sim
Within the `sim` member of a NetField object, there is a single sim object. This object is one of two types, either `sweep` or `enum`. However these types are implied, not written in the JSON, just use them correctly!
Expand Down
114 changes: 112 additions & 2 deletions cangen/can-messages/bms.json
Original file line number Diff line number Diff line change
Expand Up @@ -1061,5 +1061,115 @@
]
}
]
}
]
},
{
"id": "0x69A",
"desc": "Shepherd Version Tag",
"sim_freq": 1000,
"fields": [
{
"name": "BMS/Version/Tag",
"unit": "major.minor.patch",
"sim": {
"min": 0,
"max": 3,
"inc_min": 1,
"inc_max": 1,
"round": true
},
"points": [
{
"size": 8
},
{
"size": 8
},
{
"size": 8
}
]
},
{
"name": "BMS/Version/Dirty",
"unit": "bool",
"sim": {
"options": [
[
0,
0.95
],
[
1,
0.05
]
]
},
"points": [
{
"size": 8
}
]
},
{
"name": "BMS/Version/LocalCommit",
"unit": "bool",
"sim": {
"options": [
[
0,
0.95
],
[
1,
0.05
]
]
},
"points": [
{
"size": 8
}
]
}
]
},
{
"id": "0x69B",
"desc": "Shepherd Version Hash",
"sim_freq": 1000,
"fields": [
{
"name": "BMS/Version/ShortHash",
"unit": "hash",
"sim": {
"min": 0,
"max": 4294967295,
"inc_min": 1,
"inc_max": 1,
"round": true
},
"points": [
{
"size": 32
}
]
},
{
"name": "BMS/Version/AuthorHash",
"unit": "hash",
"sim": {
"min": 0,
"max": 4294967295,
"inc_min": 1,
"inc_max": 1,
"round": true
},
"points": [
{
"size": 32
}
]
}
]
}
]
4 changes: 2 additions & 2 deletions cangen/can-messages/charger.json
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,10 @@
"send": false,
"points": [
{
"size": 24
"size": 27
}
]
}
]
}
]
]
Loading

0 comments on commit 31c14bf

Please sign in to comment.