<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.iagent.no/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Shufflez</id>
	<title>iagent - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.iagent.no/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Shufflez"/>
	<link rel="alternate" type="text/html" href="https://wiki.iagent.no/wiki/Special:Contributions/Shufflez"/>
	<updated>2026-05-07T14:02:33Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.1</generator>
	<entry>
		<id>https://wiki.iagent.no/mediawiki/index.php?title=Refactor&amp;diff=927</id>
		<title>Refactor</title>
		<link rel="alternate" type="text/html" href="https://wiki.iagent.no/mediawiki/index.php?title=Refactor&amp;diff=927"/>
		<updated>2023-05-09T10:54:47Z</updated>

		<summary type="html">&lt;p&gt;Shufflez: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Refactor header 2.png]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Refactor is a complete Linux image for Recore 3D printer controller boards. It comes with Klipper installed and the choice of either MainSail or OctoPrint. &lt;br /&gt;
&lt;br /&gt;
Refactor is available in two verisons: Recore OctoPrint and Recore Mainsail, with updates being propagated simultaneously for both images. &lt;br /&gt;
&lt;br /&gt;
These instructions are for version v3.1.3. For older versions of Refactor:&lt;br /&gt;
* [[Refactor_v3.0.3]]&lt;br /&gt;
* [[Refactor_v3.0.2]]&lt;br /&gt;
&lt;br /&gt;
=Installing an image=&lt;br /&gt;
For instructions on making a flasher image, have a look at [[Reflash]]&lt;br /&gt;
&lt;br /&gt;
=Latest images=&lt;br /&gt;
The latest images for Recore and Replicape are available from github: https://github.com/intelligent-agent/Refactor/releases&lt;br /&gt;
&lt;br /&gt;
=Installed software=&lt;br /&gt;
==Recore OctoPrint==&lt;br /&gt;
The Recore version is based on Armbian, Debian Buster. On top of that, Refactor comes preinstalled &lt;br /&gt;
with a stack of programs to simplify setting up a new controller board. &lt;br /&gt;
* OctoPrint (1.7.3) https://github.com/OctoPrint/OctoPrint&lt;br /&gt;
** Octoprint Klipper (master) https://github.com/thelastWallE/OctoprintKlipperPlugin&lt;br /&gt;
** Octoprint Refactor (main) https://github.com/intelligent-agent/octoprint_refactor&lt;br /&gt;
** OctoPrint Toggle (master) https://github.com/intelligent-agent/octoprint_toggle&lt;br /&gt;
** OctoPrint Top Temp (master) https://github.com/LazeMSS/OctoPrint-TopTemp.git&lt;br /&gt;
* Klipper (v0.10.0) https://github.com/intelligent-agent/klipper&lt;br /&gt;
* Toggle (v1.4.1) https://github.com/intelligent-agent/toggle&lt;br /&gt;
* Mjpeg streamer (master)  https://github.com/xeno14/mjpg-streamer&lt;br /&gt;
* Linux (5.15.25) https://github.com/intelligent-agent/build&lt;br /&gt;
* u-boot (v2020.10) https://github.com/intelligent-agent/u-boot&lt;br /&gt;
&lt;br /&gt;
==Recore Mainsail==&lt;br /&gt;
The Recore version is based on Armbian, Debian Buster. On top of that, Refactor comes preinstalled &lt;br /&gt;
with a stack of programs to simplify setting up a new controller board. &lt;br /&gt;
* Mainsail  (v2.1.2) https://github.com/mainsail-crew/mainsail&lt;br /&gt;
* Moonraker (master) https://github.com/Arksine/moonraker&lt;br /&gt;
* Klipper (v0.10.0) https://github.com/intelligent-agent/klipper&lt;br /&gt;
* KlipperScreen (3b4555b) https://github.com/intelligent-agent/KlipperScreen&lt;br /&gt;
* Mjpeg streamer (master)  https://github.com/xeno14/mjpg-streamer&lt;br /&gt;
* Linux (5.15.25) https://github.com/intelligent-agent/build&lt;br /&gt;
* u-boot (v2020.10) https://github.com/intelligent-agent/u-boot&lt;br /&gt;
&lt;br /&gt;
=Getting started=&lt;br /&gt;
It can be a good idea to test the board on the bench before installing it in the printer. Use the USB-C connector to power the board. &lt;br /&gt;
&lt;br /&gt;
Once the board is powered up, use a computer to access the web interface provided by OctoPrint. &lt;br /&gt;
In order to get access to OctoPrint, a network cable must be connected to the board and to a network switch. It is also possible to use a wifi dongle. &lt;br /&gt;
If a network cable is used, the board should respond to the address:&lt;br /&gt;
http://recore.local&lt;br /&gt;
&lt;br /&gt;
Once the OctoPrint interface is visible, run through the wizard to set up a new printer. &lt;br /&gt;
After the wizard is done, go to the Klipper tab in OctoPrint and edit the Klipper config file. &lt;br /&gt;
This is where the bulk of the work will happen. &lt;br /&gt;
&lt;br /&gt;
== Klipper configuration ==&lt;br /&gt;
There is a standard klipper configuration file that comes with Refactor. The configuration file is set up &lt;br /&gt;
to work out of the box, but it assumes that there is a 100 K ntc thermistor on analog inputs T0 and T3 (bed). &lt;br /&gt;
If these are not present, Klipper will halt with a warning. &lt;br /&gt;
&lt;br /&gt;
The default klipper config can be used as a starting point for building a custom config file for the printer at hand. &lt;br /&gt;
&lt;br /&gt;
After the Klipper configuration is complete, do a test print to make sure everything is working. &lt;br /&gt;
&lt;br /&gt;
=== Recore booting ===&lt;br /&gt;
Recore comes with Refactor pre-installed. &lt;br /&gt;
&lt;br /&gt;
The Recore images will need to be flashed to a USB flash drive, as there is no SD slot on the board. Recore's uboot is designed to attempt to boot from a USB drive if there is no OS on the eMMC. &lt;br /&gt;
&lt;br /&gt;
There are several stages to booting Recore, and depending on which media is installed, the boot process will &lt;br /&gt;
try and boot either from eMMC, USB host or USB device. &lt;br /&gt;
===Booting Recore from eMMC (the normal way)===&lt;br /&gt;
# Turn on power&lt;br /&gt;
# The BROM will load u-boot SPL from eMMC&lt;br /&gt;
# The u-boot SPL will load u-boot&lt;br /&gt;
# u-boot will load Linux&lt;br /&gt;
# Linux will load the rootfs from eMMC.&lt;br /&gt;
&lt;br /&gt;
===Booting Recore from eMMC, but load rootfs from USB===&lt;br /&gt;
&amp;lt;div class=&amp;quot;alert alert-warning&amp;quot;&amp;gt;&lt;br /&gt;
===='''Note'''====&lt;br /&gt;
Using a root file system on a different drive work well if the kernel version is the same on both media. &lt;br /&gt;
The kernel version has changed between Refactor v3.0.2-RC3 and v3.0.2-RC4. The board will still boot, but will not load &lt;br /&gt;
kernel modules as expected, including nft that maps OctoPrint to the HTTP port (80). &lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the board is working normally and you are able to log in through ssh, but want to try out a new &lt;br /&gt;
Refactor version you can let the rootfs be loaded from a USB drive (mass storage device):&lt;br /&gt;
# Download Refactor and flash it to a USB drive&lt;br /&gt;
# Insert the USB drive in the board. &lt;br /&gt;
# Boot the board normally&lt;br /&gt;
## Open the Refactor tab in OctoPrint. &lt;br /&gt;
## Select '''run from USB'''&lt;br /&gt;
#:or&lt;br /&gt;
## Use SSH to log into the board: '''ssh debian@recore.local''' (default password = '''temppwd''')&lt;br /&gt;
## Run the command '''set-boot-media usb'''&lt;br /&gt;
# Reboot&lt;br /&gt;
The board should now be have the rootfs from the USB drive.&lt;br /&gt;
&lt;br /&gt;
===Booting Recore from USB, load Linux kernel from USB drive===&lt;br /&gt;
This method requires a UART to USB adapter that can plug into a host computer. &lt;br /&gt;
There is a 4 pin header on Recore marked '''DBG''', where UART 0 is routed. All u-boot and kernel &lt;br /&gt;
messages will appear here. The baud rate is 115200. &lt;br /&gt;
If the eMMC is partitioned and has an OS, u-boot will launch right into that. In order to override that and &lt;br /&gt;
load the boot script from a USB drive, stop u-boot by pressing a key and then write:  &lt;br /&gt;
&lt;br /&gt;
# Download Refactor and flash it to a USB drive&lt;br /&gt;
# Insert the USB drive in the board and apply power&lt;br /&gt;
# When the boot process gets to u-boot, you will see: '''Hit any key to stop autoboot:  '''&lt;br /&gt;
# Hit the Any key. &lt;br /&gt;
# Then write '''run bootcmd_usb0'''&lt;br /&gt;
This will load the U-boot script from the USB drive and use the USB drive as the rootfs.&lt;br /&gt;
&lt;br /&gt;
===Boot Recore from a USB stick using the FEL button===&lt;br /&gt;
If u-boot should be loaded from a host computer and kernel and rootfs is loaded from a USB drive:&lt;br /&gt;
# Flash the [[Reflash]] Linux distro to a USB drive. &lt;br /&gt;
# Insert the USB drive in the Recore board in one of the two host connectors close to the HDMI.&lt;br /&gt;
# Hold down the FEL button while applying power to the board via the USB-C connector.&lt;br /&gt;
# Download the Recore repository https://github.com/intelligent-agent/Recore&lt;br /&gt;
# Install the sunxi-tools program&lt;br /&gt;
# Run the fel command ('''make fel''') from the host computer. All the necessary binarys are in the Recore repository:&lt;br /&gt;
You can read more about the steps needed to boot aboard in FEL mode on the Sunxi wiki: https://linux-sunxi.org/FEL&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Depending on what linux platform you're running from, sunxi-tools will require the following dependencies to compile properly:&lt;br /&gt;
* libftd-dev&lt;br /&gt;
* libusbx-dev&lt;br /&gt;
* libudev-dev&lt;br /&gt;
(These are Debian/ubuntu names. For Fedora, change -dev to -devel)&lt;br /&gt;
&lt;br /&gt;
This should upload u-boot from the host computer to the board via the USB cable. u-boot will then boot from the connected USB drive. &lt;br /&gt;
Please note that in some instances, the USB drive is not detected as a mass storage device without also having the VIN power connector inserted. See more in [[Recore_A6#USB_connectors_not_discovered_when_powered_by_USB_device|in the &amp;quot;known errors&amp;quot; section of Recore A6]]&lt;br /&gt;
&lt;br /&gt;
==Upgrading Refactor==&lt;br /&gt;
After upgrading refactor, if the recore board is A5 or older, you can set the device tree to a different version by running the command&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
use-recore-revision a5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After a reboot, you can check that the loaded device tree matches the revision of firmware. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat /sys/firmware/devicetree/base/model&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
It's also worth noting that the klipper configuration is a bit different between the A5 and A6 revisions. The A6 is the now the default configuration, but A5 is also present for use. It can be found on github or on the board. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat /home/debian/klipper/config/generic-recore-a5.cfg&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Upgrading Debian via apt upgrade===&lt;br /&gt;
The /boot partition of Refactor is mounted Read Only, so it will have to be remounted as Read Write before running an upgrade: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo mount -o remount,rw /boot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Upgrading Refactor from OctoPrint===&lt;br /&gt;
The only way to upgrade Refactor is by flashing a new version. In OctoPrint there is a &amp;quot;Refactor&amp;quot; plugin that can aid with this. If Refactor is run from a USB stick, a new version of can be downloaded and flashed on the eMMC.&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Refactor-tab.png|center]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is a separate image used for upgrading Refactor. Take a look at [[Reflash]]&lt;br /&gt;
&lt;br /&gt;
===Upgrading Refactor from the command line===&lt;br /&gt;
To reboot into a USB drive: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set-boot-media usb&lt;br /&gt;
reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note''': Reflash may not show up with the same IP as your previous ReFactor instance did. It will depend on your router's DHCP, so be sure to check if the IP has changed, even if the MAC has not.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;alert alert-info&amp;quot;&amp;gt;&lt;br /&gt;
===='''Info'''====&lt;br /&gt;
You might have to change the settings of Moonraker to allow your host computer to access the &lt;br /&gt;
user interface. Check that the IP of your host computer is allowed in the moonraker.conf&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To change the allowed IP range run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nano /home/debian/moonraker.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then restart moonraker.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
systemctl restart moonraker&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Using KlipperScreen instead of Toggle==&lt;br /&gt;
With version 3.0.4, KlipperScreen can be installed. Use SSH to get access to Recore, then run the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
install-klipperscreen&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make sure you update /home/debian/moonraker.conf to allow for 127.0.0.1:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nano /home/debian/moonraker.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[authorization]&lt;br /&gt;
trusted_clients:&lt;br /&gt;
  127.0.0.1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Weston might be rotated by default. To change rotation: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nano /etc/xdg/weston/weston.ini&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The rotation should be 0&lt;br /&gt;
&lt;br /&gt;
==Recompiling and installing binaries==&lt;br /&gt;
===Update u-boot on Recore===&lt;br /&gt;
This is not something the regular user would need to do, but documented here for convenience. &lt;br /&gt;
Place u-boot-sunxi-with-spl.bin in sector 15 (8KB offset)  &lt;br /&gt;
Flash the binary &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dd if=u-boot-sunxi-with-spl.bin of=/dev/mmcblk0 bs=1024 seek=8 conv=notrunc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: U-boot needs to be patched in order to use the eMMC as the first (and only) boot device. &lt;br /&gt;
The changes can be done in &amp;quot;spl_mmc_get_device_index&amp;quot; where dev_num should be 0 instead of 1.&lt;br /&gt;
&lt;br /&gt;
===AR100 firmware===&lt;br /&gt;
The AR100 CPU needs a binary file that is loaded on startup by the systemd file klipper.service&lt;br /&gt;
The AR100 binary file comes pre-compiled in Refactor, so most users should not have to re-compile it. &lt;br /&gt;
For experiments the AR100 binary can be recompiled on Recore (architecture aarch64) or on a host computer (amd64 or similar).  &lt;br /&gt;
&lt;br /&gt;
====Compiling the ar100 binary====&lt;br /&gt;
To configure klipper for AR100 and build the binary:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export PATH=$PATH:/opt/output/bin&lt;br /&gt;
cd /home/debian/klipper/&lt;br /&gt;
cp test/configs/ar100.config .config&lt;br /&gt;
make olddefconfig&lt;br /&gt;
make&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will produce a bin file located in out/ar100.bin, so it should be moved to /opt/firmware&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mv out/ar100.bin /opt/firmware/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Once the AR100 binary has been updated, klipper.service can be restarted which then loads the new AR100 binary. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
systemctl restart klipper&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Cross compilation toolchain for ARM64====&lt;br /&gt;
The AR100 needs a cross compilation toolchain. For ARM64, it can be downloaded from feeds.iagent.no:&lt;br /&gt;
&lt;br /&gt;
http://feeds.iagent.no/toolchains/  &lt;br /&gt;
&lt;br /&gt;
The toolchain has been built with  &lt;br /&gt;
&lt;br /&gt;
https://github.com/richfelker/musl-cross-make&lt;br /&gt;
&lt;br /&gt;
GCC version: 9.2.0&lt;br /&gt;
&lt;br /&gt;
====Cross compilation toolchain for x86_64====&lt;br /&gt;
The toolchain used during automatic testing and is the same used for the CRUST firmware project: &lt;br /&gt;
&lt;br /&gt;
https://github.com/crust-firmware/crust#building-the-firmware&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====STM32 firmware====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;alert alert-warning&amp;quot;&amp;gt;&lt;br /&gt;
===='''Note'''====&lt;br /&gt;
The latest Refactor now does automatic flashing of the STM32 firmware on first boot after a fresh install. This was merged with PR#199 in Refactor on Github. &lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The firmware for the stm32f031 mcu that is responsible for ADC &lt;br /&gt;
conversions and PWM for heaters and fans comes pre-installed in the flash of the MCU. &lt;br /&gt;
It can be recreated on the board using the Klipper build system.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /home/debian/klipper&lt;br /&gt;
cp test/configs/stm32f031.config .config&lt;br /&gt;
make menuconfig&lt;br /&gt;
-&amp;gt; Enable extra low-level configuration options&lt;br /&gt;
-&amp;gt; Processor model (STM32F031)&lt;br /&gt;
-&amp;gt; Bootloader offset (No bootloader)&lt;br /&gt;
-&amp;gt; Clock Reference (Internal clock)&lt;br /&gt;
-&amp;gt; (16) Internal clock trim override&lt;br /&gt;
-&amp;gt; Communication interface (Serial (on USART2 PA15/PA14))&lt;br /&gt;
-&amp;gt; Baud rate for serial port: 250000&lt;br /&gt;
make&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Flashing STM32 firmware====&lt;br /&gt;
To flash the STM32 firmware:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cp out/klipper.bin /opt/firmware/stm32.bin&lt;br /&gt;
sudo flash-stm32&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Replicape ===&lt;br /&gt;
&lt;br /&gt;
The Replicape images will be meant to run from the micro SD you flash it to. You cannot boot the Replicape from a USB key at this time.&lt;br /&gt;
By default, Refactor images do not flash to the eMMC the way Umikaze used to. Part of this is historical - the early betas of Refactor did not fit on the eMMC, but there's another advantage as well: it allows you to test out Refactor on an SD card while keeping your working Redeem config on the eMMC.&lt;br /&gt;
&lt;br /&gt;
==== Booting Refactor from USB ====&lt;br /&gt;
If you want to boot Refactor from a USB stick, you need to stop u-boot by pressing space during boot. &lt;br /&gt;
You must run these commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
setenv bootpart 0:1; setenv oldroot /dev/sda1; setenv devnum 0; run usb_boot&lt;br /&gt;
&lt;br /&gt;
load ${devtype} ${bootpart} ${loadaddr} /boot/uEnv.txt; env import -t ${loadaddr} ${filesize}&lt;br /&gt;
&lt;br /&gt;
run uname_boot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Running Klipper===&lt;br /&gt;
Klipper is run as a systemd service. It should not normally need to be restarted from the command line, but during development it can be necessary. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
systemctl restart klipper&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The log for Klipper is located in /tmp. It can be viewed as:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tail -f /tmk/klippy.log&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Klipper can also be restarted from the OctoPrint interface. On the &amp;quot;Klipper&amp;quot; tab, press &amp;quot;Firmware&amp;quot; to restart the Klipper firmware. &lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Klipper-firmware-press.png]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Running Toggle===&lt;br /&gt;
Toggle is started automatically by the systemd service toggle.service. A user is created for Toggle on first boot, but the credentials are not set until a user is created in OctoPrint. Once the wizard has been completed, the Toggle user is active, but the credentials will not be valid until OctoPrint is restarted. Therefore, if Toggle is needed, restart OctoPrint after the wizard is complete.&lt;br /&gt;
&lt;br /&gt;
===Running OctoPrint===&lt;br /&gt;
OctoPrint is stated on boot. If there is a need to restart the daemon, use this command&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
systemctl restart octoprint&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Refactor build system=&lt;br /&gt;
&lt;br /&gt;
Refactor uses [https://www.ansible.com/ Ansible] as the underlying framework to describe the desired system state. &lt;br /&gt;
There are many reasons for this:&lt;br /&gt;
&lt;br /&gt;
# Ansible describes the system's end state, not individual actions to perform, so it is relatively easy to port across platforms (i.e. debian, arch, BSD...)&lt;br /&gt;
# The Refactor repository can be updated from the git repository and Ansible will only change what has been updated from the previous version, not needing a complete reinstallation of the system for upgrades.&lt;br /&gt;
# Description of components is modular, making it easy to pick and choose different components for the end goal desired, while keeping each component's setup independent and reliable, and independently updatable.&lt;/div&gt;</summary>
		<author><name>Shufflez</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.iagent.no/mediawiki/index.php?title=Refactor&amp;diff=587</id>
		<title>Refactor</title>
		<link rel="alternate" type="text/html" href="https://wiki.iagent.no/mediawiki/index.php?title=Refactor&amp;diff=587"/>
		<updated>2022-02-04T08:10:22Z</updated>

		<summary type="html">&lt;p&gt;Shufflez: Corrected typo in set-boo(o)t-media&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Refactor header.png]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Refactor is the next generation of controller board software stack installation.&lt;br /&gt;
&lt;br /&gt;
It is meant to simplify the lives of new users when they begin using a Thing-Printer controller board. Pre-built images of Refactor are available for users who want to get up and running quickly with Replicape or Recore.&lt;br /&gt;
&lt;br /&gt;
Refactor is available for Replicape and Recore, with updates being propagated simultaneously for both platforms.&lt;br /&gt;
&lt;br /&gt;
These instructions are for version v3.0.3, for v3.0.2 and older see:&lt;br /&gt;
* [[Refactor_v3.0.2]]&lt;br /&gt;
&lt;br /&gt;
=Latest images=&lt;br /&gt;
The latest images for Recore and Replicape are available from github: https://github.com/intelligent-agent/Refactor/releases&lt;br /&gt;
&lt;br /&gt;
=Installed software=&lt;br /&gt;
==Recore==&lt;br /&gt;
The Recore version is based on Armbian, Debian Buster. On top of that, Refactor comes preinstalled &lt;br /&gt;
with a stack of programs to simplify setting up a new controller board. &lt;br /&gt;
* OctoPrint (1.7.2) https://github.com/OctoPrint/OctoPrint&lt;br /&gt;
** Octoprint Klipper (master) https://github.com/thelastWallE/OctoprintKlipperPlugin&lt;br /&gt;
** Octoprint Refactor (main) https://github.com/intelligent-agent/octoprint_refactor&lt;br /&gt;
** OctoPrint Toggle (master) https://github.com/intelligent-agent/octoprint_toggle&lt;br /&gt;
** OctoPrint Top Temp (master) https://github.com/LazeMSS/OctoPrint-TopTemp.git&lt;br /&gt;
* Klipper (v0.10.0) https://github.com/intelligent-agent/klipper&lt;br /&gt;
* Toggle (v1.4.1) https://github.com/intelligent-agent/toggle&lt;br /&gt;
* Mjpeg streamer (master)  https://github.com/xeno14/mjpg-streamer&lt;br /&gt;
* Linux (5.10.60) https://github.com/intelligent-agent/build&lt;br /&gt;
* u-boot (v2020.10) https://github.com/intelligent-agent/u-boot&lt;br /&gt;
&lt;br /&gt;
==Replicape==&lt;br /&gt;
The Replicape version of Refactor is based on the BeagleBoard official Debian Buster console image. &lt;br /&gt;
with a stack of programs to simplify setting up a new controller board. &lt;br /&gt;
* OctoPrint (1.7.2) https://github.com/OctoPrint/OctoPrint&lt;br /&gt;
** Octoprint Klipper (master) https://github.com/thelastWallE/OctoprintKlipperPlugin&lt;br /&gt;
** OctoPrint Top Temp (master) https://github.com/LazeMSS/OctoPrint-TopTemp.git&lt;br /&gt;
* Klipper (master) https://github.com/Klipper3d/klipper&lt;br /&gt;
* Mjpeg streamer (master)  https://github.com/xeno14/mjpg-streamer&lt;br /&gt;
* Linux (4.14.108-ti-r143) https://debian.beagleboard.org/images/&lt;br /&gt;
* u-boot (2018.09) https://debian.beagleboard.org/images/&lt;br /&gt;
&lt;br /&gt;
=Getting started=&lt;br /&gt;
It can be a good idea to test the board on the bench before installing it in the printer. Use the USB-C connector to power the board. &lt;br /&gt;
&lt;br /&gt;
Once the board is powered up, use a computer to access the web interface provided by OctoPrint. &lt;br /&gt;
In order to get access to OctoPrint, a network cable must be connected to the board and to a network switch. It is also possible to use a wifi dongle. &lt;br /&gt;
If a network cable is used, the board should respond to the address:&lt;br /&gt;
http://recore.local&lt;br /&gt;
&lt;br /&gt;
Once the OctoPrint interface is visible, run through the wizard to set up a new printer. &lt;br /&gt;
After the wizard is done, go to the Klipper tab in OctoPrint and edit the Klipper config file. &lt;br /&gt;
This is where the bulk of the work will happen. &lt;br /&gt;
&lt;br /&gt;
== Klipper configuration ==&lt;br /&gt;
There is a standard klipper configuration file that comes with Refactor. The configuration file is set up &lt;br /&gt;
to work out of the box, but it assumes that there is a 100 K ntc thermistor on analog inputs T0 and T3 (bed). &lt;br /&gt;
If these are not present, Klipper will halt with a warning. &lt;br /&gt;
&lt;br /&gt;
The default klipper config can be used as a starting point for building a custom config file for the printer at hand. &lt;br /&gt;
&lt;br /&gt;
After the Klipper configuration is complete, do a test print to make sure everything is working. &lt;br /&gt;
&lt;br /&gt;
=== Recore booting ===&lt;br /&gt;
Recore comes with Refactor pre-installed. &lt;br /&gt;
&lt;br /&gt;
The Recore images will need to be flashed to a USB flash drive, as there is no SD slot on the board. Recore's uboot is designed to attempt to boot from a USB drive if there is no OS on the eMMC. &lt;br /&gt;
&lt;br /&gt;
There are several stages to booting Recore, and depending on which media is installed, the boot process will &lt;br /&gt;
try and boot either from eMMC, USB host or USB device. &lt;br /&gt;
===Booting Recore from eMMC (the normal way)===&lt;br /&gt;
# Turn on power&lt;br /&gt;
# The BROM will load u-boot SPL from eMMC&lt;br /&gt;
# The u-boot SPL will load u-boot&lt;br /&gt;
# u-boot will load Linux&lt;br /&gt;
# Linux will load the rootfs from eMMC.&lt;br /&gt;
&lt;br /&gt;
===Booting Recore from eMMC, but load rootfs from USB===&lt;br /&gt;
&amp;lt;div class=&amp;quot;alert alert-warning&amp;quot;&amp;gt;&lt;br /&gt;
===='''Note'''====&lt;br /&gt;
Using a root file system on a different drive work well if the kernel version is the same on both media. &lt;br /&gt;
The kernel version has changed between Refactor v3.0.2-RC3 and v3.0.2-RC4. The board will still boot, but will not load &lt;br /&gt;
kernel modules as expected, including nft that maps OctoPrint to the HTTP port (80). &lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the board is working normally and you are able to log in through ssh, but want to try out a new &lt;br /&gt;
Refactor version you can let the rootfs be loaded from a USB drive (mass storage device):&lt;br /&gt;
# Download Refactor and flash it to a USB drive&lt;br /&gt;
# Insert the USB drive in the board. &lt;br /&gt;
# Boot the board normally&lt;br /&gt;
## Open the Refactor tab in OctoPrint. &lt;br /&gt;
## Select '''run from USB'''&lt;br /&gt;
#:or&lt;br /&gt;
## Use SSH to log into the board: '''ssh root@recore.local'''&lt;br /&gt;
## Run the command '''set-boot-media usb'''&lt;br /&gt;
# Reboot&lt;br /&gt;
The board should now be have the rootfs from the USB drive.&lt;br /&gt;
&lt;br /&gt;
===Booting Recore from USB, load Linux kernel from USB drive===&lt;br /&gt;
This method requires a UART to USB adapter that can plug into a host computer. &lt;br /&gt;
There is a 4 pin header on Recore marked '''DBG''', where UART 0 is routed. All u-boot and kernel &lt;br /&gt;
messages will appear here.&lt;br /&gt;
If the eMMC is partitioned and has an OS, u-boot will launch right into that. In order to override that and &lt;br /&gt;
load the boot script from a USB drive, stop u-boot by pressing a key and then write:  &lt;br /&gt;
&lt;br /&gt;
# Download Refactor and flash it to a USB drive&lt;br /&gt;
# Insert the USB drive in the board and apply power&lt;br /&gt;
# When the boot process gets to u-boot, you will see: '''Hit any key to stop autoboot:  '''&lt;br /&gt;
# Hit the Any key. &lt;br /&gt;
# Then write '''run bootcmd_usb0'''&lt;br /&gt;
This will load the U-boot script from the USB drive and use the USB drive as the rootfs.&lt;br /&gt;
&lt;br /&gt;
===Boot Recore from a USB stick using the FEL button===&lt;br /&gt;
If u-boot should be loaded from a host computer and kernel and rootfs is loaded from a USB drive:&lt;br /&gt;
# Flash the Refactor Linux distro to a USB drive. &lt;br /&gt;
# Insert the USB drive in the Recore board.&lt;br /&gt;
# Insert the Recore board in a host computer with the USB-C connector. &lt;br /&gt;
# If the &amp;quot;FEL&amp;quot; button is pressed, the board will go into bootloader mode. &lt;br /&gt;
# Upload SPL, TF-A and u-boot through the USB port:&lt;br /&gt;
# Download the Recore repository https://github.com/intelligent-agent/Recore&lt;br /&gt;
# Install the sunxi-tools program&lt;br /&gt;
# Run '''make fel'''&lt;br /&gt;
You can read more about the steps needed to boot aboard in FEL mode on the Sunxi wiki: https://linux-sunxi.org/FEL&lt;br /&gt;
&lt;br /&gt;
==Upgrading Refactor==&lt;br /&gt;
After upgrading refactor, if the recore board is A5 or older, you can set the device tree to a different version by running the command&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
use-recore-revision a5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After a reboot, you can check that the loaded device tree matches the revision of firmware. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat /sys/firmware/devicetree/base/model&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
It's also worth noting that the klipper configuration is a bit different between the A5 and A6 revisions. The A6 is the now the default configuration, but A5 is also present for use. It can be found on github or on the board. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat /home/debian/klipper/config/generic-recore-a5.cfg&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Upgrading Refactor from OctoPrint===&lt;br /&gt;
The only way to upgrade Refactor is by flashing a new version. In OctoPrint there is a &amp;quot;Refactor&amp;quot; plugin that can aid with this. If Refactor is run from a USB stick, a new version of can be downloaded and flashed on the eMMC.&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Refactor-tab.png]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Upgrading Refactor from the command line===&lt;br /&gt;
To reboot into a USB drive: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set-boot-media usb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then once the board has booted from USB, you can download an image:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
wget https://github.com/intelligent-agent/Refactor/releases/download/v3.0.3-RC5/Refactor-recore-v3.0.3-RC5-2022-01-31.img.xz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once the image has been downloaded you can flash that image to the eMMC:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
flash-recore Refactor-recore-v3.0.3-RC5-2022-01-31.img.xz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Update u-boot on Recore===&lt;br /&gt;
Place u-boot-sunxi-with-spl.bin in sector 15 (8KB offset)  &lt;br /&gt;
Flash the binary &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dd if=u-boot-sunxi-with-spl.bin of=/dev/mmcblk0 bs=1024 seek=8 conv=notrunc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: U-boot needs to be patched in order to use the eMMC as the first (and only) boot device. &lt;br /&gt;
The changes can be done in &amp;quot;spl_mmc_get_device_index&amp;quot; where dev_num should be 0 instead of 1.&lt;br /&gt;
&lt;br /&gt;
===AR100 firmware===&lt;br /&gt;
The ar100 has a binary file that is loaded on startup by klipper.service&lt;br /&gt;
The binary file comes pre-compiled in Refactor, but can be recompiled on Recore (or on a host computer).&lt;br /&gt;
&lt;br /&gt;
====Cross compilation toolchain for ARM64====&lt;br /&gt;
The AR100 needs a cross compilation toolchain. For ARM64, it can be downloaded from feeds.iagent.no:&lt;br /&gt;
&lt;br /&gt;
http://feeds.iagent.no/toolchains/  &lt;br /&gt;
&lt;br /&gt;
The toolchain has been built with  &lt;br /&gt;
&lt;br /&gt;
https://github.com/richfelker/musl-cross-make&lt;br /&gt;
&lt;br /&gt;
GCC version: 9.2.0&lt;br /&gt;
&lt;br /&gt;
====Cross compilation toolchain for x86_64====&lt;br /&gt;
The toolchain used during automatic testing and is the same used for the CRUST firmware project: &lt;br /&gt;
&lt;br /&gt;
https://github.com/crust-firmware/crust#building-the-firmware&lt;br /&gt;
&lt;br /&gt;
====Compiling the ar100 binary====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /opt&lt;br /&gt;
wget http://feeds.iagent.no/toolchains/or1k-linux-musl.tar.xz&lt;br /&gt;
tar xf or1k-linux-musl.tar.xz&lt;br /&gt;
export PATH=$PATH:/opt/output/bin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To configure klipper for AR100 and build the binary:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /home/debian/klipper/&lt;br /&gt;
cp test/configs/ar100.config .config&lt;br /&gt;
make olddefconfig&lt;br /&gt;
make&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will produce a bin file located in out/ar100.bin, so it should be moved to /op/firmware&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mv out/ar100.bin /opt/firmware/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is the same operation that happens from the klipper.service script, so it can also be done by running &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
systemctl restart klipper&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====STM32 firmware====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;alert alert-warning&amp;quot;&amp;gt;&lt;br /&gt;
===='''Note'''====&lt;br /&gt;
The latest Refactor now does automatic flashing of the STM32 firmware on first boot after a fresh install. This was merged with PR#199 in Refactor on Github. &lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The firmware for the stm32f031 mcu that is responsible for ADC &lt;br /&gt;
conversions and PWM for heaters and fans comes pre-installed in the flash of the MCU. &lt;br /&gt;
It can be recreated on the board using the Klipper build system.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /home/debian/klipper&lt;br /&gt;
cp test/configs/stm32f031.config .config&lt;br /&gt;
make menuconfig&lt;br /&gt;
-&amp;gt; Enable extra low-level configuration options&lt;br /&gt;
-&amp;gt; Clock Reference internal&lt;br /&gt;
-&amp;gt; Communication interface (Serial (on USART2 PA15/PA14))&lt;br /&gt;
-&amp;gt; Baud rate for serial port: 38400&lt;br /&gt;
make&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Flashing STM32 firmware====&lt;br /&gt;
To flash the STM32 firmware:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
systemctl stop klipper&lt;br /&gt;
make recoreflash FLASH_DEVICE=/dev/ttyS4&lt;br /&gt;
systemctl start klipper&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Replicape ===&lt;br /&gt;
&lt;br /&gt;
The Replicape images will be meant to run from the micro SD you flash it to. You cannot boot the Replicape from a USB key at this time.&lt;br /&gt;
By default, Refactor images do not flash to the eMMC the way Umikaze used to. Part of this is historical - the early betas of Refactor did not fit on the eMMC, but there's another advantage as well: it allows you to test out Refactor on an SD card while keeping your working Redeem config on the eMMC.&lt;br /&gt;
&lt;br /&gt;
==== Booting Refactor from USB ====&lt;br /&gt;
If you want to boot Refactor from a USB stick, you need to stop u-boot by pressing space during boot. &lt;br /&gt;
You must run these commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
setenv bootpart 0:1; setenv oldroot /dev/sda1; setenv devnum 0; run usb_boot&lt;br /&gt;
&lt;br /&gt;
load ${devtype} ${bootpart} ${loadaddr} /boot/uEnv.txt; env import -t ${loadaddr} ${filesize}&lt;br /&gt;
&lt;br /&gt;
run uname_boot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Running Klipper===&lt;br /&gt;
Klipper is run as a systemd service. It should not normally need to be restarted from the command line, but during development it can be necessary. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
systemctl restart klipper&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The log for Klipper is located in /tmp. It can be viewed as:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tail -f /tmk/klippy.log&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Klipper can also be restarted from the OctoPrint interface. On the &amp;quot;Klipper&amp;quot; tab, press &amp;quot;Firmware&amp;quot; to restart the Klipper firmware. &lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Klipper-firmware-press.png]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Running Toggle===&lt;br /&gt;
Toggle is started automatically by the systemd service toggle.service. A user is created for Toggle on first boot, but the credentials are not set until a user is created in OctoPrint. Once the wizard has been completed, the Toggle user is active, but the credentials will not be valid until OctoPrint is restarted. Therefore, if Toggle is needed, restart OctoPrint after the wizard is complete.&lt;br /&gt;
&lt;br /&gt;
===Running OctoPrint===&lt;br /&gt;
OctoPrint is stated on boot. If there is a need to restart the daemon, use this command&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
systemctl restart octoprint&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Refactor build system=&lt;br /&gt;
&lt;br /&gt;
Refactor uses [https://www.ansible.com/ Ansible] as the underlying framework to describe the desired system state. &lt;br /&gt;
There are many reasons for this:&lt;br /&gt;
&lt;br /&gt;
# Ansible describes the system's end state, not individual actions to perform, so it is relatively easy to port across platforms (i.e. debian, arch, BSD...)&lt;br /&gt;
# The Refactor repository can be updated from the git repository and Ansible will only change what has been updated from the previous version, not needing a complete reinstallation of the system for upgrades.&lt;br /&gt;
# Description of components is modular, making it easy to pick and choose different components for the end goal desired, while keeping each component's setup independent and reliable, and independently updatable.&lt;br /&gt;
&lt;br /&gt;
== Why? ==&lt;br /&gt;
&lt;br /&gt;
The ultimate goal is to have multiple decliations of Refactor, providing the user the ability to choose which firmware/software stack to run on their hardware. The following pre-build declinations are planned:&lt;br /&gt;
* '''OctoPrint, Klipper, Replicape'''&lt;br /&gt;
* '''OctoPrint, Klipper, Recore'''&lt;br /&gt;
* OctoPrint, Klipper, Toggle, Replicape&lt;br /&gt;
* OctoPrint, Klipper, Toggle, Recore&lt;br /&gt;
* Duet Web Control, Klipper, Replicape&lt;br /&gt;
* Duet Web Control, Klipper, Recore&lt;br /&gt;
* OctoPrint, Klipper, Raspberry Pi [1-3]&lt;br /&gt;
* OctoPrint, Klipper, Raspberry Pi 4 (arm64 edition)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''''Only the options in bold''''' have been implemented so far, while the others are undergoing various steps in development in the order shown in this list.&lt;br /&gt;
The Refactor images with OctoPrint are meant to provide drop-in replacements for the previous Umikaze images, including all the extra goodies that were present in Umikaze, like mjpg-streamer, SMB server, and usbreset for the main ones.&lt;br /&gt;
&lt;br /&gt;
The default login is ''root'' with password ''kamikaze''. The system will prompt for an immediate password change, to prevent a massive IoT exploitation through the web. Wouldn't want your printer sending out spam or starting to print unauthorized objects, now would we?&lt;br /&gt;
&lt;br /&gt;
== Building a runnable image for Replicape ==&lt;br /&gt;
&lt;br /&gt;
The [[Replicape_Rev_B | Replicape]] runs on a Beaglebone black (or green, without video output), which has a single core ARM processor running at 1GHz with 512MB of RAM. While impressive for an embedded application, it's rather weak when trying to build a system, which can take a lot of time.&lt;br /&gt;
&lt;br /&gt;
There's a significant time gain when building the image from a more powerful host system, then flashing it to memory from an SD card.&lt;br /&gt;
&lt;br /&gt;
The host system can be any ARM v7 or above architecture machine. In this example, the Raspberry Pi 4 will be used as an example, as it has a quad-core arm64 1.5GHz processor with 1 to 4GB of RAM. Any standard linux platform will do, but you will need a build storage space of at least 5GB for the build to succeed. Using a fast SD or a USB3 flash drive can provide higher disk speeds, reducing build time significantly.&lt;br /&gt;
&lt;br /&gt;
To build an image from Refactor for the Replicape, follow these steps:&lt;br /&gt;
# Browse to a folder on the pi where you wish to run the build&lt;br /&gt;
# Clone the [https://github.com/goeland86/Refactor git repository] for Refactor&lt;br /&gt;
# In the Refactor folder, run the build-image-in-chroot-end-to-end.sh script. It may take some time, so you may want to consider using a screen or byobu session to protect against network drops if you're doing so through SSH.&lt;br /&gt;
# If the build completes successfully, you should be left with a file 'Umikaze-console.img.xz'&lt;br /&gt;
# Use etcher to write the .img.xz file to a micro SD card, insert it into the Beaglebone, power it up and wait for it to power down.&lt;br /&gt;
# Start using the Refactor image on your printer&lt;br /&gt;
&lt;br /&gt;
== Installing a custom software stack with Refactor from a base Debian image ==&lt;br /&gt;
&lt;br /&gt;
At the moment Refactor only supports using a debian-based distribution as a basis. Further down the line it will be refactored so that many more packaging systems are supported - this is not an Ansible limitation, but rather simply a developer time limitation.&lt;br /&gt;
&lt;br /&gt;
The goal for Refactor is to allow the end-user to choose a custom software stack, while making installation of those packages easier. In this case, the user will want to learn how to write a simple Ansible playbook - there are multiple examples available in the Refactor base folder (build_full_klipper_octoprint.yml, install_klipper.yml, any yml file really).&lt;br /&gt;
&lt;br /&gt;
The files starting with &amp;quot;build_full_&amp;quot; are meant to be used for the image building described in the previous section. The files starting with &amp;quot;install_&amp;quot; are designed to be run on a printer platform exclusively - not on a host system.&lt;br /&gt;
&lt;br /&gt;
Each install_ file will install a specific component with its required dependencies. For instance, if you with install toggle, it will also install the Beaglebone's graphics drivers, required for video output, along with a number of libraries that Toggle is reliant on (such as a custom-built libclutter using the framebuffer output instead of the X11 driver).&lt;br /&gt;
&lt;br /&gt;
To install a specific component, make sure that you have installed ansible. Alternatively you can just run the prep_ubuntu.sh script - the only thing it does is make sure that Ansible is ready to execute any further tasks required.&lt;br /&gt;
&lt;br /&gt;
Once Ansible is installed, just run &amp;quot;ansible-playbook install_klipper.yml&amp;quot; for example. Let it run and it will go through to make sure everything is available upon the next reboot.&lt;br /&gt;
&lt;br /&gt;
After all packages have been installed as desired, reboot the system. A reboot is necessary, as depending on the software installed, kernel modules may be enabled / disabled, kernel versions may have changed etc. These are unfortunately not changes that can be done without a reboot.&lt;/div&gt;</summary>
		<author><name>Shufflez</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.iagent.no/mediawiki/index.php?title=Recore_A6&amp;diff=586</id>
		<title>Recore A6</title>
		<link rel="alternate" type="text/html" href="https://wiki.iagent.no/mediawiki/index.php?title=Recore_A6&amp;diff=586"/>
		<updated>2022-02-04T08:09:07Z</updated>

		<summary type="html">&lt;p&gt;Shufflez: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Recore header.png]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Recore is a 3D-printer control board running Linux. It is specifically tailored to be compatible with Klipper and OctoPrint. The main features are: &lt;br /&gt;
* Allwinner A64 SoC, quad core CPU running at 1 GHz. &lt;br /&gt;
* 1 GB of DDR3 RAM&lt;br /&gt;
* 8 GB of on board eMMC &lt;br /&gt;
* Gigabit Ethernet&lt;br /&gt;
* 6 TMC2209, 2 A stepper motor drivers&lt;br /&gt;
* 3 heater outputs + high power heated bed&lt;br /&gt;
* 4 USB High Speed ports &lt;br /&gt;
* 4 thermistor/thermocouple inputs (software selectable)&lt;br /&gt;
* Comes with Debian Linux with Klipper and OctoPrint installed&lt;br /&gt;
&lt;br /&gt;
This document is for Recore Revision A6. For previous hardware revisions, please see:  &lt;br /&gt;
* [[Recore_A5]]&lt;br /&gt;
* [[Recore_A4]]&lt;br /&gt;
* [[Recore_A3]]  &lt;br /&gt;
* [[Recore_A2]]&lt;br /&gt;
&lt;br /&gt;
=Pinout=&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Pinout A6-2.png]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
==A64==&lt;br /&gt;
In the following table the pins used for End-stops and stepper control are described. &lt;br /&gt;
The &amp;quot;bank and pin&amp;quot; can be used to specify the pin numbers in klipper. &lt;br /&gt;
The &amp;quot;Number&amp;quot; column is useful for testing things on the command line in conjunction with gpiod.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
!Name&lt;br /&gt;
!Bank and pin&lt;br /&gt;
!style=&amp;quot;border-right:solid 2px;&amp;quot;| Number&lt;br /&gt;
!Name&lt;br /&gt;
!Bank and pin&lt;br /&gt;
!style=&amp;quot;border-right:solid 2px;&amp;quot;| Number&lt;br /&gt;
!Name&lt;br /&gt;
!Bank and pin&lt;br /&gt;
!Number&lt;br /&gt;
|-&lt;br /&gt;
|END STOP 0&lt;br /&gt;
|PH4&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|228&lt;br /&gt;
|DIR 6&lt;br /&gt;
|PE14&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|142&lt;br /&gt;
|USB-PWR-EN-0&lt;br /&gt;
|PH0&lt;br /&gt;
|224&lt;br /&gt;
|-&lt;br /&gt;
|END STOP 1&lt;br /&gt;
|PH5&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|229&lt;br /&gt;
|DIR 7&lt;br /&gt;
|PE15&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|143&lt;br /&gt;
|USB-PWR-EN-1&lt;br /&gt;
|PH1&lt;br /&gt;
|225&lt;br /&gt;
|-&lt;br /&gt;
|END STOP 2&lt;br /&gt;
|PH6&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|230&lt;br /&gt;
|STEP DIAG 0&lt;br /&gt;
|PE0&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|128&lt;br /&gt;
|USB-PWR-EN-2&lt;br /&gt;
|PH2&lt;br /&gt;
|226&lt;br /&gt;
|-&lt;br /&gt;
|END STOP 3&lt;br /&gt;
|PH7&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|231&lt;br /&gt;
|STEP DIAG 1&lt;br /&gt;
|PE1&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|129&lt;br /&gt;
|USB-PWR-EN-3&lt;br /&gt;
|PH3&lt;br /&gt;
|227&lt;br /&gt;
|-&lt;br /&gt;
|END STOP 4&lt;br /&gt;
|PH8&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|232&lt;br /&gt;
|STEP DIAG 2&lt;br /&gt;
|PE2&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|130&lt;br /&gt;
|GAIN-ENABLE-T0&lt;br /&gt;
|PD4&lt;br /&gt;
|100&lt;br /&gt;
|-&lt;br /&gt;
|END STOP 5&lt;br /&gt;
|PH9&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|233&lt;br /&gt;
|STEP DIAG 3&lt;br /&gt;
|PE3&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|131&lt;br /&gt;
|GAIN-ENABLE-T1&lt;br /&gt;
|PH11&lt;br /&gt;
|235&lt;br /&gt;
|-&lt;br /&gt;
|STEP 0&lt;br /&gt;
|PL4&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|4&lt;br /&gt;
|STEP DIAG 4&lt;br /&gt;
|PE4&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|132&lt;br /&gt;
|GAIN ENABLE T2&lt;br /&gt;
|PE17&lt;br /&gt;
|145&lt;br /&gt;
|-&lt;br /&gt;
|STEP 1&lt;br /&gt;
|PL5&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|5&lt;br /&gt;
|STEP DIAG 5&lt;br /&gt;
|PE5&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|133&lt;br /&gt;
|GAIN ENABLE T3&lt;br /&gt;
|PB2&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|STEP 2&lt;br /&gt;
|PL6&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|6&lt;br /&gt;
|STEP DIAG 6&lt;br /&gt;
|PE6&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|134&lt;br /&gt;
|PU-ENABLE-T0&lt;br /&gt;
|PG10&lt;br /&gt;
|202&lt;br /&gt;
|-&lt;br /&gt;
|STEP 3&lt;br /&gt;
|PL7&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|7&lt;br /&gt;
|STEP DIAG 7&lt;br /&gt;
|PE7&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|135&lt;br /&gt;
|PU-ENABLE-T1&lt;br /&gt;
|PG11&lt;br /&gt;
|203&lt;br /&gt;
|-&lt;br /&gt;
|STEP 4&lt;br /&gt;
|PL8&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|8&lt;br /&gt;
|OC-ALERT&lt;br /&gt;
|PF6&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|166&lt;br /&gt;
|PU ENABLE T2&lt;br /&gt;
|PG12&lt;br /&gt;
|204&lt;br /&gt;
|-&lt;br /&gt;
|STEP 5&lt;br /&gt;
|PL9&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|9&lt;br /&gt;
|OC-RESET&lt;br /&gt;
|PF4&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|164&lt;br /&gt;
|PU ENABLE T3&lt;br /&gt;
|PG13&lt;br /&gt;
|205&lt;br /&gt;
|-&lt;br /&gt;
|STEP 6&lt;br /&gt;
|PL10&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|10&lt;br /&gt;
|EN-HP&lt;br /&gt;
|PF5&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|165&lt;br /&gt;
|OFFSET-T0&lt;br /&gt;
|PG0&lt;br /&gt;
|192&lt;br /&gt;
|-&lt;br /&gt;
|STEP 7&lt;br /&gt;
|PL11&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|11&lt;br /&gt;
|UC-INT-1&lt;br /&gt;
|PG3&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|195&lt;br /&gt;
|OFFSET-T1&lt;br /&gt;
|PG1&lt;br /&gt;
|193&lt;br /&gt;
|-&lt;br /&gt;
|DIR 0&lt;br /&gt;
|PE8&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|136&lt;br /&gt;
|UC-NRST&lt;br /&gt;
|PG4&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|196&lt;br /&gt;
|OFFSET-T2&lt;br /&gt;
|PG3&lt;br /&gt;
|194&lt;br /&gt;
|-&lt;br /&gt;
|DIR 1&lt;br /&gt;
|PE9&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|137&lt;br /&gt;
|UC-BOOT&lt;br /&gt;
|PG5&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|197&lt;br /&gt;
|OFFSET-T3&lt;br /&gt;
|PG8&lt;br /&gt;
|200&lt;br /&gt;
|-&lt;br /&gt;
|DIR 2&lt;br /&gt;
|PE10&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|138&lt;br /&gt;
|ES-EN-12V&lt;br /&gt;
|PF0&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|160&lt;br /&gt;
|STEPPER UART 2 TX&lt;br /&gt;
|PB0&lt;br /&gt;
|32&lt;br /&gt;
|-&lt;br /&gt;
|DIR 3&lt;br /&gt;
|PE11&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|139&lt;br /&gt;
|EN-HDMI-PWR&lt;br /&gt;
|PG9&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|201&lt;br /&gt;
|STEPPER UART 2 RX&lt;br /&gt;
|PB1&lt;br /&gt;
|33&lt;br /&gt;
|-&lt;br /&gt;
|DIR 4&lt;br /&gt;
|PE12&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|140&lt;br /&gt;
|EN-THERMISTORS&lt;br /&gt;
|PF1&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|161&lt;br /&gt;
|STEPPER UART 3 TX&lt;br /&gt;
|PD0&lt;br /&gt;
|96&lt;br /&gt;
|-&lt;br /&gt;
|DIR 5&lt;br /&gt;
|PE13&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|141&lt;br /&gt;
|EN-ENDSTOPS&lt;br /&gt;
|PF2&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|162&lt;br /&gt;
|STEPPER UART 3 RX&lt;br /&gt;
|PD1&lt;br /&gt;
|97&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==STM32F031==&lt;br /&gt;
The STM32 is a Cortex M0 powered micro controller handling analog inputs and PWM outputs. It does not control any hard real time aspects of the print, that is handled by the AR100 core realized as a separate core in the A64 SoC. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
!Name&lt;br /&gt;
!Bank and pin&lt;br /&gt;
!style=&amp;quot;border-right:solid 2px;&amp;quot;| Number&lt;br /&gt;
!Name&lt;br /&gt;
!Bank and pin&lt;br /&gt;
!style=&amp;quot;border-right:solid 2px;&amp;quot;| Number&lt;br /&gt;
!Name&lt;br /&gt;
!Bank and pin&lt;br /&gt;
!Number&lt;br /&gt;
|-&lt;br /&gt;
|THERMISTOR 0&lt;br /&gt;
|PA0&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|6&lt;br /&gt;
|HEATER E0&lt;br /&gt;
|PA8&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|18&lt;br /&gt;
|FAN 0&lt;br /&gt;
|PB0&lt;br /&gt;
|14&lt;br /&gt;
|-&lt;br /&gt;
|THERMISTOR 1&lt;br /&gt;
|PA1&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|7&lt;br /&gt;
|HEATER E1&lt;br /&gt;
|PA9&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|19&lt;br /&gt;
|FAN 1&lt;br /&gt;
|PB1&lt;br /&gt;
|15&lt;br /&gt;
|-&lt;br /&gt;
|THERMISTOR 2&lt;br /&gt;
|PA2&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|8&lt;br /&gt;
|HEATER E2&lt;br /&gt;
|PA10&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|20&lt;br /&gt;
&lt;br /&gt;
|ES1-PWM-OUT&lt;br /&gt;
|PB3&lt;br /&gt;
|26&lt;br /&gt;
|-&lt;br /&gt;
|THERMISTOR 3&lt;br /&gt;
|PA3&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|9&lt;br /&gt;
|HEATER BED&lt;br /&gt;
|PA11&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|21&lt;br /&gt;
|FAN 3&lt;br /&gt;
|PB4&lt;br /&gt;
|27&lt;br /&gt;
|-&lt;br /&gt;
|BOARD VOLTAGE&lt;br /&gt;
|PA4&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|10&lt;br /&gt;
|USER LED&lt;br /&gt;
|PA12&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|22&lt;br /&gt;
|FAN 2&lt;br /&gt;
|PB5&lt;br /&gt;
|28&lt;br /&gt;
|-&lt;br /&gt;
|BOARD CURRENT&lt;br /&gt;
|PA5&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|11&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|&lt;br /&gt;
|PWM-ES2-OUT&lt;br /&gt;
|PB6&lt;br /&gt;
|29&lt;br /&gt;
|-&lt;br /&gt;
|BOARD TEMPERATURE&lt;br /&gt;
|PA6&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|12&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|&lt;br /&gt;
|EXT 1&lt;br /&gt;
|PB7&lt;br /&gt;
|30&lt;br /&gt;
|-&lt;br /&gt;
|COLD JUNCTION&lt;br /&gt;
|PA7&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|13&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|&lt;br /&gt;
|EXT 2&lt;br /&gt;
|PB8&lt;br /&gt;
|32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==DBG header==&lt;br /&gt;
This header is used for interacting with u-boot and getting early debug messages from the Linux kernel&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pin&lt;br /&gt;
!Function&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|UART RX&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|UART TX&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|NC&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|GND&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==MCU header==&lt;br /&gt;
This header is used for connecting additional MCU peripherals. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pin&lt;br /&gt;
!Function&lt;br /&gt;
!Alt&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|PB7&lt;br /&gt;
|I2C1_SDA&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|PB8&lt;br /&gt;
|I2C1_SCL&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|3.3V&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|GND&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===LEDs===&lt;br /&gt;
There are 15 white LEDs on the board. Here is what they mean&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Name&lt;br /&gt;
!Location&lt;br /&gt;
!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|D2&lt;br /&gt;
|By PMIC&lt;br /&gt;
|Board powered&lt;br /&gt;
|-&lt;br /&gt;
|D3&lt;br /&gt;
|By heater BED &lt;br /&gt;
|BED output on&lt;br /&gt;
|-&lt;br /&gt;
|D4&lt;br /&gt;
|By fan 0&lt;br /&gt;
|Fan 0 is on&lt;br /&gt;
|-&lt;br /&gt;
|D5&lt;br /&gt;
|By fan 1&lt;br /&gt;
|Fan 1 is on&lt;br /&gt;
|-&lt;br /&gt;
|D6&lt;br /&gt;
|By heater H2&lt;br /&gt;
|Heater H2 is on&lt;br /&gt;
|-&lt;br /&gt;
|D7&lt;br /&gt;
|By fan 2&lt;br /&gt;
|Fan 2 is on&lt;br /&gt;
|-&lt;br /&gt;
|D8&lt;br /&gt;
|By heater H0&lt;br /&gt;
|Heater H0 is on&lt;br /&gt;
|-&lt;br /&gt;
|D9&lt;br /&gt;
|By fan 3&lt;br /&gt;
|Fan 3 is on&lt;br /&gt;
|-&lt;br /&gt;
|D10&lt;br /&gt;
|By heater H1&lt;br /&gt;
|Heater H1 is on&lt;br /&gt;
|-&lt;br /&gt;
|D12&lt;br /&gt;
|By input connector&lt;br /&gt;
|High voltage domain is on&lt;br /&gt;
|-&lt;br /&gt;
|D15&lt;br /&gt;
|By eMMC chip&lt;br /&gt;
|eMMC activity&lt;br /&gt;
|-&lt;br /&gt;
|D17&lt;br /&gt;
|By HDMI connector&lt;br /&gt;
|USB activitiy&lt;br /&gt;
|-&lt;br /&gt;
|D18&lt;br /&gt;
|By the USB C connector&lt;br /&gt;
|Linux Heartbeat&lt;br /&gt;
|-&lt;br /&gt;
|D19&lt;br /&gt;
|By the A64 SoC&lt;br /&gt;
|CPU activity&lt;br /&gt;
|-&lt;br /&gt;
|D20&lt;br /&gt;
|By the STM32&lt;br /&gt;
|Klipper running on STM32&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
There are 3 push buttons on the board. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Name&lt;br /&gt;
!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|FEL&lt;br /&gt;
|Enter FEL-mode of the A64&lt;br /&gt;
|-&lt;br /&gt;
|BOOT&lt;br /&gt;
|Boots or shuts down the board&lt;br /&gt;
|-&lt;br /&gt;
|RESET&lt;br /&gt;
|Hard reset of the CPU&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Current limits==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Name&lt;br /&gt;
!Limit&lt;br /&gt;
|-&lt;br /&gt;
|5V-ES&lt;br /&gt;
|1 A&lt;br /&gt;
|-&lt;br /&gt;
|USB host each&lt;br /&gt;
|1 A&lt;br /&gt;
|-&lt;br /&gt;
|Thermistors&lt;br /&gt;
|1 A&lt;br /&gt;
|-&lt;br /&gt;
|MCU connector&lt;br /&gt;
|0.5 A&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Wiring=&lt;br /&gt;
Below is a wiring diagram meant to aid in connecting motors, fans, extruders and hot ends to the control board. On the board, there is a small + sign next to output connectors where polarity is important. If passive heating elements are used, polarity is not important, but if those outputs are to be used with SSRs or relays, polarity must be observed. &lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Recore-wire-diagram-2.2.png]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Network connection==&lt;br /&gt;
Recore is designed to be controlled through a browser on a computer, so the board must be connected to the local LAN or wifi network. Connect an ethernet cable between the board and a switch. The ping utility can be used to ensure that the board is discovered on the network.&lt;br /&gt;
&lt;br /&gt;
===LAN setup===&lt;br /&gt;
Recore with Refactor is running avahi and should announce itself on the network once a connection has been established. On a Linux based host computer, it is possible to search for a booted device using the following command: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ping recore.local&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If the device is present, an SSH connection can be established:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ssh root@recore.local&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Furthermore, a web interface running OctoPrint can be found using a browser:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
http://recore.local&lt;br /&gt;
&lt;br /&gt;
==Wifi setup==&lt;br /&gt;
Wifi can be set up by connecting a wifi dongle to one of the USB host ports. Once the uSB dongle has been connected, and the board has been booted, access to the terminal command line can be given through a host computer. The board should appear as a TTY ACM device. On a Linux based host computer, the terminal program `screen` can be used to get access. From the host computer&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
screen /dev/ttyACM0 115200&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the host computer is running Windows, [https://www.putty.org/ Putty] can be used to get access. &lt;br /&gt;
&lt;br /&gt;
Once a connection has been established, the wifi network can be set up using the command nmtui. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nmtui&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Follow the instructions on screen to edit and activate the wifi connection. &lt;br /&gt;
&amp;lt;div class=&amp;quot;alert alert-warning&amp;quot;&amp;gt;&lt;br /&gt;
===='''Note'''====&lt;br /&gt;
If the board is powered through the USB C connector, only the two USB host ports next to the HDMI port is powered. &lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mating Connectors==&lt;br /&gt;
The power connectors on the board are available either in the web shop as part of a [https://www.iagent.no/product/connector-pack/ connector pack] or directly from Digi-key etc.&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt; &lt;br /&gt;
[[File:Connectors-all.png]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Four pin male: TBP01P1-508-04BE [[https://www.digikey.com/en/products/detail/cui-devices/TBP01P1-508-04BE/10238369 | Digi-key]]&lt;br /&gt;
&lt;br /&gt;
Two pin male: TBP01P1-508-02BE [[https://www.digikey.com/en/products/detail/cui-devices/TBP01P1-508-02BE/10238367 | Digi-key]]&lt;br /&gt;
&lt;br /&gt;
=Configuration=&lt;br /&gt;
There are no jumpers on Recore and no hard fuses. Everything is software configurable and resettable from software. This gives great power and flexibility without requiring physical access to the board once it has been installed. But with great power comes great responsibility. It is possible to break things if care is not taken during setup. There is one setting in particular that is worth mentioning: ES0 can have either +5V or +12V on the power pin. This is in order to allow a standard industrial inductive sensor to be used on that end stop. If a 5V only peripheral is connected, that could damage the connected peripheral. &lt;br /&gt;
&lt;br /&gt;
The default config file for Recore A6 can be found in the repository: [https://github.com/intelligent-agent/klipper/blob/master/config/generic-recore.cfg generic-recore.cfg]&lt;br /&gt;
&lt;br /&gt;
===TMC2209===&lt;br /&gt;
The 6 stepper drivers on Recore are of type TMC2209 from Trinamic. Each stepper has a configuration interface with a bidirectional UART port that is connected to a peripheral UART on the A64. The peripheral is not in use, but instead the GPIO bit-banging functionality of Klipper is used to communicate with the stepper drivers. &lt;br /&gt;
&lt;br /&gt;
Here is a table with pins and addresses for the steppers&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Stepper driver config&lt;br /&gt;
|-&lt;br /&gt;
|Name&lt;br /&gt;
|Pins&lt;br /&gt;
|Address&lt;br /&gt;
|-&lt;br /&gt;
|S0&lt;br /&gt;
|PB0/PB1&lt;br /&gt;
|0&lt;br /&gt;
|-&lt;br /&gt;
|S1&lt;br /&gt;
|PB0/PB1&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|S2&lt;br /&gt;
|PB0/PB1&lt;br /&gt;
|2&lt;br /&gt;
|-&lt;br /&gt;
|S3&lt;br /&gt;
|PB0/PB1&lt;br /&gt;
|3&lt;br /&gt;
|-&lt;br /&gt;
|S4&lt;br /&gt;
|PD0/PD1&lt;br /&gt;
|0&lt;br /&gt;
|-&lt;br /&gt;
|S5&lt;br /&gt;
|PD0/PD1&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|S6&lt;br /&gt;
|PD0/PD1&lt;br /&gt;
|2&lt;br /&gt;
|-&lt;br /&gt;
|S7&lt;br /&gt;
|PD0/PD1&lt;br /&gt;
|3&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Temperature inputs==&lt;br /&gt;
4 different temperature devices can be connected to the 4 analog inputs on Recore. Thermistor, Thermocouple, PT100 with INA826 and PT1000 without the use of a pre-amplifier.&lt;br /&gt;
===Thermistor===&lt;br /&gt;
Make sure the pull-up is enabled and the op-amp gain is set to 1. &lt;br /&gt;
===Thermocouple===&lt;br /&gt;
Make sure the pull-up is disabled and the op-amp gain is set to 100.&lt;br /&gt;
===PT100 with INA826===&lt;br /&gt;
In order to use a PT100 sensor, an external amplifier board must be used. There is an example configuration for Klipper that &lt;br /&gt;
uses this. The ADC reference voltage is 5.0 by default, but for Recore it is 3.3 V. Here is an example:  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Extruder]&lt;br /&gt;
...&lt;br /&gt;
sensor_type: PT100 INA826&lt;br /&gt;
adc_voltage: 3.27&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The pull-up must also be disabled.&lt;br /&gt;
&lt;br /&gt;
===PT1000===&lt;br /&gt;
Make sure the pull-up is enabled and the gain is set to 1. In the latest version, the sensor must be prefixed with RECORE. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Extruder]&lt;br /&gt;
...&lt;br /&gt;
sensor_type: RECORE PT1000&lt;br /&gt;
adc_voltage: 3.27&lt;br /&gt;
pullup_voltage: 3.3&lt;br /&gt;
offset_voltage: 3.2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Connecting other sensors=&lt;br /&gt;
The board has been designed to work with a range of 3rd party sensors for automating the print.&lt;br /&gt;
==BLtouch==&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:BLtouch sensor wiring.png]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
When connected per wiring diagram above, setting up BLtouch can be done by adding the following section to printer.cfg.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[bltouch]&lt;br /&gt;
sensor_pin: ^ar100:PH6&lt;br /&gt;
control_pin: PH5&lt;br /&gt;
speed: 7&lt;br /&gt;
pin_move_time: 0.675&lt;br /&gt;
sample_retract_dist: 10&lt;br /&gt;
pin_up_reports_not_triggered: True&lt;br /&gt;
pin_up_touch_mode_reports_triggered: True&lt;br /&gt;
#Please change offsets below for your specific setup (these values are for EVA2.3.x BLtouch mount)&lt;br /&gt;
z_offset: 2.22&lt;br /&gt;
x_offset: -28 &lt;br /&gt;
y_offset: -13&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Inductive Sensor ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Inductive sensor wiring 2.png]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Connect the inductive sensor on ES0. You can choose either 5V or 12V output on the voltage pin.&lt;br /&gt;
&lt;br /&gt;
==ADXL345==&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt; &lt;br /&gt;
[[File:Wiring.png]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
A popular accelerometer sensor for doing input shaping with Klipper is the ADXL345. This can be connected to the connectors S6/S7. There is no hardware SPI interface available, but a software implementation in Klipper exists. &lt;br /&gt;
Note: Only experimental support has been tested for this. &lt;br /&gt;
https://learn.adafruit.com/adxl345-digital-accelerometer&lt;br /&gt;
&lt;br /&gt;
==RC Servo==&lt;br /&gt;
Endstop 1 and 2 can be used as PWM outputs with 5V levels. Rev A6 is the first board with support for this. &lt;br /&gt;
More testing and configuration documentation is needed.&lt;br /&gt;
&lt;br /&gt;
=Software for Recore=&lt;br /&gt;
Recore comes with the Linux distro Refactor (Armbian) pre-installed on the eMMC. &lt;br /&gt;
For more instructions about software for Recore, see the Refactor wiki page: &lt;br /&gt;
[[ Refactor#Recore ]]&lt;br /&gt;
&lt;br /&gt;
=== AR100 ===&lt;br /&gt;
Please see: [[AR100]]&lt;br /&gt;
&lt;br /&gt;
=Manual control and testing=&lt;br /&gt;
All functions on Recore are meant to be controlled from a graphical user interface such as OctoPrint, Fluid, Mainsail etc. This in turn in controlled by Klipper. Sometimes it can be beneficial to get low level access to certain functions and test things directly on the command line. This section is meant to give an overview of what capabilites are available from the command line (SSH/terminal).&lt;br /&gt;
&lt;br /&gt;
===Power domain overview===&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Power domain overview.png]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Power domains====&lt;br /&gt;
There are 9 power domains around the board controlling voltage on different pins: &lt;br /&gt;
* &amp;lt;b&amp;gt;Input power&amp;lt;/b&amp;gt; controls power to 4 high power outputs, the 4 fans and the 6 stepper drivers. This input has current monitoring, fast acting over current protection, voltage monitoring, temperature monitoring and reverse polarity protection.&lt;br /&gt;
* &amp;lt;b&amp;gt;Thermo couple power&amp;lt;/b&amp;gt; Controls +5V/1A output to the ADCs. This can be used for turning on power to the analog pins. &lt;br /&gt;
* &amp;lt;b&amp;gt;End stop power&amp;lt;/b&amp;gt; Controls +5V/1A output on the six endstops. Ganged. ES5 can be switched to have 12V output. The 12V output has a &lt;br /&gt;
100mA internal current limit. &lt;br /&gt;
* &amp;lt;b&amp;gt;4 USB host power domains&amp;lt;/b&amp;gt; Controls 5V/1A current output to the usb host connectors. These are turned on by u-boot.&lt;br /&gt;
*&amp;lt;b&amp;gt;HDMI 5V output&amp;lt;/b&amp;gt; Controls the 5V/1A HDMI output. Turned on by u-boot. &lt;br /&gt;
&lt;br /&gt;
====Input stage====&lt;br /&gt;
Reset over current protection and set it in &amp;quot;one-shot&amp;quot; mode.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gpioset 1 164=0&lt;br /&gt;
gpioset 1 164=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The over current protection can also be set in &amp;quot;transparent&amp;quot; mode, where the current alarm &lt;br /&gt;
will be reset automatically. Note that this is a bad idea for general operation, only use for testing. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gpioset 1 164=0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable 24V input&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gpioset 1 165=0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====End stop 5V /12V====&lt;br /&gt;
End stop 0 to 4 has a programmable +5V output voltage. &lt;br /&gt;
End stop 5 has +5V or +12V selectable.&lt;br /&gt;
&lt;br /&gt;
To enable +5V on ES 0...4&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gpioset 1 162=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To disable again&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gpioset 1 162=0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To switch to 12V output on ES5&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gpioset 1 160=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To disable again&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gpioset 1 160=0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====End stops values====&lt;br /&gt;
To see what value the end stops have&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gpioget 1 228 # ES 5&lt;br /&gt;
gpioget 1 229&lt;br /&gt;
gpioget 1 230&lt;br /&gt;
gpioget 1 231&lt;br /&gt;
gpioget 1 232&lt;br /&gt;
gpioget 1 233 # ES 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TMC2209====&lt;br /&gt;
In window/shell 1:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
stty -F /dev/ttyS2 raw -echoe -echo&lt;br /&gt;
xxd -c 4 /dev/ttyS2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In window/shell 2:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo -n -e '\x5\x0\x6\x6F' &amp;gt; /dev/ttyS2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The return should be along the lines of&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00000000: 0500 066f  ...o&lt;br /&gt;
00000004: 05ff 0620  ... &lt;br /&gt;
00000008: 0001 4058  ..@X&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To check that no errors are reported by the steppers write this on the command line. If a &amp;quot;1&amp;quot; shows up, that is an indication that the motor is reporting an error. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gpioget 1 128&lt;br /&gt;
gpioget 1 129&lt;br /&gt;
gpioget 1 130&lt;br /&gt;
gpioget 1 131&lt;br /&gt;
gpioget 1 132&lt;br /&gt;
gpioget 1 133&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== STM32F031 ====&lt;br /&gt;
There is a small firmware to test all functionality that is controlled by the STM32F031 chip on the board. &lt;br /&gt;
Once uploaded to the board using the flash script, the firmware will turn on all LEDs it controls and send &lt;br /&gt;
back ADC readings. &lt;br /&gt;
&lt;br /&gt;
To flash this firmware to the STM32:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gpioset 1 197=1&lt;br /&gt;
gpioset 1 196=0&lt;br /&gt;
stm32flash -i -196,196 -w Sumato-f031.bin -v -g 0x00 /dev/ttyS1&lt;br /&gt;
gpioset 1 197=0&lt;br /&gt;
stm32flash -i -196,196 /dev/ttyS1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To see the ADC readings: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
stty -F /dev/ttyS3 38400 raw&lt;br /&gt;
cat /dev/ttyS3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You should see something like&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ADC T0: 0&lt;br /&gt;
ADC T1: 0&lt;br /&gt;
ADC T2: 0&lt;br /&gt;
ADC T3: 0&lt;br /&gt;
ADC U: 2338&lt;br /&gt;
ADC I: 0&lt;br /&gt;
ADC TB: 3417&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following one-liners assumes gawk is installed.&lt;br /&gt;
&lt;br /&gt;
===Reading Current===&lt;br /&gt;
There is board current reading implemented in OctoPrint. &lt;br /&gt;
The current shunt resistor is 1 mOhm, the amplifier is 20 times, the vref is 3.3V, so we get:&lt;br /&gt;
(adc_val/4096*3.3)*1000/20 = (adc_val/4096)*165&lt;br /&gt;
&lt;br /&gt;
If the testing firmware is installed on the STM32, you can convert the current (as in amps) reading to something useful like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat /dev/ttyS4 | awk '/I:/ { printf &amp;quot;scale=4; (%i/4096)*165\n&amp;quot;, $3; fflush(); }' | bc -l&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Current limit programming====&lt;br /&gt;
The current limit must be set in the device tree by programming the voltage &lt;br /&gt;
on dldo2. dldo2 can have values from 0.7 V to 3.4 V. Setting the voltage level to 3.4 V effectively &lt;br /&gt;
disables the fast acting current limit. Setting it to the lowest value gives an over current limit of 35 A.&lt;br /&gt;
&lt;br /&gt;
===Reading Board Temperature===&lt;br /&gt;
To see the temperature readings, try this : &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export beta=4327&lt;br /&gt;
cat /dev/ttyS1 | awk '/TB:/ { printf &amp;quot;scale=4; 4327/l( (4700/((3.3/(3.3*%i/4096))-1.0))/0.05306820342563400000) -273.15\n&amp;quot;, $3; fflush(); }' | bc -l | awk '{print strftime(&amp;quot;%k:%M:%S&amp;quot;), $0; fflush();}'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Reading Input Voltage===&lt;br /&gt;
To see voltage on the input, it can be converted like this: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
exec 4&amp;lt;/dev/ttyS4 5&amp;gt;/dev/ttyS4&lt;br /&gt;
echo -n &amp;quot;;A4;&amp;quot; &amp;gt;&amp;amp;5&lt;br /&gt;
read -t1 reply &amp;lt;&amp;amp;4&lt;br /&gt;
echo $reply | awk '{ printf &amp;quot;scale=4; (%i/4096)*3.3*((100+10)/10)\n&amp;quot;, $4; fflush(); }' | bc -l&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Thermistor inputs===&lt;br /&gt;
To enable pull-up on input for using thermistors for temperature measurements: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gpioset 1 102=1&lt;br /&gt;
gpioset 1 120=1&lt;br /&gt;
gpioset 1 160=1&lt;br /&gt;
gpioset 1 161=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Setting Op-amp gain to 1:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gpioget 1 100&lt;br /&gt;
gpioget 1 235&lt;br /&gt;
gpioget 1 145&lt;br /&gt;
gpioget 1 34&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the device tree file, the gpio/ldos must be set to gpio input:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;amp;gpio0_ldo {&lt;br /&gt;
  function = &amp;quot;gpio_in&amp;quot;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Thermocouple input===&lt;br /&gt;
Either a thermocouple or a thermistor can be used as input on the &lt;br /&gt;
T0-T3 inputs. &lt;br /&gt;
====Bias====&lt;br /&gt;
The thermocouple is set up to have a Bias of 0.7V/100 on the input which enables negative &lt;br /&gt;
values (lower than the board temperature) as input to the ADCs. &lt;br /&gt;
With the input short circuited, the bias can be recorded. Typical values are 750&lt;br /&gt;
This needs to be subtracted from the result.&lt;br /&gt;
====Cold junction compensation====&lt;br /&gt;
Another important aspect is cold junction compensation. &lt;br /&gt;
There is a thermistor connected on the board close to the thermocouple inputs&lt;br /&gt;
which can be used to measure the temperature close to the input junction. &lt;br /&gt;
This temperature must be added in software.&lt;br /&gt;
&lt;br /&gt;
The connected thermistor is a TDK [https://product.tdk.com/info/en/catalog/datasheets/503021/tpd_commercial_ntc-thermistor_ntcg_en.pdf NTCG104EF104FT1X]&lt;br /&gt;
The connected Thermocouple has a (25/100) beta value of 4327. &lt;br /&gt;
&lt;br /&gt;
In order to use the inputs for thermocouple, the pull-up-down resistors must be set to pull-down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gpioset 1 102=0&lt;br /&gt;
gpioset 1 120=0&lt;br /&gt;
gpioset 1 160=0&lt;br /&gt;
gpioset 1 161=0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, the op-amp needs a gain of 100:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gpioset 1 100=0&lt;br /&gt;
gpioset 1 235=0&lt;br /&gt;
gpioset 1 145=0&lt;br /&gt;
gpioset 1 34=0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, the input bias needs to be enabled. The following LDOs needs to be enabled:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
reg_ldo_io0&lt;br /&gt;
reg_ldo_io1&lt;br /&gt;
reg_dldo3&lt;br /&gt;
reg_dldo4&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Performance=&lt;br /&gt;
==Start-up time==&lt;br /&gt;
With a maximum clock for MMC2 of 200 MHz, here is the start-up time: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root@recore-3:~# systemd-analyze &lt;br /&gt;
Startup finished in 5.128s (kernel) + 11.567s (userspace) = 16.695s &lt;br /&gt;
graphical.target reached after 11.421s in userspace&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Measured voltages==&lt;br /&gt;
The final stages of Recore manufacturing consists of testing, calibration and flashing of firmware. &lt;br /&gt;
The calibration stage measures a number of voltages on the board and classifies the input stages gain and offset. &lt;br /&gt;
Instruments used: &lt;br /&gt;
* HP 3458A, 8.5 digit multimeter&lt;br /&gt;
* HP 3245A, Universal Source &lt;br /&gt;
&lt;br /&gt;
====Microcontroller voltages====&lt;br /&gt;
VDDA uC: 3.312 V&amp;lt;br&amp;gt;&lt;br /&gt;
VDD uC: 3.312 V&lt;br /&gt;
&lt;br /&gt;
Voltage from the PMIC supplied as bias:&amp;lt;br&amp;gt;&lt;br /&gt;
0.706 V &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====5V Buck converter ripple and noise ====&lt;br /&gt;
The 5V step down/Buck converter is a AOZ2151PQI-10. It can provide 4A and has an input voltage range of 12-28V. &lt;br /&gt;
It is hard wired to be in PWM mode. PFM mode results in a loud whine.&lt;br /&gt;
&lt;br /&gt;
Below is a screenshot of the ripple and noise across the  the 5V rail with a normal kernel running. &lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:VCC-5V-ripple-A4.png]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Input stage===&lt;br /&gt;
An experiment with a constant current load drawing 20 A from the bed connector with and without a 92 mm fan on top of the board for forced convection. The temperature measured was with the on board thermistor. Using a thermal camera, the temperature displayed matches well with the temperature reported by the camera. However, in Rev A2, this is not the hottest point on the board. The MOSFET controlling the bed seems to consistently get the highest temperature. The reason for this is probably due to a 3.3 V VGS. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File: Temperature-fan-off.pdf.png]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Temperature-fan.pdf.png]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Inrush current====&lt;br /&gt;
During turn on of the high power stage, there will be an inrush current to charge up the bank of capacitors present on the board. &lt;br /&gt;
If no loads are turned on, the inrush current reaches 31 A at peak. This is important to consider when setting the current limit with device tree. &lt;br /&gt;
&lt;br /&gt;
Todo: These measurements are from rev A3. Redo measurements with Rev A6. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Inrush current A3.png]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Temperature low pass filter===&lt;br /&gt;
A Low pass filter has been added on each of the temperature input channels. The cut-off frequency is below what my oscilloscope can handle, but a plot in the time domain verifies a 7 Hz -3dB point.&lt;br /&gt;
[[File:SDS5034X_PNG_66.png]]&lt;br /&gt;
&lt;br /&gt;
===ADC offset and gain measurements===&lt;br /&gt;
To measure the ADC offset error, measure the voltage on the uC input pin and record when the &lt;br /&gt;
transition from 0 to 1 occurs. It should occur at 0.5 LSB = 3.3/4096/2 = 0.4028 mV. &lt;br /&gt;
Offset: 55.35 mV - 0.4028 mV = 54.95 mV&lt;br /&gt;
&lt;br /&gt;
=FAQ=&lt;br /&gt;
====Where can I ask for help?====&lt;br /&gt;
:You can join the Discord: https://discord.gg/bCnp9H5SB5&lt;br /&gt;
====What comes in the box with the Recore? Specifically, terminal connectors for power, etc?====&lt;br /&gt;
:It's only the board, no cables or connectors. There is a bag of connectors available to purchase in the web shop.&lt;br /&gt;
====Do I need access to those 3 buttons on the board?====&lt;br /&gt;
:It is not necessary to have access to the three buttons for normal use.&lt;br /&gt;
====What's the maximum current draw for heat bed?====&lt;br /&gt;
:This has been tested up to 20 A&lt;br /&gt;
====Why are there unused and unbroken out pins on the STM32 MCU?====&lt;br /&gt;
:The pins that are needed from the MCU have been routed out plus two pins available on an external header.&lt;br /&gt;
====I have a gadget that I want to connect with SPI. Is that possible?====&lt;br /&gt;
:There are 6 pins available from the main SoC that can be used for various things.&lt;br /&gt;
There is no hardware SPI, but you can make a program that uses soft SPI. There is no dedicated &lt;br /&gt;
I2C, but perhaps that would be a nice addition.&lt;br /&gt;
====What exactly is the role of the AR100 device?====&lt;br /&gt;
:The AR100 handles the fast realtime aspects, mainly the stepper motors&lt;br /&gt;
====What voltage fans are supported?====&lt;br /&gt;
:The same voltage as the input voltage, either 12 V or 24 V. You can experiment with PWM for running lower voltage fans on 24 V input.&lt;br /&gt;
====Where is the board layout file?====&lt;br /&gt;
:The Layout file will not be available. It is an &amp;quot;open schematic&amp;quot; board, not open source hardware&lt;br /&gt;
====Where are you shipping from?====&lt;br /&gt;
:Early prototypes (Rev A4) will be shipping from Norway. Eventually shipping will be from a warehouse in the US&lt;br /&gt;
&lt;br /&gt;
= Known hardware issues for rev A6=&lt;br /&gt;
===T1 offset is not consistent===&lt;br /&gt;
:On Rev A6, during calibration it has been discovered that the offset on T1 is often varying around the predetermined set point of 0.33 V. It's not clear what is the cause of this. It could be a software issue, a measuring issue or something else. Regardless it is best to not use input T1 for thermocouple measurements. It can be used as a thermistor input.&lt;/div&gt;</summary>
		<author><name>Shufflez</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.iagent.no/mediawiki/index.php?title=Recore_A6&amp;diff=585</id>
		<title>Recore A6</title>
		<link rel="alternate" type="text/html" href="https://wiki.iagent.no/mediawiki/index.php?title=Recore_A6&amp;diff=585"/>
		<updated>2022-02-04T08:08:32Z</updated>

		<summary type="html">&lt;p&gt;Shufflez: Updated BLtouch pins, wording and description&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Recore header.png]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Recore is a 3D-printer control board running Linux. It is specifically tailored to be compatible with Klipper and OctoPrint. The main features are: &lt;br /&gt;
* Allwinner A64 SoC, quad core CPU running at 1 GHz. &lt;br /&gt;
* 1 GB of DDR3 RAM&lt;br /&gt;
* 8 GB of on board eMMC &lt;br /&gt;
* Gigabit Ethernet&lt;br /&gt;
* 6 TMC2209, 2 A stepper motor drivers&lt;br /&gt;
* 3 heater outputs + high power heated bed&lt;br /&gt;
* 4 USB High Speed ports &lt;br /&gt;
* 4 thermistor/thermocouple inputs (software selectable)&lt;br /&gt;
* Comes with Debian Linux with Klipper and OctoPrint installed&lt;br /&gt;
&lt;br /&gt;
This document is for Recore Revision A6. For previous hardware revisions, please see:  &lt;br /&gt;
* [[Recore_A5]]&lt;br /&gt;
* [[Recore_A4]]&lt;br /&gt;
* [[Recore_A3]]  &lt;br /&gt;
* [[Recore_A2]]&lt;br /&gt;
&lt;br /&gt;
=Pinout=&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Pinout A6-2.png]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
==A64==&lt;br /&gt;
In the following table the pins used for End-stops and stepper control are described. &lt;br /&gt;
The &amp;quot;bank and pin&amp;quot; can be used to specify the pin numbers in klipper. &lt;br /&gt;
The &amp;quot;Number&amp;quot; column is useful for testing things on the command line in conjunction with gpiod.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
!Name&lt;br /&gt;
!Bank and pin&lt;br /&gt;
!style=&amp;quot;border-right:solid 2px;&amp;quot;| Number&lt;br /&gt;
!Name&lt;br /&gt;
!Bank and pin&lt;br /&gt;
!style=&amp;quot;border-right:solid 2px;&amp;quot;| Number&lt;br /&gt;
!Name&lt;br /&gt;
!Bank and pin&lt;br /&gt;
!Number&lt;br /&gt;
|-&lt;br /&gt;
|END STOP 0&lt;br /&gt;
|PH4&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|228&lt;br /&gt;
|DIR 6&lt;br /&gt;
|PE14&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|142&lt;br /&gt;
|USB-PWR-EN-0&lt;br /&gt;
|PH0&lt;br /&gt;
|224&lt;br /&gt;
|-&lt;br /&gt;
|END STOP 1&lt;br /&gt;
|PH5&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|229&lt;br /&gt;
|DIR 7&lt;br /&gt;
|PE15&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|143&lt;br /&gt;
|USB-PWR-EN-1&lt;br /&gt;
|PH1&lt;br /&gt;
|225&lt;br /&gt;
|-&lt;br /&gt;
|END STOP 2&lt;br /&gt;
|PH6&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|230&lt;br /&gt;
|STEP DIAG 0&lt;br /&gt;
|PE0&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|128&lt;br /&gt;
|USB-PWR-EN-2&lt;br /&gt;
|PH2&lt;br /&gt;
|226&lt;br /&gt;
|-&lt;br /&gt;
|END STOP 3&lt;br /&gt;
|PH7&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|231&lt;br /&gt;
|STEP DIAG 1&lt;br /&gt;
|PE1&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|129&lt;br /&gt;
|USB-PWR-EN-3&lt;br /&gt;
|PH3&lt;br /&gt;
|227&lt;br /&gt;
|-&lt;br /&gt;
|END STOP 4&lt;br /&gt;
|PH8&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|232&lt;br /&gt;
|STEP DIAG 2&lt;br /&gt;
|PE2&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|130&lt;br /&gt;
|GAIN-ENABLE-T0&lt;br /&gt;
|PD4&lt;br /&gt;
|100&lt;br /&gt;
|-&lt;br /&gt;
|END STOP 5&lt;br /&gt;
|PH9&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|233&lt;br /&gt;
|STEP DIAG 3&lt;br /&gt;
|PE3&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|131&lt;br /&gt;
|GAIN-ENABLE-T1&lt;br /&gt;
|PH11&lt;br /&gt;
|235&lt;br /&gt;
|-&lt;br /&gt;
|STEP 0&lt;br /&gt;
|PL4&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|4&lt;br /&gt;
|STEP DIAG 4&lt;br /&gt;
|PE4&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|132&lt;br /&gt;
|GAIN ENABLE T2&lt;br /&gt;
|PE17&lt;br /&gt;
|145&lt;br /&gt;
|-&lt;br /&gt;
|STEP 1&lt;br /&gt;
|PL5&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|5&lt;br /&gt;
|STEP DIAG 5&lt;br /&gt;
|PE5&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|133&lt;br /&gt;
|GAIN ENABLE T3&lt;br /&gt;
|PB2&lt;br /&gt;
|34&lt;br /&gt;
|-&lt;br /&gt;
|STEP 2&lt;br /&gt;
|PL6&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|6&lt;br /&gt;
|STEP DIAG 6&lt;br /&gt;
|PE6&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|134&lt;br /&gt;
|PU-ENABLE-T0&lt;br /&gt;
|PG10&lt;br /&gt;
|202&lt;br /&gt;
|-&lt;br /&gt;
|STEP 3&lt;br /&gt;
|PL7&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|7&lt;br /&gt;
|STEP DIAG 7&lt;br /&gt;
|PE7&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|135&lt;br /&gt;
|PU-ENABLE-T1&lt;br /&gt;
|PG11&lt;br /&gt;
|203&lt;br /&gt;
|-&lt;br /&gt;
|STEP 4&lt;br /&gt;
|PL8&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|8&lt;br /&gt;
|OC-ALERT&lt;br /&gt;
|PF6&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|166&lt;br /&gt;
|PU ENABLE T2&lt;br /&gt;
|PG12&lt;br /&gt;
|204&lt;br /&gt;
|-&lt;br /&gt;
|STEP 5&lt;br /&gt;
|PL9&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|9&lt;br /&gt;
|OC-RESET&lt;br /&gt;
|PF4&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|164&lt;br /&gt;
|PU ENABLE T3&lt;br /&gt;
|PG13&lt;br /&gt;
|205&lt;br /&gt;
|-&lt;br /&gt;
|STEP 6&lt;br /&gt;
|PL10&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|10&lt;br /&gt;
|EN-HP&lt;br /&gt;
|PF5&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|165&lt;br /&gt;
|OFFSET-T0&lt;br /&gt;
|PG0&lt;br /&gt;
|192&lt;br /&gt;
|-&lt;br /&gt;
|STEP 7&lt;br /&gt;
|PL11&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|11&lt;br /&gt;
|UC-INT-1&lt;br /&gt;
|PG3&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|195&lt;br /&gt;
|OFFSET-T1&lt;br /&gt;
|PG1&lt;br /&gt;
|193&lt;br /&gt;
|-&lt;br /&gt;
|DIR 0&lt;br /&gt;
|PE8&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|136&lt;br /&gt;
|UC-NRST&lt;br /&gt;
|PG4&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|196&lt;br /&gt;
|OFFSET-T2&lt;br /&gt;
|PG3&lt;br /&gt;
|194&lt;br /&gt;
|-&lt;br /&gt;
|DIR 1&lt;br /&gt;
|PE9&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|137&lt;br /&gt;
|UC-BOOT&lt;br /&gt;
|PG5&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|197&lt;br /&gt;
|OFFSET-T3&lt;br /&gt;
|PG8&lt;br /&gt;
|200&lt;br /&gt;
|-&lt;br /&gt;
|DIR 2&lt;br /&gt;
|PE10&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|138&lt;br /&gt;
|ES-EN-12V&lt;br /&gt;
|PF0&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|160&lt;br /&gt;
|STEPPER UART 2 TX&lt;br /&gt;
|PB0&lt;br /&gt;
|32&lt;br /&gt;
|-&lt;br /&gt;
|DIR 3&lt;br /&gt;
|PE11&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|139&lt;br /&gt;
|EN-HDMI-PWR&lt;br /&gt;
|PG9&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|201&lt;br /&gt;
|STEPPER UART 2 RX&lt;br /&gt;
|PB1&lt;br /&gt;
|33&lt;br /&gt;
|-&lt;br /&gt;
|DIR 4&lt;br /&gt;
|PE12&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|140&lt;br /&gt;
|EN-THERMISTORS&lt;br /&gt;
|PF1&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|161&lt;br /&gt;
|STEPPER UART 3 TX&lt;br /&gt;
|PD0&lt;br /&gt;
|96&lt;br /&gt;
|-&lt;br /&gt;
|DIR 5&lt;br /&gt;
|PE13&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|141&lt;br /&gt;
|EN-ENDSTOPS&lt;br /&gt;
|PF2&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|162&lt;br /&gt;
|STEPPER UART 3 RX&lt;br /&gt;
|PD1&lt;br /&gt;
|97&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==STM32F031==&lt;br /&gt;
The STM32 is a Cortex M0 powered micro controller handling analog inputs and PWM outputs. It does not control any hard real time aspects of the print, that is handled by the AR100 core realized as a separate core in the A64 SoC. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
!Name&lt;br /&gt;
!Bank and pin&lt;br /&gt;
!style=&amp;quot;border-right:solid 2px;&amp;quot;| Number&lt;br /&gt;
!Name&lt;br /&gt;
!Bank and pin&lt;br /&gt;
!style=&amp;quot;border-right:solid 2px;&amp;quot;| Number&lt;br /&gt;
!Name&lt;br /&gt;
!Bank and pin&lt;br /&gt;
!Number&lt;br /&gt;
|-&lt;br /&gt;
|THERMISTOR 0&lt;br /&gt;
|PA0&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|6&lt;br /&gt;
|HEATER E0&lt;br /&gt;
|PA8&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|18&lt;br /&gt;
|FAN 0&lt;br /&gt;
|PB0&lt;br /&gt;
|14&lt;br /&gt;
|-&lt;br /&gt;
|THERMISTOR 1&lt;br /&gt;
|PA1&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|7&lt;br /&gt;
|HEATER E1&lt;br /&gt;
|PA9&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|19&lt;br /&gt;
|FAN 1&lt;br /&gt;
|PB1&lt;br /&gt;
|15&lt;br /&gt;
|-&lt;br /&gt;
|THERMISTOR 2&lt;br /&gt;
|PA2&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|8&lt;br /&gt;
|HEATER E2&lt;br /&gt;
|PA10&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|20&lt;br /&gt;
&lt;br /&gt;
|ES1-PWM-OUT&lt;br /&gt;
|PB3&lt;br /&gt;
|26&lt;br /&gt;
|-&lt;br /&gt;
|THERMISTOR 3&lt;br /&gt;
|PA3&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|9&lt;br /&gt;
|HEATER BED&lt;br /&gt;
|PA11&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|21&lt;br /&gt;
|FAN 3&lt;br /&gt;
|PB4&lt;br /&gt;
|27&lt;br /&gt;
|-&lt;br /&gt;
|BOARD VOLTAGE&lt;br /&gt;
|PA4&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|10&lt;br /&gt;
|USER LED&lt;br /&gt;
|PA12&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|22&lt;br /&gt;
|FAN 2&lt;br /&gt;
|PB5&lt;br /&gt;
|28&lt;br /&gt;
|-&lt;br /&gt;
|BOARD CURRENT&lt;br /&gt;
|PA5&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|11&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|&lt;br /&gt;
|PWM-ES2-OUT&lt;br /&gt;
|PB6&lt;br /&gt;
|29&lt;br /&gt;
|-&lt;br /&gt;
|BOARD TEMPERATURE&lt;br /&gt;
|PA6&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|12&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|&lt;br /&gt;
|EXT 1&lt;br /&gt;
|PB7&lt;br /&gt;
|30&lt;br /&gt;
|-&lt;br /&gt;
|COLD JUNCTION&lt;br /&gt;
|PA7&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|13&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|style=&amp;quot;border-right:solid 2px;&amp;quot;|&lt;br /&gt;
|EXT 2&lt;br /&gt;
|PB8&lt;br /&gt;
|32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==DBG header==&lt;br /&gt;
This header is used for interacting with u-boot and getting early debug messages from the Linux kernel&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pin&lt;br /&gt;
!Function&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|UART RX&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|UART TX&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|NC&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|GND&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==MCU header==&lt;br /&gt;
This header is used for connecting additional MCU peripherals. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pin&lt;br /&gt;
!Function&lt;br /&gt;
!Alt&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|PB7&lt;br /&gt;
|I2C1_SDA&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|PB8&lt;br /&gt;
|I2C1_SCL&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|3.3V&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|GND&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===LEDs===&lt;br /&gt;
There are 15 white LEDs on the board. Here is what they mean&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Name&lt;br /&gt;
!Location&lt;br /&gt;
!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|D2&lt;br /&gt;
|By PMIC&lt;br /&gt;
|Board powered&lt;br /&gt;
|-&lt;br /&gt;
|D3&lt;br /&gt;
|By heater BED &lt;br /&gt;
|BED output on&lt;br /&gt;
|-&lt;br /&gt;
|D4&lt;br /&gt;
|By fan 0&lt;br /&gt;
|Fan 0 is on&lt;br /&gt;
|-&lt;br /&gt;
|D5&lt;br /&gt;
|By fan 1&lt;br /&gt;
|Fan 1 is on&lt;br /&gt;
|-&lt;br /&gt;
|D6&lt;br /&gt;
|By heater H2&lt;br /&gt;
|Heater H2 is on&lt;br /&gt;
|-&lt;br /&gt;
|D7&lt;br /&gt;
|By fan 2&lt;br /&gt;
|Fan 2 is on&lt;br /&gt;
|-&lt;br /&gt;
|D8&lt;br /&gt;
|By heater H0&lt;br /&gt;
|Heater H0 is on&lt;br /&gt;
|-&lt;br /&gt;
|D9&lt;br /&gt;
|By fan 3&lt;br /&gt;
|Fan 3 is on&lt;br /&gt;
|-&lt;br /&gt;
|D10&lt;br /&gt;
|By heater H1&lt;br /&gt;
|Heater H1 is on&lt;br /&gt;
|-&lt;br /&gt;
|D12&lt;br /&gt;
|By input connector&lt;br /&gt;
|High voltage domain is on&lt;br /&gt;
|-&lt;br /&gt;
|D15&lt;br /&gt;
|By eMMC chip&lt;br /&gt;
|eMMC activity&lt;br /&gt;
|-&lt;br /&gt;
|D17&lt;br /&gt;
|By HDMI connector&lt;br /&gt;
|USB activitiy&lt;br /&gt;
|-&lt;br /&gt;
|D18&lt;br /&gt;
|By the USB C connector&lt;br /&gt;
|Linux Heartbeat&lt;br /&gt;
|-&lt;br /&gt;
|D19&lt;br /&gt;
|By the A64 SoC&lt;br /&gt;
|CPU activity&lt;br /&gt;
|-&lt;br /&gt;
|D20&lt;br /&gt;
|By the STM32&lt;br /&gt;
|Klipper running on STM32&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
There are 3 push buttons on the board. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Name&lt;br /&gt;
!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|FEL&lt;br /&gt;
|Enter FEL-mode of the A64&lt;br /&gt;
|-&lt;br /&gt;
|BOOT&lt;br /&gt;
|Boots or shuts down the board&lt;br /&gt;
|-&lt;br /&gt;
|RESET&lt;br /&gt;
|Hard reset of the CPU&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Current limits==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Name&lt;br /&gt;
!Limit&lt;br /&gt;
|-&lt;br /&gt;
|5V-ES&lt;br /&gt;
|1 A&lt;br /&gt;
|-&lt;br /&gt;
|USB host each&lt;br /&gt;
|1 A&lt;br /&gt;
|-&lt;br /&gt;
|Thermistors&lt;br /&gt;
|1 A&lt;br /&gt;
|-&lt;br /&gt;
|MCU connector&lt;br /&gt;
|0.5 A&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Wiring=&lt;br /&gt;
Below is a wiring diagram meant to aid in connecting motors, fans, extruders and hot ends to the control board. On the board, there is a small + sign next to output connectors where polarity is important. If passive heating elements are used, polarity is not important, but if those outputs are to be used with SSRs or relays, polarity must be observed. &lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Recore-wire-diagram-2.2.png]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Network connection==&lt;br /&gt;
Recore is designed to be controlled through a browser on a computer, so the board must be connected to the local LAN or wifi network. Connect an ethernet cable between the board and a switch. The ping utility can be used to ensure that the board is discovered on the network.&lt;br /&gt;
&lt;br /&gt;
===LAN setup===&lt;br /&gt;
Recore with Refactor is running avahi and should announce itself on the network once a connection has been established. On a Linux based host computer, it is possible to search for a booted device using the following command: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ping recore.local&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If the device is present, an SSH connection can be established:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ssh root@recore.local&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Furthermore, a web interface running OctoPrint can be found using a browser:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
http://recore.local&lt;br /&gt;
&lt;br /&gt;
==Wifi setup==&lt;br /&gt;
Wifi can be set up by connecting a wifi dongle to one of the USB host ports. Once the uSB dongle has been connected, and the board has been booted, access to the terminal command line can be given through a host computer. The board should appear as a TTY ACM device. On a Linux based host computer, the terminal program `screen` can be used to get access. From the host computer&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
screen /dev/ttyACM0 115200&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the host computer is running Windows, [https://www.putty.org/ Putty] can be used to get access. &lt;br /&gt;
&lt;br /&gt;
Once a connection has been established, the wifi network can be set up using the command nmtui. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nmtui&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Follow the instructions on screen to edit and activate the wifi connection. &lt;br /&gt;
&amp;lt;div class=&amp;quot;alert alert-warning&amp;quot;&amp;gt;&lt;br /&gt;
===='''Note'''====&lt;br /&gt;
If the board is powered through the USB C connector, only the two USB host ports next to the HDMI port is powered. &lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mating Connectors==&lt;br /&gt;
The power connectors on the board are available either in the web shop as part of a [https://www.iagent.no/product/connector-pack/ connector pack] or directly from Digi-key etc.&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt; &lt;br /&gt;
[[File:Connectors-all.png]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Four pin male: TBP01P1-508-04BE [[https://www.digikey.com/en/products/detail/cui-devices/TBP01P1-508-04BE/10238369 | Digi-key]]&lt;br /&gt;
&lt;br /&gt;
Two pin male: TBP01P1-508-02BE [[https://www.digikey.com/en/products/detail/cui-devices/TBP01P1-508-02BE/10238367 | Digi-key]]&lt;br /&gt;
&lt;br /&gt;
=Configuration=&lt;br /&gt;
There are no jumpers on Recore and no hard fuses. Everything is software configurable and resettable from software. This gives great power and flexibility without requiring physical access to the board once it has been installed. But with great power comes great responsibility. It is possible to break things if care is not taken during setup. There is one setting in particular that is worth mentioning: ES0 can have either +5V or +12V on the power pin. This is in order to allow a standard industrial inductive sensor to be used on that end stop. If a 5V only peripheral is connected, that could damage the connected peripheral. &lt;br /&gt;
&lt;br /&gt;
The default config file for Recore A6 can be found in the repository: [https://github.com/intelligent-agent/klipper/blob/master/config/generic-recore.cfg generic-recore.cfg]&lt;br /&gt;
&lt;br /&gt;
===TMC2209===&lt;br /&gt;
The 6 stepper drivers on Recore are of type TMC2209 from Trinamic. Each stepper has a configuration interface with a bidirectional UART port that is connected to a peripheral UART on the A64. The peripheral is not in use, but instead the GPIO bit-banging functionality of Klipper is used to communicate with the stepper drivers. &lt;br /&gt;
&lt;br /&gt;
Here is a table with pins and addresses for the steppers&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Stepper driver config&lt;br /&gt;
|-&lt;br /&gt;
|Name&lt;br /&gt;
|Pins&lt;br /&gt;
|Address&lt;br /&gt;
|-&lt;br /&gt;
|S0&lt;br /&gt;
|PB0/PB1&lt;br /&gt;
|0&lt;br /&gt;
|-&lt;br /&gt;
|S1&lt;br /&gt;
|PB0/PB1&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|S2&lt;br /&gt;
|PB0/PB1&lt;br /&gt;
|2&lt;br /&gt;
|-&lt;br /&gt;
|S3&lt;br /&gt;
|PB0/PB1&lt;br /&gt;
|3&lt;br /&gt;
|-&lt;br /&gt;
|S4&lt;br /&gt;
|PD0/PD1&lt;br /&gt;
|0&lt;br /&gt;
|-&lt;br /&gt;
|S5&lt;br /&gt;
|PD0/PD1&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|S6&lt;br /&gt;
|PD0/PD1&lt;br /&gt;
|2&lt;br /&gt;
|-&lt;br /&gt;
|S7&lt;br /&gt;
|PD0/PD1&lt;br /&gt;
|3&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Temperature inputs==&lt;br /&gt;
4 different temperature devices can be connected to the 4 analog inputs on Recore. Thermistor, Thermocouple, PT100 with INA826 and PT1000 without the use of a pre-amplifier.&lt;br /&gt;
===Thermistor===&lt;br /&gt;
Make sure the pull-up is enabled and the op-amp gain is set to 1. &lt;br /&gt;
===Thermocouple===&lt;br /&gt;
Make sure the pull-up is disabled and the op-amp gain is set to 100.&lt;br /&gt;
===PT100 with INA826===&lt;br /&gt;
In order to use a PT100 sensor, an external amplifier board must be used. There is an example configuration for Klipper that &lt;br /&gt;
uses this. The ADC reference voltage is 5.0 by default, but for Recore it is 3.3 V. Here is an example:  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Extruder]&lt;br /&gt;
...&lt;br /&gt;
sensor_type: PT100 INA826&lt;br /&gt;
adc_voltage: 3.27&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The pull-up must also be disabled.&lt;br /&gt;
&lt;br /&gt;
===PT1000===&lt;br /&gt;
Make sure the pull-up is enabled and the gain is set to 1. In the latest version, the sensor must be prefixed with RECORE. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Extruder]&lt;br /&gt;
...&lt;br /&gt;
sensor_type: RECORE PT1000&lt;br /&gt;
adc_voltage: 3.27&lt;br /&gt;
pullup_voltage: 3.3&lt;br /&gt;
offset_voltage: 3.2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Connecting other sensors=&lt;br /&gt;
The board has been designed to work with a range of 3rd party sensors for automating the print.&lt;br /&gt;
==BLtouch==&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:BLtouch sensor wiring.png]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
When connected like the suggested wiring diagram, setting up BLtouch can be done by adding the following section to printer.cfg.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[bltouch]&lt;br /&gt;
sensor_pin: ^ar100:PH6&lt;br /&gt;
control_pin: PH5&lt;br /&gt;
speed: 7&lt;br /&gt;
pin_move_time: 0.675&lt;br /&gt;
sample_retract_dist: 10&lt;br /&gt;
pin_up_reports_not_triggered: True&lt;br /&gt;
pin_up_touch_mode_reports_triggered: True&lt;br /&gt;
#Please change offsets below for your specific setup (these values are for EVA2.3.x BLtouch mount)&lt;br /&gt;
z_offset: 2.22&lt;br /&gt;
x_offset: -28 &lt;br /&gt;
y_offset: -13&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Inductive Sensor ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Inductive sensor wiring 2.png]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Connect the inductive sensor on ES0. You can choose either 5V or 12V output on the voltage pin.&lt;br /&gt;
&lt;br /&gt;
==ADXL345==&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt; &lt;br /&gt;
[[File:Wiring.png]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
A popular accelerometer sensor for doing input shaping with Klipper is the ADXL345. This can be connected to the connectors S6/S7. There is no hardware SPI interface available, but a software implementation in Klipper exists. &lt;br /&gt;
Note: Only experimental support has been tested for this. &lt;br /&gt;
https://learn.adafruit.com/adxl345-digital-accelerometer&lt;br /&gt;
&lt;br /&gt;
==RC Servo==&lt;br /&gt;
Endstop 1 and 2 can be used as PWM outputs with 5V levels. Rev A6 is the first board with support for this. &lt;br /&gt;
More testing and configuration documentation is needed.&lt;br /&gt;
&lt;br /&gt;
=Software for Recore=&lt;br /&gt;
Recore comes with the Linux distro Refactor (Armbian) pre-installed on the eMMC. &lt;br /&gt;
For more instructions about software for Recore, see the Refactor wiki page: &lt;br /&gt;
[[ Refactor#Recore ]]&lt;br /&gt;
&lt;br /&gt;
=== AR100 ===&lt;br /&gt;
Please see: [[AR100]]&lt;br /&gt;
&lt;br /&gt;
=Manual control and testing=&lt;br /&gt;
All functions on Recore are meant to be controlled from a graphical user interface such as OctoPrint, Fluid, Mainsail etc. This in turn in controlled by Klipper. Sometimes it can be beneficial to get low level access to certain functions and test things directly on the command line. This section is meant to give an overview of what capabilites are available from the command line (SSH/terminal).&lt;br /&gt;
&lt;br /&gt;
===Power domain overview===&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Power domain overview.png]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Power domains====&lt;br /&gt;
There are 9 power domains around the board controlling voltage on different pins: &lt;br /&gt;
* &amp;lt;b&amp;gt;Input power&amp;lt;/b&amp;gt; controls power to 4 high power outputs, the 4 fans and the 6 stepper drivers. This input has current monitoring, fast acting over current protection, voltage monitoring, temperature monitoring and reverse polarity protection.&lt;br /&gt;
* &amp;lt;b&amp;gt;Thermo couple power&amp;lt;/b&amp;gt; Controls +5V/1A output to the ADCs. This can be used for turning on power to the analog pins. &lt;br /&gt;
* &amp;lt;b&amp;gt;End stop power&amp;lt;/b&amp;gt; Controls +5V/1A output on the six endstops. Ganged. ES5 can be switched to have 12V output. The 12V output has a &lt;br /&gt;
100mA internal current limit. &lt;br /&gt;
* &amp;lt;b&amp;gt;4 USB host power domains&amp;lt;/b&amp;gt; Controls 5V/1A current output to the usb host connectors. These are turned on by u-boot.&lt;br /&gt;
*&amp;lt;b&amp;gt;HDMI 5V output&amp;lt;/b&amp;gt; Controls the 5V/1A HDMI output. Turned on by u-boot. &lt;br /&gt;
&lt;br /&gt;
====Input stage====&lt;br /&gt;
Reset over current protection and set it in &amp;quot;one-shot&amp;quot; mode.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gpioset 1 164=0&lt;br /&gt;
gpioset 1 164=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The over current protection can also be set in &amp;quot;transparent&amp;quot; mode, where the current alarm &lt;br /&gt;
will be reset automatically. Note that this is a bad idea for general operation, only use for testing. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gpioset 1 164=0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable 24V input&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gpioset 1 165=0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====End stop 5V /12V====&lt;br /&gt;
End stop 0 to 4 has a programmable +5V output voltage. &lt;br /&gt;
End stop 5 has +5V or +12V selectable.&lt;br /&gt;
&lt;br /&gt;
To enable +5V on ES 0...4&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gpioset 1 162=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To disable again&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gpioset 1 162=0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To switch to 12V output on ES5&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gpioset 1 160=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To disable again&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gpioset 1 160=0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====End stops values====&lt;br /&gt;
To see what value the end stops have&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gpioget 1 228 # ES 5&lt;br /&gt;
gpioget 1 229&lt;br /&gt;
gpioget 1 230&lt;br /&gt;
gpioget 1 231&lt;br /&gt;
gpioget 1 232&lt;br /&gt;
gpioget 1 233 # ES 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TMC2209====&lt;br /&gt;
In window/shell 1:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
stty -F /dev/ttyS2 raw -echoe -echo&lt;br /&gt;
xxd -c 4 /dev/ttyS2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In window/shell 2:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo -n -e '\x5\x0\x6\x6F' &amp;gt; /dev/ttyS2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The return should be along the lines of&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
00000000: 0500 066f  ...o&lt;br /&gt;
00000004: 05ff 0620  ... &lt;br /&gt;
00000008: 0001 4058  ..@X&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To check that no errors are reported by the steppers write this on the command line. If a &amp;quot;1&amp;quot; shows up, that is an indication that the motor is reporting an error. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gpioget 1 128&lt;br /&gt;
gpioget 1 129&lt;br /&gt;
gpioget 1 130&lt;br /&gt;
gpioget 1 131&lt;br /&gt;
gpioget 1 132&lt;br /&gt;
gpioget 1 133&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== STM32F031 ====&lt;br /&gt;
There is a small firmware to test all functionality that is controlled by the STM32F031 chip on the board. &lt;br /&gt;
Once uploaded to the board using the flash script, the firmware will turn on all LEDs it controls and send &lt;br /&gt;
back ADC readings. &lt;br /&gt;
&lt;br /&gt;
To flash this firmware to the STM32:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gpioset 1 197=1&lt;br /&gt;
gpioset 1 196=0&lt;br /&gt;
stm32flash -i -196,196 -w Sumato-f031.bin -v -g 0x00 /dev/ttyS1&lt;br /&gt;
gpioset 1 197=0&lt;br /&gt;
stm32flash -i -196,196 /dev/ttyS1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To see the ADC readings: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
stty -F /dev/ttyS3 38400 raw&lt;br /&gt;
cat /dev/ttyS3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You should see something like&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ADC T0: 0&lt;br /&gt;
ADC T1: 0&lt;br /&gt;
ADC T2: 0&lt;br /&gt;
ADC T3: 0&lt;br /&gt;
ADC U: 2338&lt;br /&gt;
ADC I: 0&lt;br /&gt;
ADC TB: 3417&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following one-liners assumes gawk is installed.&lt;br /&gt;
&lt;br /&gt;
===Reading Current===&lt;br /&gt;
There is board current reading implemented in OctoPrint. &lt;br /&gt;
The current shunt resistor is 1 mOhm, the amplifier is 20 times, the vref is 3.3V, so we get:&lt;br /&gt;
(adc_val/4096*3.3)*1000/20 = (adc_val/4096)*165&lt;br /&gt;
&lt;br /&gt;
If the testing firmware is installed on the STM32, you can convert the current (as in amps) reading to something useful like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat /dev/ttyS4 | awk '/I:/ { printf &amp;quot;scale=4; (%i/4096)*165\n&amp;quot;, $3; fflush(); }' | bc -l&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Current limit programming====&lt;br /&gt;
The current limit must be set in the device tree by programming the voltage &lt;br /&gt;
on dldo2. dldo2 can have values from 0.7 V to 3.4 V. Setting the voltage level to 3.4 V effectively &lt;br /&gt;
disables the fast acting current limit. Setting it to the lowest value gives an over current limit of 35 A.&lt;br /&gt;
&lt;br /&gt;
===Reading Board Temperature===&lt;br /&gt;
To see the temperature readings, try this : &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export beta=4327&lt;br /&gt;
cat /dev/ttyS1 | awk '/TB:/ { printf &amp;quot;scale=4; 4327/l( (4700/((3.3/(3.3*%i/4096))-1.0))/0.05306820342563400000) -273.15\n&amp;quot;, $3; fflush(); }' | bc -l | awk '{print strftime(&amp;quot;%k:%M:%S&amp;quot;), $0; fflush();}'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Reading Input Voltage===&lt;br /&gt;
To see voltage on the input, it can be converted like this: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
exec 4&amp;lt;/dev/ttyS4 5&amp;gt;/dev/ttyS4&lt;br /&gt;
echo -n &amp;quot;;A4;&amp;quot; &amp;gt;&amp;amp;5&lt;br /&gt;
read -t1 reply &amp;lt;&amp;amp;4&lt;br /&gt;
echo $reply | awk '{ printf &amp;quot;scale=4; (%i/4096)*3.3*((100+10)/10)\n&amp;quot;, $4; fflush(); }' | bc -l&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Thermistor inputs===&lt;br /&gt;
To enable pull-up on input for using thermistors for temperature measurements: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gpioset 1 102=1&lt;br /&gt;
gpioset 1 120=1&lt;br /&gt;
gpioset 1 160=1&lt;br /&gt;
gpioset 1 161=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Setting Op-amp gain to 1:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gpioget 1 100&lt;br /&gt;
gpioget 1 235&lt;br /&gt;
gpioget 1 145&lt;br /&gt;
gpioget 1 34&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the device tree file, the gpio/ldos must be set to gpio input:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;amp;gpio0_ldo {&lt;br /&gt;
  function = &amp;quot;gpio_in&amp;quot;;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Thermocouple input===&lt;br /&gt;
Either a thermocouple or a thermistor can be used as input on the &lt;br /&gt;
T0-T3 inputs. &lt;br /&gt;
====Bias====&lt;br /&gt;
The thermocouple is set up to have a Bias of 0.7V/100 on the input which enables negative &lt;br /&gt;
values (lower than the board temperature) as input to the ADCs. &lt;br /&gt;
With the input short circuited, the bias can be recorded. Typical values are 750&lt;br /&gt;
This needs to be subtracted from the result.&lt;br /&gt;
====Cold junction compensation====&lt;br /&gt;
Another important aspect is cold junction compensation. &lt;br /&gt;
There is a thermistor connected on the board close to the thermocouple inputs&lt;br /&gt;
which can be used to measure the temperature close to the input junction. &lt;br /&gt;
This temperature must be added in software.&lt;br /&gt;
&lt;br /&gt;
The connected thermistor is a TDK [https://product.tdk.com/info/en/catalog/datasheets/503021/tpd_commercial_ntc-thermistor_ntcg_en.pdf NTCG104EF104FT1X]&lt;br /&gt;
The connected Thermocouple has a (25/100) beta value of 4327. &lt;br /&gt;
&lt;br /&gt;
In order to use the inputs for thermocouple, the pull-up-down resistors must be set to pull-down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gpioset 1 102=0&lt;br /&gt;
gpioset 1 120=0&lt;br /&gt;
gpioset 1 160=0&lt;br /&gt;
gpioset 1 161=0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, the op-amp needs a gain of 100:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gpioset 1 100=0&lt;br /&gt;
gpioset 1 235=0&lt;br /&gt;
gpioset 1 145=0&lt;br /&gt;
gpioset 1 34=0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, the input bias needs to be enabled. The following LDOs needs to be enabled:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
reg_ldo_io0&lt;br /&gt;
reg_ldo_io1&lt;br /&gt;
reg_dldo3&lt;br /&gt;
reg_dldo4&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Performance=&lt;br /&gt;
==Start-up time==&lt;br /&gt;
With a maximum clock for MMC2 of 200 MHz, here is the start-up time: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root@recore-3:~# systemd-analyze &lt;br /&gt;
Startup finished in 5.128s (kernel) + 11.567s (userspace) = 16.695s &lt;br /&gt;
graphical.target reached after 11.421s in userspace&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Measured voltages==&lt;br /&gt;
The final stages of Recore manufacturing consists of testing, calibration and flashing of firmware. &lt;br /&gt;
The calibration stage measures a number of voltages on the board and classifies the input stages gain and offset. &lt;br /&gt;
Instruments used: &lt;br /&gt;
* HP 3458A, 8.5 digit multimeter&lt;br /&gt;
* HP 3245A, Universal Source &lt;br /&gt;
&lt;br /&gt;
====Microcontroller voltages====&lt;br /&gt;
VDDA uC: 3.312 V&amp;lt;br&amp;gt;&lt;br /&gt;
VDD uC: 3.312 V&lt;br /&gt;
&lt;br /&gt;
Voltage from the PMIC supplied as bias:&amp;lt;br&amp;gt;&lt;br /&gt;
0.706 V &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====5V Buck converter ripple and noise ====&lt;br /&gt;
The 5V step down/Buck converter is a AOZ2151PQI-10. It can provide 4A and has an input voltage range of 12-28V. &lt;br /&gt;
It is hard wired to be in PWM mode. PFM mode results in a loud whine.&lt;br /&gt;
&lt;br /&gt;
Below is a screenshot of the ripple and noise across the  the 5V rail with a normal kernel running. &lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:VCC-5V-ripple-A4.png]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Input stage===&lt;br /&gt;
An experiment with a constant current load drawing 20 A from the bed connector with and without a 92 mm fan on top of the board for forced convection. The temperature measured was with the on board thermistor. Using a thermal camera, the temperature displayed matches well with the temperature reported by the camera. However, in Rev A2, this is not the hottest point on the board. The MOSFET controlling the bed seems to consistently get the highest temperature. The reason for this is probably due to a 3.3 V VGS. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File: Temperature-fan-off.pdf.png]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Temperature-fan.pdf.png]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Inrush current====&lt;br /&gt;
During turn on of the high power stage, there will be an inrush current to charge up the bank of capacitors present on the board. &lt;br /&gt;
If no loads are turned on, the inrush current reaches 31 A at peak. This is important to consider when setting the current limit with device tree. &lt;br /&gt;
&lt;br /&gt;
Todo: These measurements are from rev A3. Redo measurements with Rev A6. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;res-img&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Inrush current A3.png]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Temperature low pass filter===&lt;br /&gt;
A Low pass filter has been added on each of the temperature input channels. The cut-off frequency is below what my oscilloscope can handle, but a plot in the time domain verifies a 7 Hz -3dB point.&lt;br /&gt;
[[File:SDS5034X_PNG_66.png]]&lt;br /&gt;
&lt;br /&gt;
===ADC offset and gain measurements===&lt;br /&gt;
To measure the ADC offset error, measure the voltage on the uC input pin and record when the &lt;br /&gt;
transition from 0 to 1 occurs. It should occur at 0.5 LSB = 3.3/4096/2 = 0.4028 mV. &lt;br /&gt;
Offset: 55.35 mV - 0.4028 mV = 54.95 mV&lt;br /&gt;
&lt;br /&gt;
=FAQ=&lt;br /&gt;
====Where can I ask for help?====&lt;br /&gt;
:You can join the Discord: https://discord.gg/bCnp9H5SB5&lt;br /&gt;
====What comes in the box with the Recore? Specifically, terminal connectors for power, etc?====&lt;br /&gt;
:It's only the board, no cables or connectors. There is a bag of connectors available to purchase in the web shop.&lt;br /&gt;
====Do I need access to those 3 buttons on the board?====&lt;br /&gt;
:It is not necessary to have access to the three buttons for normal use.&lt;br /&gt;
====What's the maximum current draw for heat bed?====&lt;br /&gt;
:This has been tested up to 20 A&lt;br /&gt;
====Why are there unused and unbroken out pins on the STM32 MCU?====&lt;br /&gt;
:The pins that are needed from the MCU have been routed out plus two pins available on an external header.&lt;br /&gt;
====I have a gadget that I want to connect with SPI. Is that possible?====&lt;br /&gt;
:There are 6 pins available from the main SoC that can be used for various things.&lt;br /&gt;
There is no hardware SPI, but you can make a program that uses soft SPI. There is no dedicated &lt;br /&gt;
I2C, but perhaps that would be a nice addition.&lt;br /&gt;
====What exactly is the role of the AR100 device?====&lt;br /&gt;
:The AR100 handles the fast realtime aspects, mainly the stepper motors&lt;br /&gt;
====What voltage fans are supported?====&lt;br /&gt;
:The same voltage as the input voltage, either 12 V or 24 V. You can experiment with PWM for running lower voltage fans on 24 V input.&lt;br /&gt;
====Where is the board layout file?====&lt;br /&gt;
:The Layout file will not be available. It is an &amp;quot;open schematic&amp;quot; board, not open source hardware&lt;br /&gt;
====Where are you shipping from?====&lt;br /&gt;
:Early prototypes (Rev A4) will be shipping from Norway. Eventually shipping will be from a warehouse in the US&lt;br /&gt;
&lt;br /&gt;
= Known hardware issues for rev A6=&lt;br /&gt;
===T1 offset is not consistent===&lt;br /&gt;
:On Rev A6, during calibration it has been discovered that the offset on T1 is often varying around the predetermined set point of 0.33 V. It's not clear what is the cause of this. It could be a software issue, a measuring issue or something else. Regardless it is best to not use input T1 for thermocouple measurements. It can be used as a thermistor input.&lt;/div&gt;</summary>
		<author><name>Shufflez</name></author>
		
	</entry>
</feed>