-
-
Notifications
You must be signed in to change notification settings - Fork 53
Add support for BigTreeTech EBB SB 2209 USB v1.0 (rp2040). #80
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
Open
eltoozero
wants to merge
6
commits into
Rat-OS:development
Choose a base branch
from
eltoozero:development
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
965a8b0
Add support for BigTreeTech EBB SB 2209 USB v1.0 (rp2040).
f54ed10
Make board names more consistent.
d2d750e
Corrected MCU directive in flash.sh.
eltoozero 46ca40f
More small fix suggestions from the bot in board-definition.json and …
eltoozero d788bce
Removing adxl345_cs_pin reference in toolboard-config.cfg causes erro…
eltoozero 9cb6c97
Add pullup resistor settings to json.
eltoozero File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
configuration/boards/btt-sb-2209-usb-10-rp2040/98-btt-sb-2209-usb-10-rp.rules
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # BTT SB2209 USB V1.0 RP2040 | ||
| SUBSYSTEMS=="usb", ATTRS{idProduct}=="614e", ATTRS{idVendor}=="1d50", ATTRS{serial}=="btt-sb-2209-usb-10-rp", ACTION=="add", SYMLINK+="btt-sb-2209-usb-10-rp", RUN+="/home/pi/printer_data/config/RatOS/scripts/klipper-mcu-added.sh" | ||
|
|
45 changes: 45 additions & 0 deletions
45
configuration/boards/btt-sb-2209-usb-10-rp2040/board-definition.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| { | ||
| "$schema": "../board-definition.schema.json", | ||
| "manualFileName": "manual.pdf", | ||
| "boardImageFileName": "board.png", | ||
| "isToolboard": true, | ||
| "name": "SB2209 USB v1.0 RP2040", | ||
| "manufacturer": "BIGTREETECH", | ||
| "id": "btt-sb-2209-usb-10-rp", | ||
| "firmwareBinaryName": "firmware-btt-sb-2209-usb-10-rp.uf2", | ||
| "compileScript": "compile.sh", | ||
| "flashScript": "flash.sh", | ||
| "documentationLink": "https://os.ratrig.com/docs/boards/btt/sb-2209-usb-10", | ||
| "fourPinFanConnectorCount": 1, | ||
| "driverVoltages": [24], | ||
| "hasMcuTempSensor": true, | ||
| "outputPins": [ | ||
| { | ||
| "name": "part_fan_power", | ||
| "pin": "gpio14", | ||
| "value": 0 | ||
| } | ||
| ], | ||
| "driverCount": 1, | ||
| "integratedDrivers": { | ||
| "extruder": "BTT-TMC2209-13" | ||
| }, | ||
| "dfu": { | ||
| "flashDevice": "2e8a:0003", | ||
| "dfuBootImage": "dfubooting.png", | ||
| "instructions": [ | ||
| "Connect the toolboard via EBB USB Adapter to the Raspberry Pi.", | ||
| "Verify the green LED is lit indicating the toolboard is powered.", | ||
| "Press and hold the BOOT button on the toolboard.", | ||
| "Press and release the RESET button on the toolboard.", | ||
| "Release the BOOT button." | ||
| ], | ||
| "hasBoot0Jumper": false | ||
| }, | ||
| "LIS2DW": { | ||
| "cs_pin": "gpio1", | ||
| "hardware": { | ||
| "bus": "spi0a" | ||
| } | ||
| } | ||
| } |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| #!/bin/bash | ||
| if [ "$EUID" -ne 0 ] | ||
| then echo "ERROR: Please run as root" | ||
| exit | ||
| fi | ||
| cp -f /home/pi/printer_data/config/RatOS/boards/btt-sb-2209-usb-10-rp2040/firmware.config /home/pi/klipper/.config | ||
| pushd /home/pi/klipper || exit | ||
| make olddefconfig | ||
| make clean | ||
| make | ||
|
|
||
| if [ ! -d "/home/pi/printer_data/config/firmware_binaries" ] | ||
| then | ||
| mkdir /home/pi/printer_data/config/firmware_binaries | ||
| chown pi:pi /home/pi/printer_data/config/firmware_binaries | ||
| fi | ||
| cp -f /home/pi/klipper/out/klipper.uf2 /home/pi/printer_data/config/firmware_binaries/firmware-btt-sb-2209-usb-10-rp.uf2 | ||
| chown pi:pi /home/pi/printer_data/config/firmware_binaries/firmware-btt-sb-2209-usb-10-rp.uf2 | ||
| popd || exit | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
78 changes: 78 additions & 0 deletions
78
configuration/boards/btt-sb-2209-usb-10-rp2040/firmware.config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| CONFIG_LOW_LEVEL_OPTIONS=y | ||
| # CONFIG_MACH_AVR is not set | ||
| # CONFIG_MACH_ATSAM is not set | ||
| # CONFIG_MACH_ATSAMD is not set | ||
| # CONFIG_MACH_LPC176X is not set | ||
| # CONFIG_MACH_STM32 is not set | ||
| # CONFIG_MACH_HC32F460 is not set | ||
| CONFIG_MACH_RPXXXX=y | ||
| # CONFIG_MACH_PRU is not set | ||
| # CONFIG_MACH_AR100 is not set | ||
| # CONFIG_MACH_LINUX is not set | ||
| # CONFIG_MACH_SIMU is not set | ||
| CONFIG_BOARD_DIRECTORY="rp2040" | ||
| CONFIG_MCU="rp2040" | ||
| CONFIG_CLOCK_FREQ=12000000 | ||
| CONFIG_USBSERIAL=y | ||
| CONFIG_FLASH_SIZE=0x200000 | ||
| CONFIG_FLASH_BOOT_ADDRESS=0x10000100 | ||
| CONFIG_RAM_START=0x20000000 | ||
| CONFIG_RAM_SIZE=0x42000 | ||
| CONFIG_STACK_SIZE=512 | ||
| CONFIG_FLASH_APPLICATION_ADDRESS=0x10000100 | ||
| CONFIG_RPXXXX_SELECT=y | ||
| CONFIG_MACH_RP2040=y | ||
| # CONFIG_MACH_RP2350 is not set | ||
| CONFIG_RP2040_HAVE_STAGE2=y | ||
| CONFIG_RPXXXX_FLASH_START_0100=y | ||
| # CONFIG_RPXXXX_FLASH_START_4000 is not set | ||
| CONFIG_RP2040_FLASH_W25Q080=y | ||
| # CONFIG_RP2040_FLASH_GENERIC_03 is not set | ||
| CONFIG_RP2040_STAGE2_FILE="boot2_w25q080.S" | ||
| CONFIG_RP2040_STAGE2_CLKDIV=2 | ||
| CONFIG_RPXXXX_USB=y | ||
| # CONFIG_RPXXXX_SERIAL_UART0_PINS_0_1 is not set | ||
| # CONFIG_RPXXXX_SERIAL_UART0_PINS_12_13 is not set | ||
| # CONFIG_RPXXXX_SERIAL_UART0_PINS_16_17 is not set | ||
| # CONFIG_RPXXXX_SERIAL_UART0_PINS_28_29 is not set | ||
| # CONFIG_RPXXXX_SERIAL_UART1_PINS_4_5 is not set | ||
| # CONFIG_RPXXXX_SERIAL_UART1_PINS_8_9 is not set | ||
| # CONFIG_RPXXXX_SERIAL_UART1_PINS_20_21 is not set | ||
| # CONFIG_RPXXXX_SERIAL_UART1_PINS_24_25 is not set | ||
| # CONFIG_RPXXXX_CANBUS is not set | ||
| # CONFIG_RPXXXX_USBCANBUS is not set | ||
| # CONFIG_RPXXXX_CANBUS_GPIO_RX=4 | ||
| # CONFIG_RPXXXX_CANBUS_GPIO_TX=5 | ||
| CONFIG_USB=y | ||
| CONFIG_USB_VENDOR_ID=0x1d50 | ||
| CONFIG_USB_DEVICE_ID=0x614e | ||
| # CONFIG_USB_SERIAL_NUMBER_CHIPID is not set | ||
| CONFIG_USB_SERIAL_NUMBER="btt-sb-2209-usb-10-rp" | ||
|
|
||
| # | ||
| # USB ids | ||
| # | ||
| # end of USB ids | ||
|
|
||
| CONFIG_WANT_GPIO_BITBANGING=y | ||
| CONFIG_WANT_DISPLAYS=y | ||
| CONFIG_WANT_SENSORS=y | ||
| CONFIG_WANT_LIS2DW=y | ||
| CONFIG_WANT_LDC1612=n | ||
| CONFIG_WANT_HX71X=n | ||
| CONFIG_WANT_ADS1220=n | ||
| CONFIG_WANT_SOFTWARE_I2C=y | ||
| CONFIG_WANT_SOFTWARE_SPI=y | ||
| CONFIG_NEED_SENSOR_BULK=y | ||
| # CONFIG_CANBUS_FREQUENCY=1000000 | ||
| CONFIG_INITIAL_PINS="" | ||
| CONFIG_HAVE_GPIO=y | ||
| CONFIG_HAVE_GPIO_ADC=y | ||
| CONFIG_HAVE_GPIO_SPI=y | ||
| CONFIG_HAVE_GPIO_I2C=y | ||
| CONFIG_HAVE_GPIO_HARD_PWM=y | ||
| CONFIG_HAVE_STRICT_TIMING=y | ||
| CONFIG_HAVE_CHIPID=y | ||
| CONFIG_HAVE_STEPPER_BOTH_EDGE=y | ||
| CONFIG_HAVE_BOOTLOADER_REQUEST=y | ||
| CONFIG_INLINE_STEPPER_HACK=y |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| #!/bin/bash | ||
| MCU=/dev/btt-sb-2209-usb-10-rp | ||
| if [ "$EUID" -ne 0 ] | ||
| then echo "ERROR: Please run as root" | ||
| exit | ||
| fi | ||
| SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
| FLASH_SCRIPT=$(realpath "$SCRIPT_DIR/../../scripts/flash-path.sh") | ||
| $FLASH_SCRIPT $MCU |
11 changes: 11 additions & 0 deletions
11
configuration/boards/btt-sb-2209-usb-10-rp2040/make-and-flash-mcu.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| #!/bin/bash | ||
|
|
||
| if [ "$EUID" -ne 0 ] | ||
| then echo "ERROR: Please run as root" | ||
| exit | ||
| fi | ||
|
|
||
| SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
|
|
||
| "$SCRIPT_DIR"/compile.sh | ||
| "$SCRIPT_DIR"/flash.sh |
Binary file not shown.
40 changes: 40 additions & 0 deletions
40
configuration/boards/btt-sb-2209-usb-10-rp2040/toolboard-config.cfg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| # WARNING. DO NOT EDIT THIS FILE. | ||
| # To override settings from this file, you can copy and paste the relevant | ||
| # sections into your printer.cfg and change it there. | ||
| # WARNING: it is NOT recommended to override board_pins aliases, | ||
| # use the boards pin names directly in your printer.cfg instead. | ||
| # Look up the pins you need in the boards pinout diagram. | ||
|
|
||
| [board_pins btt-sb-2209-usb-10-rp] | ||
| mcu: toolboard | ||
| aliases: | ||
| x_endstop_pin=gpio13, | ||
| e_step_pin=gpio18, e_dir_pin=gpio19, e_enable_pin=gpio17, e_uart_pin=gpio20, e_diag_pin=null, e_heater_pin=gpio7, e_sensor_pin=gpio26, | ||
| thermocouple_cs=gpio9, thermocouple_miso=gpio11, thermocouple_mosi=gpio8, thermocouple_clk=gpio10, | ||
| # accel | ||
| lis2dw_cs_pin=gpio1, lis2dw_miso=gpio3, lis2dw_mosi=gpio0, lis2dw_clk=gpio2, | ||
| # leveling | ||
| bltouch_sensor_pin=gpio21, bltouch_control_pin=gpio22, | ||
| probe_pin=gpio21, #PB9 to PB5 Tap | ||
| # fans | ||
| fan_part_cooling_pin=gpio13, | ||
| fan_toolhead_cooling_pin=gpio14 | ||
| # 4 pin fans | ||
| 4p_fan_part_cooling_pin=gpio15, | ||
| 4p_fan_part_cooling_tach_pin=gpio12, | ||
| # toolboard temp | ||
| temperature_tb=gpio27 | ||
|
|
||
| [mcu toolboard] | ||
| serial: /dev/btt-sb-2209-usb-10-rp | ||
|
|
||
| [temperature_sensor toolboard] | ||
| sensor_type: Generic 3950 | ||
| #sensor_pin: EBB:gpio27 | ||
| sensor_pin: temperature_tb | ||
|
|
||
| [lis2dw toolboard] | ||
| cs_pin: toolboard: lis2dw_cs_pin | ||
| spi_software_sclk_pin: lis2dw_clk | ||
| spi_software_mosi_pin: lis2dw_mosi | ||
| spi_software_miso_pin: lis2dw_miso |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
🛠️ Refactor suggestion
Avoid absolute
/home/pipaths—use script locationHard-coding
/home/pi/...prevents reuse. Instead derive the repo root fromSCRIPT_DIRand reference relative paths:Optionally, expose
KLIPPER_DIRandCONFIG_DIRas environment variables for flexibility.📝 Committable suggestion
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.
@miklschmidt I thought removing the reliance on /home/pi was planned for another major refactoring, I'm just going off status-quo "templates". Should I make this edit?
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.