Jump to: navigation, search

Difference between revisions of "Recore"

(Created page with "==Software for Recore== ===Distro=== Starting with Armbian Butser Server (kernel 5.4) https://dl.armbian.com/pine64/Buster_current Flash the software to a USB drive. With a...")
 
(Install STM32 firmware)
(21 intermediate revisions by the same user not shown)
Line 5: Line 5:
  
 
With a clean board, it's necessary to start the board from a host computer using FEL mode.  
 
With a clean board, it's necessary to start the board from a host computer using FEL mode.  
```sunxi-fel -v -p spl sunxi-spl.bin write 0x44000 bl31.bin write 0x4a000000 u-boot.bin reset64 0x44000```
+
<pre>
 +
sunxi-fel -v -p spl sunxi-spl.bin write 0x44000 bl31.bin write 0x4a000000 u-boot.bin reset64 0x44000
 +
</pre>
 
The output will appear in teminal that can be started with:
 
The output will appear in teminal that can be started with:
```minicom -D /dev/ttyUSB0 -w```
+
<pre>
If a dongle with Armbian is present in one of the USB host slots, it should boot from the dongle.  
+
minicom -D /dev/ttyUSB0 -w
 +
</pre>
 +
If a dongle with Armbian is present in one of the USB host slots, it should boot from the dongle.
 +
 
 +
==== Booting from USB if an OS is present on the eMMC ====
 +
If the eMMC is parititioned and has an OS, u-boot will launch right into that. In order to override that and
 +
boot from a USB dongle, stop u-boot by pressing a key and then write: 
 +
<pre>
 +
setenv devnum 0
 +
run usb_boot
 +
</pre>
  
 
=== Install distro to eMMC ===
 
=== Install distro to eMMC ===
 
Create Partition:  
 
Create Partition:  
```
+
<pre>
 
export card=/dev/mmcblk0
 
export card=/dev/mmcblk0
 
blockdev --rereadpt ${card}
 
blockdev --rereadpt ${card}
 
cat <<EOT | sfdisk ${card}
 
cat <<EOT | sfdisk ${card}
1,,L
+
1M,,L
 
EOT
 
EOT
 
mkfs.ext4 ${card}p1
 
mkfs.ext4 ${card}p1
```
+
</pre>
 +
 
 
====Copy Kernel and rootfs to eMMC====
 
====Copy Kernel and rootfs to eMMC====
 
Use the flash script in Redist
 
Use the flash script in Redist
```mount /dev/mmcblk0p1  /mnt/
+
<pre>
 +
mount /dev/mmcblk0p1  /mnt/
 
rsync -aAx --human-readable --info=name0,progress2 --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/media/*,/mnt/*,lost+found/} /* /mnt
 
rsync -aAx --human-readable --info=name0,progress2 --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/media/*,/mnt/*,lost+found/} /* /mnt
 
echo "rootdev=/dev/mmcblk0p1" >> /mnt/boot/armbianEnv.txt
 
echo "rootdev=/dev/mmcblk0p1" >> /mnt/boot/armbianEnv.txt
```
+
</pre>
 +
 
 +
 
 +
====Make eMMC bootable (WIP)====
 +
Place U-boot-spl in sector 15 (8KB offset) 
 +
Clean card: 
 +
<pre>
 +
dd if=/dev/zero of=/dev/mmcblk0 bs=1k count=1023 seek=1
 +
</pre>
 +
Flash the binary
 +
<pre>
 +
dd if=u-boot-sunxi-with-spl.bin of=/dev/mmcblk0 bs=1024 seek=8
 +
</pre>
 +
 
 +
The board (A2) does not boot using this technique. It might be the binary file itself or it might be a hardware issue.
 +
 
 +
====Install Klipper====
 +
It's good to add a separate user for Klipper:
 +
<pre>
 +
useradd klipper -s /bin/bash -G sudo,dialout
 +
passwd klipper
 +
mkdir /home/klipper
 +
chown klipper:klipper /home/klipper
 +
</pre>
 +
<pre>
 +
su klipper
 +
cd ~
 +
git clone https://github.com/intelligent-agent/klipper
 +
