1. Home
  2. Factor FR201 and FR202 Technical Resources

Factor FR201 and FR202 Technical Resources

User Manual

Raspberry PI Imager

Firmware Tool

Frequently Asked Questions (FAQ)

How is auto power on enabled?

Auto power on is permanently enabled on this model. The unit will automatically turn on when supplied with power.

What is the default username/password?

Raspberry Pi OS: pi/raspberry
ubuntu: ubuntu/ubuntu

How does the serial port enumerate

/dev/ttyUSB0

Should I choose 32bit or 64bit when selecting an operating system?

32bit is recommended because it is more stable. Unlike x86 based systems, 32bit ARM can address large amounts of RAM. Individual processes are still limited to ~3GB RAM usage. 64bit may run slightly faster but is known to be less stable.

How do I erase the M.2 Storage?

The boot order is hardcoded. The best approach is to temporarily remove the M.2 storage drive, boot via USB, and then reconnect the M.2 storage once booted. It can then be erased.

Supported Operating Systems

The following operating systems have been validated by OnLogic. Other operating systems are not likely to work and are not eligible for support from OnLogic. Installation instructions can be found further down on this page. Refer to the contents pane on the right.

Raspberry Pi OS Lite (32bit & 64bit)
Raspberry Pi OS (32bit & 64bit)

Ubuntu Desktop 22.04 (32bit & 64bit)
Ubuntu Desktop 20.04 (32bit)

Ubuntu Server 22.04 (32bit & 64bit)
Ubuntu Server 20.04 (32bit)

System Setup

  • To get started, connect a keyboard, mouse, and monitor before powering up the system.
  • If you purchased the standard 60 watt power supply, it will be pre-wired and ready for use.
  • For the dinrail power supply, connect the wires as shown below. V+ to the red wire, V- to the black.
  • Use a flathead screwdriver to loosen the terminals to accept the wires. Insert the wires and then tighten the terminals back down.
  • On the system side, depress the orange tabs and slide the wires in.

First Boot

This section covers what to expect the first time you power your system on.

No OS

If you did not select an operating system when ordering, the system will boot up to a diagnostic splash screen. You can install an operating system using the steps further down on this page.

Diagnostic screen shown when no operating system is found.

Raspberry Pi OS

  • Log in to the default pi account with the password “raspberry”
  • Enter “raspberry” again (it is asking for the current password to enable changing it.)
  • Enter a new password. Note that it must be different from the default or it will error out.
  • Enter the new password again to confirm
  • You will be greeted with the Raspbian welcome screen.
  • Configure localization information
  • Click next to skip the redundant password change dialog. It will keep the password you set earlier.
  • Compete the setup wizard and the unit is ready for use.

Raspberry Pi OS (Lite)

The Lite version of Raspberry PI OS (Raspbian) boots straight to a login prompt.

  • Log in with the following credentials:
  • username: pi
  • password: raspberry
  • You will be prompted to change the default password on first login. re-enter “raspberry” as the current password, and then set your new password.
  • The system is now ready for use.

Ubuntu Desktop

  • Click on the “Ubuntu” user
  • Enter the default password – “ubuntu”
  • Enter the default password again – “ubuntu”
  • Create a new password
  • Click next and complete the setup wizard.
  • Your system is now ready for use.

Ubuntu Server

Ubuntu server boots straight to a login prompt.

  • Log in with the following credentials:
  • username: ubuntu
  • password: ubuntu
  • You will be prompted to change the default password on first login. re-enter “ubuntu” as the current password, and then set your new password.
  • The system is now ready for use.

Disassembly

  • Remove the 3 M3x4mm screws from the bottom of the system.
  • Lift up the bottom lid starting from the side with the OnLogic label
  • The internals of the unit including SSD and Cellular are now accessible.
  • It is recommended not to disassemble the unit any further unless absolutely necessary. Further disassembly has greater potential to cause warranty voiding damage. Use caution.
  • Remove the 3 5mm standoffs from the system.
  • Gently pop the bottom plate off and gently remove the WiFi pigtail (if equipped)
  • The CM4 module is held in by 2 M2 screws.
  • To remove the module, remove the 2 screws and lift straight up.
  • Use caution as the connector is fragile.
  • Re-install the module by lining up the screw holes. Gently pop it down into the sockets.
  • Note: the screws will not line up if the module is rotate 180 degrees.
  • Ensure the thermal pads and EMI gasket are still attached and in the shown locations.
  • Set the system onto the bottom plate, aligning the screw holes.
  • Re-install the 3 brass standoffs. Hand tighten and do not over torque. They can sheer off if too much force is applied.
  • Line up the two pegs of the bottom plate first, then hinge it into place.
  • Re-install the M3 screws into the bottom of the chassis.

