Shenzhen Big Tree Technology Co., Ltd.
BIGTREETECH
22 / 26
To Work with a CM4
We recommend using the OS image released by Mainsail:
https://github.com/mainsail-crew/MainsailOS/releases
The steps for burning the system are the same as with CB1.
Setting up Backlight
Note: The backlight IO of CM4 does not have PWM function, so it can only be set
to maximum brightness.
1. Remove "console=serial0,115200" from /boot/cmdline.txt file (if it exists).
2. Remove enable_uart=1 from /boot/config.txt file (if it exists).
3. Add the following lines to /boot/config.txt file:
dtoverlay=gpio-led
dtparam=gpio=14,label=Pad7-lcd,active_low=1
Setting up Resolution and Touch
1. Add the following lines to /boot/config.txt file to specify the HDMI output
resolution:
hdmi_group=2
hdmi_mode=87
hdmi_cvt 1024 600 60 6 0 0 0
hdmi_drive=1
Some versions of the system disable USB by default to save power. To enable
USB, add the following line to /boot/config.txt file. Also, Pad 7's touch function
uses the USB HID protocol, so USB needs to be enabled.
dtoverlay=dwc2,dr_mode=host
Setting up SPI to CAN
Add the following lines to /boot/config.txt file:
dtparam=spi=on
dtoverlay=mcp2515-
can0,oscillator=12000000,interrupt=24,spimaxfrequency=10000000
Execute sudo nano /etc/network/interfaces.d/can0 in the SSH terminal to edit the
can0 file and check if the contents of the file are correct. The bitrate 1000000
represents the baud rate of the CAN bus and should be consistent with the
settings in Klipper.