1. Home
  2. ARM Platforms
  3. Factor FR201 and FR202 Technical Resources
  1. Home
  2. OnLogic Systems
  3. Industrial Fanless Line
  4. Factor FR201 and FR202 Technical Resources

Factor FR201 and FR202 Technical Resources

This article also applies to the IGN801(FR201) and IGN802 (FR202).

Manuals and Downloads

FR201 – User Manual

FR202 – User Manual

Raspberry PI Imager

Raspberry Pi Firmware Tool (for eMMC)

Configuration Files (required when installing an OS):

Bullseye 32bit files- Download
Bullseye 64bit files – Download

Bookworm 32bit files- Download
Bookworm 64bit files – Download


**If installing to FR202, you will need to add the lines to the config.txt file noted in the FR202 Demo Program section below for Bullseye.

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?

You will be prompted to change this when logging in for the first time
Raspberry Pi OS: pi/raspberry
ubuntu: ubuntu/ubuntu

Which Operating Systems are supported?

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)[Bullseye & Bookworm]
Raspberry Pi OS (32bit & 64bit)[Bullseye & Bookworm]

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

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

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.

How can I install my own Linux image?

When installing your own OS, make sure to use the OnLogic config.txt and usercfg.txt files. These allow the OnLogic designed FR200 series daughterboards to function properly. You can download the needed files from here .

How does the serial port enumerate?

The serial port typically enumerates as /dev/ttyUSB0. If you have a USB drive connected, it will use the next lowest number (i.e. /dev/ttyUSB1). The hardware ID of the serial port chip is F81439A.

What is the Config.txt file for?

Raspberry Pi modules do not use a BIOS like traditional desktop computers. Intead, they use Config.txt and Usercfg.txt files. Raspberry Pi has details about the files and use here .

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

FR201 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 x2 M2 screws.
  • To remove the module, remove the x2 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 x3 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.

FR202 Disassembly

  • Remove the 7 M3x4mm screws from the bottom of the system.
  • Remove the bottom bottom lid by lifting straight up.
  • Remove the internal storage cooler. Note that it “hooks” around the I/O board.
  • You will now have access to the I/O board. This connects to the FR202 motherboard via the Raspberry Pi GPIO connector (shown below on the LEFT). Note that models with LCD screens will have the x2 additional connectors (shown below on the RIGHT).

    Remove the x4 5mm hex standoffs to loosen the I/O board. You can now disconnect the GPIO connector to get access to the FR202 motherboard.

    *Note: If your system has an LCD, be careful of the x2 additional connectors on the right.
  • You now have access to the FR200 motherboard. Components such as the TPM, storage drives, and wireless modules

Installing Operating Systems

Factor series systems currently support Ubuntu 20.04, Ubuntu 22.04, and Raspberry Pi OS (Bullseye and Bookworm) OSes. Other OSes or versions may not install or function properly.

Follow the steps below to install one of these operating systems. Make sure to verify if your system has eMMC storage or not. Many systems shipped from OnLogic have the OS installed onto the M.2 SATA drive.

Installing Raspberry PI OS to SATA 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.

  • 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!
  • Access the “boot” partition in your file browser and locate the config.txt file. You will need to replace the config.txt with the OnLogic one, and add usercfg.txt to the “boot” directory. Note that there are differences between 32 bit and 64 bit, so download your preferred file from here:

Bullseye 32bit files- Download
Bullseye 64bit files – Download

Bookworm 32bit files- Download
Bookworm 64bit files – Download

  • 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 SATA 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.


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.
  • 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 then plug it back in.

Access the “boot” partition in your file browser and locate the config.txt file. You will need to replace the config.txt with the OnLogic one, and add usercfg.txt to the “boot” directory. Note that there are differences between 32 bit and 64 bit, so download your preferred file from here:

Bullseye 32bit files- Download
Bullseye 64bit files – Download

Bookworm 32bit files- Download
Bookworm 64bit files – Download

  • 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 Ubuntu to SATA 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.

The Factor series systems are compatible with Ubuntu versions 20.04 and 22.04 (both Desktop and Server). Other versions are not supported and may present errors during installation or general use. You can review the supported OS in the FAQs section above.

  • 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 one of the the zipped file 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:

Bullseye 32bit files- Download
Bullseye 64bit files – Download

Bookworm 32bit files- Download
Bookworm 64bit files – Download

  • 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, the 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. Use a different flash drive and set it up again.
  • If completed successfully, 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.

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.