Installing Raspberry Pi OS to eMMC

Follow this method if your Factor unit is equipped with onboard eMMC storage.

  • Remove the 3 M3x4mm screws from the bottom of the system.
  • Lift up the bottom lid starting from the side with the OnLogic label
  • Locate the 6 pin jumper block.
  • It should already have a jumper installed on it.
  • Move the jumper from its default position onto the “Boot DIS” pins as shown.
  • This tells the CM4 module to go into bootloader mode and allows flashing of the internal storage over USB-C.
  • Connect the USB-C port to another computer.
  • Connect power to the unit.
  • Download and install the “Firmware Tool” from the links at the top of this page.
  • Type rpiboot into the start menu and launch the rpiboot program
  • A terminal window will appear. It will automatically run a few commands and then close.
  • If the terminal stays at this stage, that means the PI was not detected. Double check jumper placement. Confirm power is connected to the unit and try a different USB cable.
  • If successful, the eMMC storage will be given a drive letter. Windows can not read it as it contains a Linux filesystem. Do not format it. The Raspberry PI imaging tool will be used instead.
  • Download the Raspberry Pi imager using the link at the top of this page.
  • Launch it from the start menu
  • Click on “CHOOSE OS”
  • Select your desired image. In most cases, you will want the default “Raspberry Pi OS”
  • Click on “CHOOSE STORAGE”
  • Select the RPI-MSD disk from the list. This is the Pi’s internal eMMC storage.
  • Click “WRITE”
  • Double check that this is the correct drive and choose “YES”
  • If an error occurs, try using the erase function from the imager’s “operating system” menu
  • Erase function shown
  • The image writing process will begin. This takes some time.
  • Success!
  • Unplug the USB-C cable and the power cord.
  • Restore the jumper to its original position.
  • Line up the two pegs of the bottom plate first, then hinge it into place.
  • Re-install the M3 screws into the bottom of the chassis.
  • Boot up the Factor unit. It will reboot once or twice to configure itself.
  • You will be greeted with the Raspbian welcome screen.
  • Configure localization information
  • Click next if you wish to keep the current password (default: raspberry)
  • Compete the setup wizard and the unit is ready for use.

Installing Raspberry PI OS to M.2 Storage

A USB flash drive smaller than the system’s storage is required for this method. Example: The Factor system has 32GB storage. The flash drive must be 16GB or smaller.

  • Begin by downloading the Raspberry Pi imager using the link at the top of this page.
  • Click on “CHOOSE OS”
  • Select your desired image. In most cases, you will want the default “Raspberry Pi OS
  • Click on “CHOOSE STORAGE”
  • Select your flash drive from the list
  • Click “WRITE”
  • Double check that this is the correct drive and choose “YES”
  • If an error occurs, try using the erase function from the imager’s “operating system” menu
  • Erase function shown
  • The image writing process will begin. This takes some time.
  • Success!
  • Unplug the flash drive from the computer and plug it into the single blue USB 3 port on the Factor unit.
  • Plug in the factor unit and it should boot up to the flash drive. It may restart automatically once or twice to configure everything.
  • Complete the setup wizard with the desired settings.
  • Configure localization information
  • Click next if you wish to keep the current password (default: raspberry)
  • Launch terminal from the panel in the top left
  • Run the “lsblk” command
  • In this example, our flash drive is SDA M.2 drive is SDB, and onboard eMMC storage is mmcblk0.
  • We will now clone the flash drive onto the desired storage drives. Following the example above, run a DD command:
  • Install to M.2: sudo dd if=/dev/sda of=/dev/sdb status=progress
  • Install to eMMC: sudo dd if=/dev/sda of=/dev/mmcblk0 status=progress
  • An error saying “no space left on device” means that your flash drive was too big. It needs to be smaller than the drive you are installing to.
  • Success!
  • The terminal will show the amount of data copied and then drop to a prompt.
  • Shut down the system and unplug your flash drive.
  • Power the system back on and it will boot up into the operating system. The installation is now complte.

