# CB1
**Repository Path**: playnb_clone/cb1
## Basic Information
- **Project Name**: CB1
- **Description**: clone from: https://github.com/bigtreetech/CB1
- **Primary Language**: Unknown
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2025-01-18
- **Last Updated**: 2025-01-18
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# SSH (V3.0.0)
## `Klipper` version of the system
Ordinary account:
login as: biqu
password: biqu
Administrator account:
login as: root
password: root
## `minimal` version of the system
This system is a standard Armbian startup process. It only has the administrator account `root`. After the first boot, the system will guide the user to create their own ordinary account in the terminal.
Administrator account:
login as: root
password: root
# OS image
* The latest system image is [here](https://github.com/bigtreetech/CB1/releases)
* The source code is [here](https://github.com/bigtreetech/build/tree/bpi-main)
# V3.0.0 OS Setting
## System Settings
* After the OS writes to the SD card, there is a FAT32 partition named `BOOT`, open `system.cfg` file with `Notpad` or `VSCode`.


*
```
check_interval=5
eth=end0
wlan=wlan0
```
The script automatically connects to the WiFi parameters required, do not modify it
*
```
hostname="BIGTREETECH-CB1"
```
Uncomment to set the hostname of the device. The default is `BIGTREETECH-CB1`.
*
```
ks_src="HDMI-1"
ks_angle="normal"
```
Uncomment to set the parameters for KlipeprScreen display rotation, `ks_src` is the screen type, `ks_angle` is the rotation angle (if the screen is `TFT35`, you need to set `param_tft35_spi_rotate` in `armbianEnv.txt` additionally)
*
```
WIFI_SSID="Your SSID"
WIFI_PASSWD="Your Password"
```
Uncomment to set the WiFi parameters. Set `WIFI_SSID` as your actual wifi name and `WIFI_PASSWD` as your actual wifi password, The space character can be parsed normally without additional escape character.
For example: `WIFI_SSID="CB1 Tester"`
*
```
BTT_PAD7="OFF"
TOUCH_VIBRATION="OFF"
TOUCH_SOUND="OFF"
AUTO_BRIGHTNESS="OFF"
```
The feature of BIGTREETECH Pad7. All of these functions require the corresponding `overlay` to be enabled in `armbianEnv.txt`
`BTT_PAD7` is the master switch of the following functions. When it is set to `off`, all the following configurations will be ignored.
`TOUCH_VIBRATION` is vibration feedback when clicking on KlipperScreen buttons (Requires a [special KlipperScreen](https://github.com/bigtreetech/KlipperScreen/tree/master) version to be used together). overlay `pad7_vibration` required in `armbianEnv.txt`.
`TOUCH_SOUND` is sound feedback when clicking on KlipperScreen buttons (Requires a [special KlipperScreen](https://github.com/bigtreetech/KlipperScreen/tree/master) version to be used together, The HDMI audio does not output the first 1-2 seconds, so this function is currently unavailable in V3.0.0). No additional overlay required
`AUTO_BRIGHTNESS` is to automatically set the screen backlight brightness according to the ambient light intensity detected by the photosensitive components. overlay `light` required in `armbianEnv.txt`.
## Overlays Settings
* After the OS writes to the SD card, there is a FAT32 partition named `BOOT`, open `armbianEnv.txt` file with `Notpad` or `VSCode`.


*
```
bootlogo=false
```
`false` display terminal startup log information without displaying logo.
`true` display logo but not terminal startup log information.
*
```
fdtfile=sun50i-h616-bigtreetech-cb1-sd.dtb
```
set `fdtfile` to `sun50i-h616-bigtreetech-cb1-emmc.dtb` for CB1 eMMC version, set `fdtfile` to `sun50i-h616-bigtreetech-cb1-sd.dtb` (default value) for CB1 normal version.
*
```
console=display
```
The default value is `console=display`, This means that the `UART0` of CB1 is used as the debugging port by default. We can use `MobaXterm` to connect to CB1 by UART0 and debug. If klipper wants to use `UART0` to control the motherboard, we need to set it to `console=serial`, now klippe can use `UART0` as `/dev/ttyS0`.
*
```
extraargs=video=HDMI-A-1:1024x600-24@60
```
CB1 will automatically identify the HDMI resolution, but if your HDMI screen cannot report the resolution through the EDID normally, we can forcibly specify the resolution of CB1 output by uncomment `extraargs=video` and set the actual resolution.
For example:
BIGTREETECH-HDMI7 resolution = 1024x600: `extraargs=video=HDMI-A-1:1024x600-24@60`
BIGTREETECH-HDMI5 resolution = 800x480: `extraargs=video=HDMI-A-1:800x480-24@60`
*
```
overlays=ws2812
```
Uncomment `overlays=ws2812` to enable the WS2812 status RGB LED function for BIGTREETECH Pad7.
*
```
overlays=tft35_spi
param_tft35_spi_rotate=0
```
Uncomment `overlays=tft35_spi` to enable TFT35 SPI screen, uncomment `param_tft35_spi_rotate=xx`(0, 90, 180, 270) to set TFT35 SPI rotation angle, we also need to set `ks_src` to sync display type to KlipperScreen and `ks_angle` to set touch rotation to match the display of TFT35 in `system.cfg`.
*
```
overlays=mcp2515
```
Uncomment `overlays=mcp2515` to enable MCP2515 spi to canbus module (Theoretically, it can be multiplexed with `tft35_spi` and 'spidev1.2' at the same time, but `mcp2515` needs strong real-time, it is better not to enable other SPI1 features when using `mcp2515`).
*
```
overlays=i2c0
```
Uncomment `overlays=i2c0` to release '/dev/i2c-0' to user space for `BIGTREETECH Pi1` / `CB1 eMMC`, The list of i2c device is as follows:
* Before uncomment, the system has 3 built-in i2c devices:
* `/dev/i2c-0`: for PMU axp313a.
* `/dev/i2c-1`: for HDMI's i2c.
* `/dev/i2c-2`: twi3(PA10/PA11) for the H616 built-in Ethernet PHY device (ac200/ac300).
* After uncomment, 1 user space i2c + 3 built-in i2c:
* `/dev/i2c-0`: user space i2c0(PI5/PI6).
* `/dev/i2c-1`: for PMU axp313a.
* `/dev/i2c-2`: for HDMI's i2c.
* `/dev/i2c-3`: twi3(PA10/PA11) for the H616 built-in Ethernet PHY device (ac200/ac300).
*
```
overlays=spidev1_2
```
Uncomment `overlays=spidev1_2` to release 'spidev1.2' to user space (For example: adxl345), `spidev1.0` is used by `MCP2515`, `spidev1.1` is used by `tft35_spi`.
*
```
overlays=ir
```
Uncomment `overlays=ir` to enable IR feature for `BIGTREETECH Pi1`, now we can use command `sudo ir-keytable -c -p NEC -t` to test the IR feature.
*
```
param_gpio_shutdown_pin=PC8
param_gpio_shutdown_level=0
```
Uncomment `param_gpio_shutdown_pin=PC8` and `param_gpio_shutdown_level=0` for GPIO triggers system shutdown feature, `param_gpio_shutdown_pin` is the GPIO used for detection, `param_gpio_shutdown_level` is the triggering level, `0` means the falling edge is triggered, and `1` means the rising edge is triggered.
* NOTE: TFT35 SPI and MCP2515 multiplex a group of SPI1
```
SPI1_CLK=PH6
SPI1_MISO=PH8
SPI1_MOSI=PH7
TFT35_SPI_CS=PC7 (SD Version) / PI14 (eMMC Version)
MCP2515_CS=PC11 (SD Version) / PI5 (eMMC Version)
MCP2515_IRQ=PC9 (SD Version) / PI3 (eMMC Version)
```
# V2.3.4 OS Setting
V2.3.4 OS Setting
## WIFI Settings
* After the OS writes to the SD card, there is a FAT32 partition named `BOOT`, open `system.cfg` file with `Notpad` or `VSCode`.

* Set `WIFI_SSID` as your actual wifi name and `WIFI_PASSWD` as your actual wifi password, The space character can be parsed normally without additional escape character.
For example: `WIFI_SSID="CB1 Tester"`

## Overlays Settings
* After the OS writes to the SD card, there is a FAT32 partition named `BOOT`, open `BoardEnv.txt` file with `Notpad` or `VSCode`.

* Set as required as shown in the figure below.
* set `fdtfile` to `sun50i-h616-biqu-emmc` for CB1 eMMC version, set `fdtfile` to `sun50i-h616-biqu-sd` (default value) for CB1 normal version
* The default value is `console=display`, This means that the `UART0` of CB1 is used as the debugging port by default. We can use `MobaXterm` to connect to CB1 by UART0 and debug. If klipper wants to use `UART0` to control the motherboard, we need to set it to `console=serial`, now klippe can use `UART0` as `/dev/ttyS0`.
* CB1 will automatically identify the HDMI resolution, but if your HDMI screen cannot report the resolution through the EDID normally, we can forcibly specify the resolution of CB1 output by uncomment `extraargs=video` and set the actual resolution.
For example:
BIGTREETECH-HDMI7 resolution = 1024x600: `extraargs=video=HDMI-A-1:1024x600-24@60`
BIGTREETECH-HDMI5 resolution = 800x480: `extraargs=video=HDMI-A-1:800x480-24@60`
* Uncomment `overlays=tft35_spi` to enable TFT35 SPI screen, uncomment `param_tft35_spi_rotate=xx`(0, 90, 180, 270) to set TFT35 SPI rotation angle, we may also need to set `ks_angle` in `system.cfg` to set touch rotation to match the display of TFT35.
* Uncomment `overlays=mcp2515` to enable MCP2515 spi to canbus module (Theoretically, it can be multiplexed with `tft35_spi` and 'spidev1.2' at the same time, but `mcp2515` needs strong real-time, it is better not to enable other SPI1 features when using `mcp2515`).
* uncomment `overlays=i2c0` to release '/dev/i2c-0' to user space for `BIGTREETECH Pi1` / `CB1 eMMC`, The list of i2c device is as follows:
* Before uncomment, the system has 3 built-in i2c devices:
* `/dev/i2c-0`: twi3(PA10/PA11) for the H616 built-in Ethernet PHY device (ac200/ac300).
* `/dev/i2c-1`: for PMU axp313a.
* `/dev/i2c-2`: for HDMI's i2c.
* After uncomment, 1 user space i2c + 3 built-in i2c:
* `/dev/i2c-0`: user space i2c0(PI5/PI6).
* `/dev/i2c-1`: twi3(PA10/PA11) for the H616 built-in Ethernet PHY device (ac200/ac300).
* `/dev/i2c-2`: for PMU axp313a.
* `/dev/i2c-3`: for HDMI's i2c.
* uncomment `overlays=spidev1_2` to release 'spidev1.2' to user space (For example: adxl345), `spidev1.0` is used by `MCP2515`, `spidev1.1` is used by `tft35_spi`.
* uncomment `#param_gpio_shutdown_pin=PC8` and `#param_gpio_shutdown_level=0` for GPIO triggers system shutdown feature, `#param_gpio_shutdown_pin` is the GPIO used for detection, `#param_gpio_shutdown_level` is the triggering level, `0` means the falling edge is triggered, and `1` means the rising edge is triggered.

* NOTE: TFT35 SPI and MCP2515 multiplex a group of SPI1
```
SPI1_CLK=PH6
SPI1_MISO=PH8
SPI1_MOSI=PH7
TFT35_SPI_CS=PC7 (SD Version) / PI14 (eMMC Version)
MCP2515_CS=PC11 (SD Version) / PI5 (eMMC Version)
MCP2515_IRQ=PC9 (SD Version) / PI3 (eMMC Version)
```
As shown in the following figure is for PI4B_Adapter.
For other motherboards, refer to the CM4 eMMC part of the motherboard manual to set the switch.
For some motherboards (e.g. Manta-E3EZ, Manta-M8P-V1.1, Manta-M5P) with OTG/UART selector switch for Type-C, we also need to set the switch to OTG mode according to motherboard's manual 
3. USB driver for windows (Linux skip this step): refer to the official website of [AllWinner](https://linux-sunxi.org/FEL/USBBoot#Using_sunxi-fel_on_Windows)
* Download [Zadig](https://zadig.akeo.ie/) to the rescue
* Enable `Options->List All Devices` 
* Select the USB device to install the driver(most likely will be "unknown"). Make sure the device USB ID is "1F3A:EFE8"). Click `Install Driver` after confirming that the information is correct 
4. Open the `Powershell`(windows) or `console terminal`(linux) where you downloaded the sunxi-fel tools and CB1 driver in step 1.
5. Run
`.\sunxi-fel.exe -v ver` (windows)
`sudo ./sunxi-fel-armhf -v ver` (linux-armhf)
`sudo ./sunxi-fel-aarch64 -v ver` (linux-aarch64)
to check whether the USB of CB1 is connected normally.
If you get `ERROR: Allwinner USB FEL device not found!` means that the USB is not recognized. Please recheck whether the driver is installed successfully.
If you get `AWUSBFEX soc=00001823(H616)` means that CB1 eMMC is ready.
Here on the first line is an example of error you will see if the driver did not install correctly.
On the second line is an example of what it will look like after zadig has installed the driver correctly.

6. Run
`.\sunxi-fel.exe uboot .\u-boot-sunxi-cb1-emmc.bin` (windows)
`sudo ./sunxi-fel-armhf uboot ./u-boot-sunxi-cb1-emmc.bin` (linux-armhf)
`sudo ./sunxi-fel-aarch64 uboot ./u-boot-sunxi-cb1-emmc.bin` (linux-aarch64)
to write u-boot to CB1
7. When the uboot is written, the computer will recognize a USB flash disk, and then you can use `balenaEtcher` or `Raspberry Pi Imager` to write the OS image to eMMC. The steps are the same as the SD card version.
8. Refor to [Overlays Settings](https://github.com/bigtreetech/CB1#overlays-settings) to set `fdtfile` to `sun50i-h616-biqu-emmc`
# 40 Pin GPIO
| Pin | BIGTREETECH Pi1 | CB1 eMMC | CB1 | CM4 | CM4 | CB1 | CB1 eMMC | BIGTREETECH Pi1 | Pin | ||||||||
| Signal | Description | Signal | Description | Signal | Description | Signal | Description | Signal | Description | Signal | Description | Signal | Description | Signal | Description | ||
| 1 | 3.3V | 3.3V | 3.3V | 3.3V | 5V | 5V | 5V | 5V | 2 | ||||||||
| 3 | PC3 | GPIO67 | NC | NC | GPIO2 | I2C1 SDA | 5V | 5V | 5V | 5V | 4 | ||||||
| 5 | PC0 | GPIO64 | NC | NC | GPIO3 | I2C1 SCL | GND | GND | GND | GND | 6 | ||||||
| 7 | PC7 | GPIO71 | PI14 | GPIO270 | PC7 | GPIO71 | GPIO4 | GPCLK0 | GPIO14 | UART TX | PH0 | GPIO224, UART0_TX | PH0 | GPIO224, UART0_TX | PH0 | GPIO224, UART0_TX | 8 |
| 9 | GND | GND | GND | GND | GPIO15 | UART RX | PH1 | GPIO225, UART0_RX | PH1 | GPIO225, UART0_RX | PH1 | GPIO225, UART0_RX | 10 | ||||
| 11 | PC14 | GPIO78 | PI15 | GPIO271 | PC14 | GPIO78 | GPIO17 | SPI1 CE1 | GPIO18 | PCM CLK | PC13 | GPIO77 | PI7 | GPIO263 | PC13 | GPIO77 | 12 |
| 13 | PC12 | GPIO76 | PI6 | GPIO262 | PC12 | GPIO76 | GPIO27 |
|
GND | GND | GND | GND | 14 | ||||
| 15 | PC10 | GPIO74 | PI4 | GPIO260 | PC10 | GPIO74 | GPIO22 |
|
GPIO23 |
|
PC11 | GPIO75 | PI5 | GPIO261 | PC11 | GPIO75 | 16 |
| 17 | 3.3V | 3.3V | 3.3V | 3.3V | GPIO24 |
|
PC9 | GPIO73 | PI3 | GPIO259 | PC9 | GPIO73 | 18 | ||||
| 19 | PH7 | GPIO231, SPI1_MOSI | PH7 | GPIO231, SPI1_MOSI | PH7 | GPIO231, SPI1_MOSI | GPIO10 | SPI0 MOSI | GND | GND | GND | GND | 20 | ||||
| 21 | PH8 | GPIO232, SPI1_MISO | PH8 | GPIO232, SPI1_MISO | PH8 | GPIO232, SPI1_MISO | GPIO9 | SPI0 MISO | GPIO25 |
|
NC | NC | PG13 | GPIO205 | 22 | ||
| 23 | PH6 | GPIO230, SPI1_CLK | PH6 | GPIO230, SPI1_CLK | PH6 | GPIO230, SPI1_CLK | GPIO11 | SPI0 SCLK | GPIO8 | SPI0 CE0 | NC | NC | PG12 | GPIO204 | 24 | ||
| 25 | GND | GND | GND | GND | GPIO7 | SPI0 CE1 | PG8 | GPIO200 | PI11 | GPIO267 | PI9 | GPIO265 | 26 | ||||
| 27 | PC2 | GPIO66 | NC | NC | GPIO0 | EEPROM SDA | GPIO1 | EEPROM SCL | PG7 | GPIO199 | PI10 | GPIO266 | PI10 | GPIO266 | 28 | ||
| 29 | PC4 | GPIO68 | NC | NC | GPIO5 | GPCLK1 | GND | GND | GND | GND | 30 | ||||||
| 31 | PI5 | GPIO261 | PI9 | GPIO265 | PG6 | GPIO198 | GPIO6 | GPCLK2 | GPIO12 | PWM0 | PG9 | GPIO201 | PI12 | GPIO268 | PI6 | GPIO262 | 32 |
| 33 | PI14 | GPIO270 | NC | NC | GPIO13 | PWM1 | GND | GND | GND | GND | 34 | ||||||
| 35 | PC6 | GPIO70 | PI1 | GPIO257 | PC6 | GPIO70 | GPIO19 | PCM FS | GPIO16 | SPI1 CE2 | NC | NC | PG11 | GPIO203 | 36 | ||
| 37 | PC15 | GPIO79 | PI13 | GPIO269 | PC15 | GPIO79 | GPIO26 |
|
GPIO20 | PCM DIN | PH10 | GPIO234, IR_RX | PH10 | GPIO234, IR_RX | PH4 | GPIO228 | 38 |
| 39 | GND | GND | GND | GND | GPIO21 | PCM DOUT | PC8 | GPIO72 | PI2 | GPIO258 | PC8 | GPIO72 | 40 | ||||