-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Internal code review request #2
Changes from all commits
26e838b
0ae5be8
a73df58
d4df61e
dcc97d7
1fc4d72
2ba0b56
a7b3de4
289f420
616ec37
114d49e
5657f8a
1aad399
ff2fb90
dd7056b
1875e70
0a68f43
ea344c3
100a045
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Build RAPID-0 Boards | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
board: [rapid0_adcs, rapid0_cdh, rapid0_eps] | ||
steps: | ||
- name: Set up repository | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: false | ||
show-progress: false | ||
fetch-depth: 1 | ||
- name: Set up python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.x | ||
- name: Set up ports | ||
id: set-up-port | ||
uses: ./.github/actions/deps/ports | ||
with: | ||
board: ${{ matrix.board }} | ||
- name: Set up submodules | ||
id: set-up-submodules | ||
uses: ./.github/actions/deps/submodules | ||
with: | ||
action: cache | ||
version: true | ||
- name: Set up external | ||
uses: ./.github/actions/deps/external | ||
with: | ||
action: cache | ||
port: ${{ steps.set-up-port.outputs.port }} | ||
- name: Set up mpy-cross | ||
if: steps.set-up-submodules.outputs.frozen == 'True' | ||
uses: ./.github/actions/mpy_cross | ||
with: | ||
cp-version: ${{ steps.set-up-submodules.outputs.version }} | ||
download: false | ||
- name: Build boards | ||
run: make -j4 -C ports/atmel-samd BOARD=${{ matrix.board }} | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ matrix.board }} | ||
path: ports/atmel-samd/build-${{ matrix.board }}/firmware.* | ||
overwrite: true | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we want to merge our custom build scripts to main? we don't want to merge it to adafruit, and we aren't even using it anymore There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will remove in merge commit |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
if echo $PATH | grep "gcc-arm-none-eabi" >/dev/null; then | ||
true | ||
else | ||
export PATH=/Volumes/Circuit_Python_Case_Sensitive_Disk/bruinspace-circuitpython/gcc-arm-none-eabi-10-2020-q4-major/bin:$PATH | ||
fi | ||
|
||
cd ports/atmel-samd | ||
make --debug -j8 BOARD=rapid0_adcs | ||
make --debug -j8 BOARD=rapid0_cdh | ||
make --debug -j8 BOARD=rapid0_eps | ||
cd ../.. | ||
|
||
echo "Compilation complete! Press ^C to confirm and exit." | ||
|
||
while true; do | ||
afplay /System/Library/Sounds/Ping.aiff | ||
sleep 5s | ||
done |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (same comment as mac script, also should remove the "build-samd51-interpreter" and "build-samd51-interpreter-mac" scripts on main) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will remove in merge commit |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
if echo $PATH | grep "gcc-arm-none-eabi" >/dev/null | ||
then | ||
true | ||
else | ||
export PATH=/mnt/d/Files/Documents/School/UCLA/Organizations/BruinSpace/Rapid-CDH/gcc-arm-none-eabi-10-2020-q4-major/bin:$PATH | ||
fi | ||
cd ports/atmel-samd | ||
make --debug -j8 BOARD=rapid0_adcs | ||
make --debug -j8 BOARD=rapid0_cdh | ||
make --debug -j8 BOARD=rapid0_eps | ||
cd ../.. | ||
echo "Compilation complete! Press ^C to confirm and exit." | ||
while true; | ||
do | ||
paplay /usr/share/sounds/freedesktop/stereo/complete.oga | ||
sleep 5s | ||
done |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* This file is part of the MicroPython project, http://micropython.org/ | ||
* | ||
* The MIT License (MIT) | ||
* | ||
* Copyright (c) 2017 Scott Shawcroft for Adafruit Industries | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
*/ | ||
|
||
#include "supervisor/board.h" | ||
|
||
// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#define MICROPY_HW_BOARD_NAME "RAPID-0 ADCS" | ||
#define MICROPY_HW_MCU_NAME "samd51n20" | ||
|
||
#define CIRCUITPY_MCU_FAMILY samd51 | ||
|
||
// This is for Rev F which is green | ||
|
||
// #define MICROPY_HW_LED_TX (&pin_PA27) | ||
// #define MICROPY_HW_LED_RX (&pin_PB06) | ||
|
||
// #define MICROPY_HW_LED_STATUS (&pin_PA16) | ||
|
||
// #define MICROPY_HW_NEOPIXEL (&pin_PB22) | ||
|
||
#define BOARD_HAS_CRYSTAL 0 | ||
|
||
#define CAMERA_I2C_SCL (&pin_PB03) | ||
#define CAMERA_I2C_SDA (&pin_PB02) | ||
|
||
#define CAMERA_SPI_SCK (&pin_PA05) | ||
#define CAMERA_SPI_MISO (&pin_PA04) | ||
#define CAMERA_SPI_MOSI (&pin_PA07) | ||
#define CAMERA_SPI_CS (&pin_PA06) | ||
|
||
#define INTERSUBSYSTEM_SPI_SCK (&pin_PB17) | ||
#define INTERSUBSYSTEM_SPI_MISO (&pin_PA21) | ||
#define INTERSUBSYSTEM_SPI_MOSI (&pin_PB16) | ||
|
||
#define ADCS_SPI_CS (&pin_PA20) | ||
#define EPS_SPI_CS (&pin_PB00) | ||
#define PAYLOAD_SPI_CS (&pin_PB01) | ||
|
||
// #define DEFAULT_I2C_BUS_SCL (&pin_PB03) | ||
// #define DEFAULT_I2C_BUS_SDA (&pin_PB02) | ||
|
||
// #define DEFAULT_SPI_BUS_SCK (&pin_PA13) | ||
// #define DEFAULT_SPI_BUS_MOSI (&pin_PA12) | ||
// #define DEFAULT_SPI_BUS_MISO (&pin_PA14) | ||
|
||
// #define DEFAULT_UART_BUS_RX (&pin_PA23) | ||
// #define DEFAULT_UART_BUS_TX (&pin_PA22) | ||
|
||
// USB is always used internally so skip the pin objects for it. | ||
#define IGNORE_PIN_PA24 1 | ||
#define IGNORE_PIN_PA25 1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
USB_VID = 0x04D8 | ||
USB_PID = 0xE5B3 | ||
USB_PRODUCT = "RAPID-0" | ||
USB_MANUFACTURER = "Bruin Spacecraft Group" | ||
|
||
CHIP_VARIANT = SAMD51N20A | ||
CHIP_FAMILY = samd51 | ||
|
||
QSPI_FLASH_FILESYSTEM = 1 | ||
EXTERNAL_FLASH_DEVICES = "GD25Q16C" | ||
LONGINT_IMPL = MPZ | ||
|
||
CIRCUITPY__EVE = 1 | ||
CIRCUITPY_CANIO = 0 | ||
CIRCUITPY_FLOPPYIO = 0 | ||
CIRCUITPY_JPEGIO = 0 | ||
CIRCUITPY_SYNTHIO = 0 | ||
|
||
# We don't have room for the fonts for terminalio for certain languages, | ||
# so turn off terminalio, and if it's off and displayio is on, | ||
# force a clean build. | ||
# Note that we cannot test $(CIRCUITPY_DISPLAYIO) directly with an | ||
# ifeq, because it's not set yet. | ||
ifneq (,$(filter $(TRANSLATION),ja ko ru)) | ||
CIRCUITPY_TERMINALIO = 0 | ||
RELEASE_NEEDS_CLEAN_BUILD = $(CIRCUITPY_DISPLAYIO) | ||
endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#include "shared-bindings/board/__init__.h" | ||
|
||
// This mapping only includes functional names because pins broken | ||
// out on connectors are labeled with their MCU name available from | ||
// microcontroller.pin. | ||
STATIC const mp_rom_map_elem_t board_module_globals_table[] = { | ||
CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS | ||
|
||
{ MP_OBJ_NEW_QSTR(MP_QSTR_CAMERA_I2C_SCL), MP_ROM_PTR(&pin_PB03) }, | ||
{ MP_OBJ_NEW_QSTR(MP_QSTR_CAMERA_I2C_SDA), MP_ROM_PTR(&pin_PB02) }, | ||
|
||
{ MP_OBJ_NEW_QSTR(MP_QSTR_CAMERA_SPI_SCK), MP_ROM_PTR(&pin_PA05) }, | ||
{ MP_OBJ_NEW_QSTR(MP_QSTR_CAMERA_SPI_MISO), MP_ROM_PTR(&pin_PA04) }, | ||
{ MP_OBJ_NEW_QSTR(MP_QSTR_CAMERA_SPI_MOSI), MP_ROM_PTR(&pin_PA07) }, | ||
{ MP_OBJ_NEW_QSTR(MP_QSTR_CAMERA_SPI_CS), MP_ROM_PTR(&pin_PA06) }, | ||
|
||
{ MP_OBJ_NEW_QSTR(MP_QSTR_INTERSUBSYSTEM_SPI_SCK), MP_ROM_PTR(&pin_PB17) }, | ||
{ MP_OBJ_NEW_QSTR(MP_QSTR_INTERSUBSYSTEM_SPI_MISO), MP_ROM_PTR(&pin_PA21) }, | ||
{ MP_OBJ_NEW_QSTR(MP_QSTR_INTERSUBSYSTEM_SPI_MOSI), MP_ROM_PTR(&pin_PB16) }, | ||
|
||
{ MP_OBJ_NEW_QSTR(MP_QSTR_ADCS_SPI_CS), MP_ROM_PTR(&pin_PA20) }, | ||
{ MP_OBJ_NEW_QSTR(MP_QSTR_EPS_SPI_CS), MP_ROM_PTR(&pin_PB00) }, | ||
{ MP_OBJ_NEW_QSTR(MP_QSTR_PAYLOAD_SPI_CS), MP_ROM_PTR(&pin_PB01) }, | ||
|
||
// { MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, | ||
// { MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA05) }, | ||
// { MP_OBJ_NEW_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA06) }, | ||
// { MP_OBJ_NEW_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA04) }, | ||
// { MP_OBJ_NEW_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PB08) }, | ||
// { MP_OBJ_NEW_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PB09) }, | ||
|
||
// { MP_OBJ_NEW_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA23) }, | ||
// { MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA23) }, | ||
// { MP_OBJ_NEW_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA22) }, | ||
// { MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA22) }, | ||
// { MP_OBJ_NEW_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PB17) }, | ||
// { MP_OBJ_NEW_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PB16) }, | ||
// { MP_OBJ_NEW_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PB13) }, | ||
// { MP_OBJ_NEW_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PB14) }, | ||
// { MP_OBJ_NEW_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PB15) }, | ||
// { MP_OBJ_NEW_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PB12) }, | ||
// { MP_OBJ_NEW_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA21) }, | ||
// { MP_OBJ_NEW_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA20) }, | ||
// { MP_OBJ_NEW_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA18) }, | ||
// { MP_OBJ_NEW_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA19) }, | ||
// { MP_OBJ_NEW_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA17) }, | ||
|
||
// { MP_OBJ_NEW_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PA16) }, | ||
// { MP_OBJ_NEW_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA16) }, | ||
|
||
// { MP_OBJ_NEW_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB02) }, | ||
// { MP_OBJ_NEW_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB03) }, | ||
|
||
// { MP_OBJ_NEW_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PB22) }, | ||
|
||
// { MP_OBJ_NEW_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA13) }, | ||
// { MP_OBJ_NEW_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA12) }, | ||
// { MP_OBJ_NEW_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA14) }, | ||
|
||
// { MP_OBJ_NEW_QSTR(MP_QSTR_LED_RX), MP_ROM_PTR(&pin_PB06) }, | ||
// { MP_OBJ_NEW_QSTR(MP_QSTR_LED_TX), MP_ROM_PTR(&pin_PA27) }, | ||
// { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, | ||
// { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, | ||
// { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, | ||
}; | ||
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* This file is part of the MicroPython project, http://micropython.org/ | ||
* | ||
* The MIT License (MIT) | ||
* | ||
* Copyright (c) 2017 Scott Shawcroft for Adafruit Industries | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
*/ | ||
|
||
#include "supervisor/board.h" | ||
|
||
// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't want this to be merged to main
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will remove in merge commit