Installing Ubuntu to eMMC

Installing Ubuntu is a bit more involved than Raspberry Pi OS. Configuration files need to be edited manually or the operating system will not boot properly.

Follow this method if your Factor unit is equipped with onboard eMMC storage.

  • Remove the 3 M3x4mm screws from the bottom of the system.
  • Lift up the bottom lid starting from the side with the OnLogic label
  • Locate the 6 pin jumper block.
  • It should already have a jumper installed on it.
  • Move the jumper from its default position onto the “Boot DIS” pins as shown.
  • This tells the CM4 module to go into bootloader mode and allows flashing of the internal storage over USB-C.
  • Connect the USB-C port to another computer.
  • Connect power to the unit.
  • Download and install the “Firmware Tool” from the links at the top of this page.
  • Type rpiboot into the start menu and launch the rpiboot program
  • A terminal window will appear. It will automatically run a few commands and then close.
  • If the terminal stays at this stage, that means the PI was not detected. Double check jumper placement. Confirm power is connected to the unit and try a different USB cable.
  • If successful, the eMMC storage will be given a drive letter. Windows can not read it as it contains a Linux filesystem. Do not format it. The Raspberry PI imaging tool will be used instead.
  • Download the Raspberry Pi imager using the link at the top of this page.
  • Launch it from the start menu
  • Click on “CHOOSE OS”
  • Select the “Other general-purpose OS” category
  • Click On Ubuntu
  • Scroll down to and select a supported version of Ubuntu
  • For 20.04 32bit Desktop, select server even if you want Ubuntu Desktop. The desktop will be installed later.
  • Click on “CHOOSE STORAGE”
  • Select the RPI-MSD disk from the list. This is the Pi’s internal eMMC storage.
  • Click “WRITE”
  • Double check that this is the correct drive and choose “YES”
  • If an error occurs, try using the erase function from the imager’s “operating system” menu
  • Erase function shown
  • The image writing process will begin. This takes some time.
  • Success! but the configuration needs to be modified to boot properly.
  • Unplug the USB-C cable and then plug it back in.

  • The boot partition should show up with a drive letter.
  • If it doesn’t, you may need to assign one manually via disk management or diskpart.

  • Download the two files below and copy them to the boot partition, overwriting the existing two files.
  • Choose either 32bit or 64bit depending on what version you selected in the Pi imager

32bit

64bit

  • Eject the boot partition
  • Unplug the power and USB cable from the Factor unit
  • Restore the jumper to its original position.
  • Line up the two pegs of the bottom plate first, then hinge it into place.
  • Re-install the M3 screws into the bottom of the chassis.
  • Power up the unit and it will boot into Ubuntu. Log in with the following credentials:
  • username: ubuntu
  • password: ubuntu

You will be prompted to change the password. Enter a new password. Your system is now set up and ready to use.

Installing Ubuntu to M.2 Storage

A USB flash drive smaller than the system’s storage is required for this method. Example: The Factor system has 32GB storage. The flash drive must be 16GB or smaller.

  • Download the Raspberry Pi imager using the link at the top of this page.
  • Launch it from the start menu
  • Click on “CHOOSE OS”
  • Select the “Other general-purpose OS” category
  • Click On Ubuntu
  • Click on “CHOOSE STORAGE”
  • Select your flash drive from the list
  • Click “WRITE”
  • Double check that this is the correct drive and choose “YES”
  • If an error occurs, try using the erase function from the imager’s “operating system” menu
  • Erase function shown
  • The image writing process will begin. This takes some time.
  • Success! but the configuration needs to be modified to boot properly.
  • Unplug the flash drive and then plug it back in.

  • The boot partition should show up with a drive letter.
  • If it doesn’t, you may need to assign one manually via disk management or diskpart.

  • Download the two files below and copy them to the boot partition, overwriting the existing two files.
  • Choose either 32bit or 64bit depending on what version you selected in the Pi imager

32bit

64bit

  • Eject the boot partition
  • Unplug the flash drive from the computer and plug it into the single blue USB 3 port on the Factor unit.
  • Power on the Factor unit and wait for the login prompt.

