Using the PHYTEC EEPROM Flashtool

The phyCORE-AM57x SOM offers versatility with various processor variants. The PHYTEC EEPROM Flashtool simplifies development kit evaluation by storing a SOM’s configuration in the onboard EEPROM. During boot, the configuration is read from the EEPROM, allowing a single software image to support all phyCORE-AM57x variants.

The EEPROM Flashtool uses a configuration file containing all valid SOM configuration options. This file is present by default in the root filesystem of the phyCORE-AM57x Linux BSP at /usr/bin/phytec-eeprom-flashtool/configs/PCM-057.yml. When you specify a particular SOM part number, this file is parsed for details about your SOM.

This article details the use of the PHYTEC EEPROM Flashtool for use with phyCORE-AM57x development kit.

Note

Checkout the source code for the EEPROM Flashtool!

Does my EEPROM need to be flashed?

If you’re dealing with an unprogrammed EEPROM on your SOM, it’s crucial to flash it using the EEPROM Flashtool. Otherwise, your SOM may assume a minimal configuration, limiting access to the full RAM and other features available.

Upon the initial power-up of the development kit, the bootloader loads into memory, providing a log of information to the serial console. Checking this boot log helps identify the configuration assumed by the bootloader for your SOM.

This bootlog was captured after the EEPROM contents of a PCM-057-40300111I.A2 SOM were erased:

Target (Boot Log Example)
U-Boot SPL 2021.01-g84a5eea362 (Nov 01 2023 - 10:29:54 +0000)
DRA752-GP ES2.0
Trying to boot from MMC1
no pinctrl state for default mode
Loading Environment from FAT... no pinctrl state for default mode
OK


U-Boot 2021.01-g84a5eea362 (Nov 01 2023 - 10:29:54 +0000)

CPU  : DRA752-GP ES2.0
Model: PHYTEC PCM-948 AM57x RDK
SoM:   PHYTEC phyCORE-AM57x (41300111I)
DRAM:  1 GiB
MMC:   no pinctrl state for default mode
Loading Environment from FAT... OK
PHYTEC: unknown board name. Defaulting to am57xx_phycore_kit, a MINIMAL AM5716 configuration
Net:   eth2: ethernet@48484000
Hit any key to stop autoboot:  0

In this bootlog excerpt, it’s evident that the bootloader couldn’t determine the SOM configuration from the EEPROM’s contents. Consequently, the bootloader configures the SOM as a “MINIMAL AM5716 configuration.”

Another indication is that the bootloader sets up only 1GiB of DDR memory, whereas it is anticipated to have 2GiBs on the PCM-057-40300111I.A2 SOM.

Using the Flashtool

In the phyCORE-AM57x Linux BSP, locate the EEPROM Flashtool at /usr/bin/phytec-eeprom-flashtool/. To use it as per this guide, you need to add this location to the PATH environment variable.

  • Execute the following command to add the EEPROM Flashtool directory to your PATH:

Target (Linux)
export PATH=/usr/bin/phytec-eeprom-flashtool:$PATH
  • Using the EEPROM Flashtool requires knowledge of essential details about your SOM, including:

    1. SOM Part Number: The part number for the SOM will have to be known. For example, “PCM-057-40300111I.A2” is a valid part number. If unsure, refer to the Part Number Table in the Release Notes or contact PHYTEC Support.

    2. SOM PCB Revision Number: The revision number for the SOM will have to be known. This number can be found directly on the SOM. For the phyCORE-AM57x the revision number can be identified by the PCB number “1428.X,” where “X” represents the revision number.

Read the SOM Configuration

The read command retrieves the EEPROM’s contents and prints them to the console based on the kit options specified in the PCM-057.yml file.

Target (Linux)
phytec_eeprom_flashtool.py read PCM-057

Write the SOM Configuration

The write command parses the kit options described by the PCM-057.yml file and writes the relevant information describing your SOM to the EEPROM.

Target (Linux)
phytec_eeprom_flashtool.py write <SOM Part Number> <SOM PCB Revision>

Display Data

The display command interprets the kit options outlined in the PCM-057.yml file and outputs the resulting EEPROM contents relevant to your SOM without making any changes to the EEPROM. This command is intended as a “dry run” for the write command.

Target (Linux)
phytec_eeprom_flashtool.py display <SOM Part Number> <SOM PCB Revision>

Advanced Usage

After programming the EEPROM with the correct options for your SOM using the EEPROM Flashtool, you can utilize the stored data to configure the board according to your preferences. Presently, PHYTEC uses the EEPROM data to configure parameters such as RAM size/timings, enable ECC support, and set the board name. Examples of how EEPROM data is utilized can be found in the uboot-phytec Git repo. The following links will provide relevant files for reference:

PHYTEC EEPROM reading and writing functions

RAM size, timing, ECC support detection and board detection