The Factor series systems are compatible with Ubuntu versions 20.04 and 22.04 (both Desktop and Server). Other versions are not supported and may present errors during installation or general use. You can review the supported OS in the FAQs section above.

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 one of the zipped 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:

Bullseye 32bit files- Download
Bullseye 64bit files – Download

Bookworm 32bit files- Download
Bookworm 64bit files – Download

  • 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.

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 SATA M.2 storage drive

The CM4 module has a hardcoded boot order of eMMC > SATA M.2 > USB. This can be problematic if the image on the eMMC or SATA 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 a SATA 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 SATA 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

A SATA 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.


Factor Series Features

Setting the Serial Mode (RS232/RS422/RS485)

The FR200 series serial mode can be controlled by configuring the embedded FTDI EEPROM. 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 Source .tar.bz2 from the Intra2Net page here:
    https://www.intra2net.com/en/developer/libftdi/download.php|
    Example:
    wget https://www.intra2net.com/en/developer/libftdi/download/libftdi1-1.5.tar.bz2
  • Extract the download to a folder.
    Example:
    tar -xf libftdi1-1.5.tar.bz2
  • 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
  • Alternatively, you can also clone libFTDI with git: git clone git://developer.intra2net.com/libftdi

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 ftdi_eeprom --flash-eeprom FR200_<protocol>.conf
    • RS232 Example: sudo ftdi_eeprom --flash-eeprom FR200_RS232.conf
  • Reboot for changes to take effect: sudo shutdown -r now

With the serial port configuration enabled, the port will now enumerate as /dev/ttyUSB[x], where [x] is the port number. This is typically /dev/ttyUSB0, but may be enumerated differently depending on other USB devices connected. You can also identify the serial port chip via the hardware ID, which is F81439A.

TPM

The TPM is an optional Nuvoton-based hardware add-on for the FR200 series systems.

You can download the required Device Tree files and Readme installation instructions from here:

FR200 Series TPM Files

PoE

Important notes about Factor PoE (Power Over Ethernet) PD setup and the various revisions of the module.

  • Do not connect both power inputs at the same time. Only connect x1 power connection (either PoE OR terminal block).
  • Review specific details in the specific models below

ADP125

The ADP125 is an isolated PoE PD (powered device) modules. Factor series systems configured and shipped in August 2024 or later have this version of the module. This offers isolation/protection from transient voltage of up to 100KV.

ADP122

Important notes about Factor PoE (Power Over Ethernet) setup when using the ADP122 addon module:

  • Do not connect both power inputs at the same time. Only connect x1 power connection (either PoE OR terminal block).

The ADP122 is a non-isolated PoE PD (powered device) module. The FR200 product family provides a ground scheme that isolates digital and chassis ground. Downstream equipment may modify this ground scheme by shorting chassis and digital ground together within the cabling or attached circuitry. Downstream or upstream devices that depend on isolated digital and shield/chassis grounds may experience performance degradation as a result of this equipment.

In the event of a break in ground scheme due to installation environment and connected equipment, there is no safety concern.  However, equipment that depends on ground isolation for protection or measurement may experience loss of performance including, but not limited to, inaccuracy of power measurement or power delivery or equipment damage.

You can review additional details in the Errata document below:


FR202 Features

Functions listed in this FR202 Features section are in addition to the Factor Series Features section above, and for the FR202 system only. The below features and not available on the FR201 platform.

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

Firmware Updates

VersionRelease DateLink Release Notes
1.3.1.009/15/2023DownloadImproves the stability of the “byte mode” protocol
1.2.5.1Initial launchDownloadInitial launch
Update the Firmware with the file(s) above. You can follow this how-to guide for installation instructions.

Digital IO (DIO)

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
4The length of the transfered command dataMust be less than 56, and equal to the length of the command body in bytes
5-7ReservedMust be 0x00
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

Front Display

Demo Application

A sample application demonstrating some simple features of the display is provided for each of the supported Operating systems here:

On systems pre-installed with an OS from OnLogic, the display demo files are located under /usr/sbin/demo-display and /etc/systemd/system/demo-display.service

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.

If you have deployed Bookworm onto your Factor unit since receiving it you may see the demo program not work right away. If you see this behavior please type `raspi-config` in the Linux terminal, select `Interface Options` then select `I2C` and enable it.

Display IC Part Numbers

Display Controller:    ST7789V