Log in to the newly installed OS. See default credentials here. (typically ubuntu/ubuntu)

  • Open a terminal
  • Run the “lsblk” command
  • In this example, our flash drive is SDA M.2 drive is SDB, and onboard eMMC storage is mmcblk0.
  • We will now clone the flash drive onto the desired storage drives. Following the example above, run a DD command:
  • Install to M.2: sudo dd if=/dev/sda of=/dev/sdb status=progress
  • Install to eMMC: sudo dd if=/dev/sda of=/dev/mmcblk0 status=progress
  • An error saying “no space left on device” means that your flash drive was too big. It needs to be smaller than the drive you are installing to.
  • Success!
  • The terminal will show the amount of data copied and then drop to a prompt.
  • Shut down the system and unplug your flash drive.
  • Power the system back on and it will boot up into the operating system. The installation is now complete.

32Bit Ubuntu Desktop

32bit Ubuntu Desktop can not be installed directly. You must first install Ubuntu server using one of the methods above. Once server is up and running, the following procedure will install the desktop environment.

  • Log in to the system
  • Run ‘sudo apt update’
  • Run ‘sudo apt install ubuntu-desktop’
  • Type Y and press enter at the prompt.
  • Sit tight while the installation proceeds. This will take at least 10 minutes.
  • After the installation completes, type ‘sudo reboot’ and press enter.
  • The unit will reboot into the desktop environment.

Wiping the eMMC or M.2 storage drive

The CM4 module has a hardcoded boot order of eMMC > M.2 > USB. This can be problematic if the image on the eMMC or m.2 becomes corrupted or needs to be erased for other reasons. The simple solution is to erase the boot partition. This can be done one of two ways.

Wiping eMMC using another computer

Note that this method can only by used to wipe eMMC storage, not M.2

  • Remove the 3 M3x4mm screws from the bottom of the system.
  • Lift up the bottom lid starting from the side with the OnLogic label
  • Locate the 6 pin jumper block.
  • It should already have a jumper installed on it.
  • Move the jumper from its default position onto the “Boot DIS” pins as shown.
  • This tells the CM4 module to go into bootloader mode and allows flashing of the internal storage over USB-C.
  • Connect the USB-C port to another computer.
  • Connect power to the unit.
  • Download and install the “Firmware Tool” from the links at the top of this page.
  • Type rpiboot into the start menu and launch the rpiboot program
  • A terminal window will appear. It will automatically run a few commands and then close.
  • If the terminal stays at this stage, that means the PI was not detected. Double check jumper placement. Confirm power is connected to the unit and try a different USB cable.
  • If successful, the eMMC storage will be given a drive letter. Windows can not read it as it contains a Linux filesystem. Do not format it. The Raspberry PI imaging tool will be used instead.
  • Download the Raspberry Pi imager using the link at the top of this page.
  • Launch it from the start menu
  • Click on “CHOOSE OS”
  • Scroll down and click on “erase”
  • Click on “CHOOSE STORAGE”
  • Select the RPI-MSD disk from the list. This is the Pi’s internal eMMC storage.
  • click “WRITE”
  • Double check that this is the correct drive and choose “YES”
  • The storage has now been erased.
  • Proceed to one of the operating system installation guides on this page.

Wiping eMMC or M.2 using DD

If the Linux image on the Factor unit is still bootable, you can use the terminal to erase the boot partition.

  • Run the lsblk command to list the storage devices
  • In this example, the boot partition is stored on /dev/mmcblk0p1
  • The following command will copy zeroes over that partition, effectively wiping it and preventing the Pi from booting to it.

sudo dd if=/dev/zero of=/dev/mmcblk0 status=progress

An M.2 storage drive will likely show up as sdb, so this command will wipe the M.2’s boot partition:

sudo dd if=/dev/zero of=/dev/sdb status=progress

Once the drive wipe has completed, proceed to one of the operating system installation guides on this page.

Setting the Serial Mode (RS232/RS422/RS485)

The FR200 series serial mode can be controlled by configuring the embedded FTDI EEPROM. The utility for applying these configuration changes is installed by default on OnLogic provided FR200 series OS images; if you are not using an OnLogic provided image, you will need to install the utility before updating the serial mode.