cp klipper/config/generic-recore.cfg ./printer.cfg
 +
./klipper/scripts/install-ubuntu-18.04.sh
 +
</pre>
 +
 
 +
You can check the log by writing
 +
<pre>
 +
tail -f /tmp/klippy.log
 +
</pre>
 +
 
 +
====Install host firmware====
 +
<pre>
 +
cd /home/klipper/klipper
 +
apt install libgpiod-dev
 +
cp .config_linux .config
 +
make
 +
make flash
 +
chown klipper:klipper /dev/pts/1
 +
</pre>
 +
 
 +
====Install STM32 firmware ====
 +
<pre>
 +
cd /home/klipper/klipper
 +
cp .config_stm32f031 .config
 +
make
 +
./scripts/flash-stm32.sh
 +
</pre>
 +
 
 +
====Install Octoprint====
 +
<pre>
 +
cd ~
 +
sudo apt update
 +
sudo apt install python-pip python-dev python-setuptools python-virtualenv git libyaml-dev build-essential
 +
mkdir OctoPrint && cd OctoPrint
 +
virtualenv venv
 +
source venv/bin/activate
 +
pip install pip --upgrade
 +
pip install octoprint
 +
</pre>

Revision as of 21:47, 26 March 2020

Software for Recore

Distro

Starting with Armbian Butser Server (kernel 5.4) https://dl.armbian.com/pine64/Buster_current Flash the software to a USB drive.

With a clean board, it's necessary to start the board from a host computer using FEL mode.

sunxi-fel -v -p spl sunxi-spl.bin write 0x44000 bl31.bin write 0x4a000000 u-boot.bin reset64 0x44000

The output will appear in teminal that can be started with:

minicom -D /dev/ttyUSB0 -w

If a dongle with Armbian is present in one of the USB host slots, it should boot from the dongle.

Booting from USB if an OS is present on the eMMC

If the eMMC is parititioned and has an OS, u-boot will launch right into that. In order to override that and boot from a USB dongle, stop u-boot by pressing a key and then write:

setenv devnum 0
run usb_boot

Install distro to eMMC

Create Partition:

export card=/dev/mmcblk0
blockdev --rereadpt ${card}
cat <<EOT | sfdisk ${card}
1M,,L
EOT
mkfs.ext4 ${card}p1

Copy Kernel and rootfs to eMMC

Use the flash script in Redist

mount /dev/mmcblk0p1  /mnt/
rsync -aAx --human-readable --info=name0,progress2 --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/media/*,/mnt/*,lost+found/} /* /mnt
echo "rootdev=/dev/mmcblk0p1" >> /mnt/boot/armbianEnv.txt


Make eMMC bootable (WIP)

Place U-boot-spl in sector 15 (8KB offset) Clean card:

dd if=/dev/zero of=/dev/mmcblk0 bs=1k count=1023 seek=1

Flash the binary

dd if=u-boot-sunxi-with-spl.bin of=/dev/mmcblk0 bs=1024 seek=8

The board (A2) does not boot using this technique. It might be the binary file itself or it might be a hardware issue.

Install Klipper

It's good to add a separate user for Klipper:

useradd klipper -s /bin/bash -G sudo,dialout
passwd klipper
mkdir /home/klipper
chown klipper:klipper /home/klipper
su klipper
cd ~
git clone https://github.com/intelligent-agent/klipper
cp klipper/config/generic-recore.cfg ./printer.cfg
./klipper/scripts/install-ubuntu-18.04.sh

You can check the log by writing

tail -f /tmp/klippy.log 

Install host firmware

cd /home/klipper/klipper
apt install libgpiod-dev
cp .config_linux .config
make 
make flash
chown klipper:klipper /dev/pts/1

Install STM32 firmware

cd /home/klipper/klipper
cp .config_stm32f031 .config
make
./scripts/flash-stm32.sh

Install Octoprint

cd ~
sudo apt update
sudo apt install python-pip python-dev python-setuptools python-virtualenv git libyaml-dev build-essential
mkdir OctoPrint && cd OctoPrint
virtualenv venv
source venv/bin/activate
pip install pip --upgrade
pip install octoprint