Controlling the Backlight

Touch Controller:      ST1633i

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 (Analog/Digital Converter)

The ADC is attached to SPI 4 CS0. Look for this device name in your OS hardware list.
Example: /dev/spidev4.0 

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

An example of accessing the ADC can be found in the FR202-demo program as well. You can download it from here. Search for “adc” in the demo-display file for examples.

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

Troubleshooting

General OS/system issues

If you are encountering general issues with your FR200 series system, such as the Real-Time-Clock (RTC) disconnecting, various ports not being detected, or features not working as expected, make sure you’re using the OnLogic provided config.txt and usercfg.txt files. These add additional functionality to the system, and allow the Raspberry Pi CM4 module to properly interface with the OnLogic designed FR200 series daughterboards. You can download the files from the Manual and Downloads section above.

You should make sure that any Factor (FR201 and FR202) units have the following lines in the config.txt file:

# Enable the audio output, I2C and SPI interfaces on the GPIO header. As these
# parameters related to the base device-tree they must appear *before* any
# other dtoverlay= specification
dtparam=audio=on
dtparam=i2c_arm=on
#dtparam=spi=on

For the FR202 specifically, you will also need to ensure the config.txt file includes:

dtoverlay=spi4-1cs
dtoverlay=spi3-1cs,cs0_pin=24
dtoverlay=i2c5,pins12_13=on,baudrate=40000

Missing/Disabled Ethernet port in Ubuntu

If one of the Ethernet ports is not detected or shows as Disabled in Ubuntu, you can follow these steps to add it into Netplan and enable it.

  1. Run the following command:
lshw
Network: DISABLED
  1. Look for the Logical name, which is required in the next step, and run the following commands
cd /etc
cd netplan
sudo nano 50-cloud-init.yaml
  1. Add the logical name (found in Step 2) to the 50-cloud-init.yaml file. See an example below:
  1. Close and save, then run the following commands
sudo netplan apply
reboot

TPM module not working/detected

If the TPM modules is not working properly, or failing to be detected, make sure that the usercfg.txt files includes the following lines (you may need to modify existing lines):

#to enable tpm SPI
dtoverlay=tpm-nuvoton

Booting via USB results in black screen

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.


Power LED does not turn on

Some operating system versions require different config.txt settings to make the power indicator light function. If your Factor unit is otherwise functional, but the power indicator light is not lighting up, this is likely an issue with the config.txt file. Look for the following lines in the file:

dtparam=pwr_led_trigger=backlight
drparam=pwr_led_activelow=on

Replace those lines with

dtparam=pwr_led_trigger=default-on
dtparam=pwr_led_activelow=off

Display Demo Program not working

If you’re seeing issues using the FR202 LCD display, or seeing errors when running the FR202-demo scripts, make the following changes to your config.txt file:

Delete/comment out:
dtparam=spi=on

Add:
dtoverlay=spi4-1cs
dtoverlay=spi3-1cs,cs0_pin=24
dtoverlay=i2c5,pins12_13=on,baudrate=40000

After making any changes, save and restart the operating system.

Experiencing Slow Wi-Fi Speeds

The Factor’s CM4 compute module has a built-in Wi-Fi antenna that it uses by default instead of the attached external antenna. The config file /boot/firmware/config.txt (or /boot/config.txt depending on your OS) may need to be updated for the CM4 to use the external antenna to connect to Wi-Fi instead of its internal one. To do this, open the specified config file and add the line ‘dtparam=ant2’ and then rebooting your system. This should provide a noticeable improvement in Wi-Fi speeds.

Wi-Fi or Modem Not Connecting to Internet

In a Factor with 4G LTE and Wi-Fi, there can be an issue where the devices “compete” for priority over each other, preventing them from connecting properly to the internet. To resolve this, you will need to set the priorities for the devices in the ‘/etc/dhcpcd.conf’ file for the Raspberry Pi OS and in the netplan configuration for the Ubuntu OS. You can do this by entering the following into the configuration file:

interface wlan0
metric 100
interface eth0
metric 200

The lower the metric, the higher priority. So in this example, the WIFI device (wlan0) will take priority over the ethernet. What that is doing is ensuring that the WIFI device’s default route is being used to route network traffic. The customer may need to set priorities for each network device, which for Factor is eth0, eth1, wlan0, and usb0, where usb0 is the AMIT card.

Updated on September 19, 2024

Was this article helpful?

Related Articles

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