Installing the EEPROM Tool

  • Install required libraries: sudo apt install libconfuse-dev libusb-1.0-0-dev and build tools sudo apt install cmake build-essential
  • Download the latest libFTDI and extract it to a folder (tar -xf libftdi1-1.5.tar.bz2)
    • You can also clone libFTDI with git: git clone git://developer.intra2net.com/libftdi
  • Build the library and the FTDI EEPROM tool:
    • mkdir libftdi1-1.5/build && cd libftdi1-1.5/build
    • cmake -DCMAKE_INSTALL_PREFIX="/usr" ../
    • make && sudo make install

Setting the Configuration

  • Download the configuration file for your required mode:
    • RS232wget static.onlogic.com/resources/firmware/documentation/configs/FR200_RS232.conf
    • RS422wget static.onlogic.com/resources/firmware/documentation/configs/FR200_RS422.conf
    • RS485wget static.onlogic.com/resources/firmware/documentation/configs/FR200_RS485.conf
  • Flash the EEPROM image: sudo eeprom_ftdi --flash-eeprom FR200_<protocol>.conf
  • Reboot for changes to take effect: sudo shutdown -r now

FR202 Digital IO

Note: For the best experience, always update to the latest firmware version before testing these commands.

The FR202 Digital IO is connected to the CM4 via a virtual USB-CDC-ACM serial port; you can see that the USB device is detected using lsusb and OnLogic’s USB Vendor ID:

lsusb -d 353f:

Data can be sent to the device over its virtual serial port, which will be available in /dev :

ls /dev | grep ACM

The serial port can operate either as an interactive UART terminal, or as an endpoint for raw byte commands.

UART Terminal

The FR202’s UART shell supports line editing, history, and TAB completion. Digital inputs and outputs are collected into groups, and dio commands are performed on those groups.

For instance, DO_G0 is “Digital Output Group 0”. A complete list of devices can be produced by running device list. Once you have selected a device, dio commands may be run:

SubcommandExampleDescription
setdio set DO_G0 0 trueSet the logical state of a digital output to true or false
getdio get DO_G0 output 0Get the current logical state of a digital input or ouput
numdio num DO_G0 ouputsReport the number of input/output pins available to an IO bank
modedio mode DO_G0 open-drainConfigure digital outputs to source or sink current, when supported
pwmdio pwm DO_G0 0 1000000 50Set an output as PWM with period in microseconds, and duty in percent
edgedio edge DO_G0 0Get the number of rising and falling edges detected by a digital input

To exit the interactive terminal and enter byte-processing mode, run the byte_mode command.

For information about other terminal commands, see: Shell Commands

Byte Mode

When using byte mode, DIO commands are sent in the form of command packets, and each command will receive a status (and optional data) as a response.

The command header is eight bytes in length:

BytesDescriptionOptions
0The message ‘start of frame’ byte.Must be 0x01, or the message will be rejected. For non request/response frames, it is instead set as 0x02
1Indicates the kind of command transmittedMust be one of the Valid Command Kinds
2 – 3The status of the last commandShould be zero when sending a command, one of Status Codes when receiving
4 – 7The length of the transfered command dataMust be less than 248, and equal to the length of the command body in bytes
Command Header

All command headers must indicate the type of data to follow, by setting the command kind:

KindValue (u8)SizeDescription
DIO0x008 bytesCommands that get and set the state of MCU controlled digital IO banks
CAN0x016 bytesSideband configuration and reporting for CAN devices
Reset0x020 bytesCauses a cold-reset of the microcontroller
Version0x038 bytesReports the firmware version of the running application image
Ignition0x0410 bytesConfigures automotive and power features on supported devices
Disable0x050 bytesDisables byte processing of incoming data, and returns to an interactive shell
Valid Command Kinds

Each command sent will recieve a response from the microcontroller. This response may contain data, but can always be examined to determine if the command succeeded.

CodeValueDescription
Success0x0000The last command was processed successfully
Invalid Device0x0001The device indicated by the command exceeded the number of devices available to the system
Unbound Device0x0002The device targetted exists, but the MCU was unable to attach to and communicate with it
DIO – Invalid Pin0x0003The target pin exceeded the number of inputs or outputs actually present
DIO – Pin Read Failed0x0004Reading the state of the targetted pin failed for an unknown reason
DIO – Pin Write Faield0x0005Writing the state of the targetted pin failed for an unknown reason
DIO – Set Mode Unsupported0x0006Setting the DIO mode to push-pull or sink-source is not supported
Invalid Command0x0007The subcommand requested was outside of the valid range for the message kind
Bad Message Kind0x0008The message kind was not one of Valid Command Kinds
Version – Read Failed0x0009Reading the application version failed for an unknown reason
Status Codes

The DIO command format is as follows:

BytesDescriptionOptions
0The DIO action to perform on the deviceMust be one of DIO Actions
1The bank of digital IO to target, or the number of devicesMust be between 0 and the number of DIO banks available on the platform
2The pin index to get or setThe output pin index starts at 0, the input index starts at 0 + n-outputs
3The current state of the pin (if read), or the state to set (if written), or the mode to set (mode 0=sourcing, mode 1=sinking)0 or 1
4 – 7The edge-count of the pin, or the number of inputs/outputs0 – MAX_UNSIGNED_INT (u32)
DIO Actions

The digital IO command supports the following actions:

ActionValue (u8)Description
Get0x00Read the state and count of an input, or just the state of an output
Set0x01Set the logical state of a digital output
Set Count0x02Set the edge count of a digital input to the passed value
Set Mode0x03Switch between sink-source and open-collector drive mode on supported hardware
Num Devices0x04Reports the number of DIO banks available on the device
Num Outputs0x05Reports the number of outputs available to the indicated device
Num Inputs0x06Reports the number of inputs available to the indicated device
DIO Actions

Firmware Updates

  1. Download the zmu update tool for armv7l
  2. Download the latest firmware update (v.1.2.5.1)
  3. Update the firmware by running sudo chmod +x zmu && sudo ./zmu image upload fr202_dio_v1.2.5.1.app.bin

Front Display

Demo Application

A sample application demonstrating some simple features of the display is provided here. Pieces of this sample package are referenced in the display sections following. It also ships on all OnLogic-provided Pi OS and Ubuntu software images, enabled by default. To disable it, run sudo systemctl disable demo-display from a terminal window.

Display IC Part Numbers

Touch Controller:      ST1633i

Display Controller:    ST7789V

Controlling the Backlight

Display backlight is controlled by an i2c expander at 0x3C on I2C1. 

The OnLogic-provided utility “fr202-i2c” can control the backlight with the commands:

Enable: fr202-i2c set p7v6_shdn 0

Disable: fr202-i2c set p7v6_shdn 1

A list of other controllable signals is available in the help text for the tool. It is provided with the display code samples as well as 

The backlight can also be enabled using the i2ctools utilities as follows:

Configure GPIO IC: i2cset -y 1 0x3c 0x03 0x81

Enable: i2cset -y 1 0x3c 0x01 0xbf

Disable: i2cset -y 1 0x3c 0x01 0xff

Images, Text, and Touch via Python

pip install st7789

apt install python3-rpi.gpio python3-spidev python3-pil python3-numpy 

The provided python example “demo-display” demonstrates the use of Python’s PIL and the ST7789 display library to display static images and text. It runs as a service in OnLogic-provided Pi OS and Ubuntu installations as well.

Video via Python

pip install opencv-python

apt install libatlas-base-dev

pip install -U numpy

The separately provided example “st7789-video” demonstrates the use of opencv’s video library to show a video on-screen. By default, the sample is configured to read and display a video called “test.avi” in the same folder as the application. A video is not provided.

ADC

The ADC is attached to SPI 4 CS0. 

The ADC part number is LTC2448; a description of the SPI protocol can be found in the device manual here.

All ADC channels are differential and configured as follows:
ANALOG IN 0: Channel 0+1

ANALOG IN 1: Channel 2+3

ANALOG IN 2: Channel 4+5

ANALOG IN 3: Channel 6+7

TEMPERATURE 0: SENSOR Channel 8+9, REFERENCE Channel 10+11

TEMPERATURE 0: SENSOR Channel 12+13, REFERENCE Channel 14+15

Known issues / errata

Booting Ubuntu via USB may result in a black screen if the eMMC has an OS image on it. Wiping the eMMC and/or M.2 drive is recommended if that is encountered.

Updated on November 18, 2022

Was this article helpful?

Keep In Touch.
Subscribe today and we’ll send the latest product and content updates right to your inbox.
Subscribe