This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM3359: Request for Guidance on Loading U-Boot, Kernel, and RAM FS to eMMC on AM335x Custom Board

Part Number: AM3359

Tool/software:

Dear TI Support Team,

 I am working on an AM335x-based custom board and need support with transitioning from a TFTP-based boot to a persistent eMMC boot solution. Here’s my current status and specific queries:

Current Setup & Progress
Serial Loading (X/Y-Modem):

Successfully loaded u-boot-spl.bin (SPL) and u-boot.img via serial.

Board boots to U-Boot prompt over UART.

TFTP Booting (Temporary):

Transferred the following files to RAM via TFTP:

MLO (SPL) → 0x80000000

zImage (kernel with embedded RAM-based rootfs) → 0x82000000

Device tree blob (am335x-custom.dtb) → 0x88000000

Verified boot using:


=> setenv bootargs console=ttyO0,115200n8 root=/dev/ram0 rw
=> bootz 0x82000000 - 0x88000000
Result: System boots successfully in RAM.

Goal: Persistent eMMC Boot
I now need to write these images to eMMC so the board boots autonomously after power cycles. My board has a 4GB eMMC (MTFC4GACAJCN-4M IT) and no SD card slot.

Key Questions:
Partitioning:

What is the recommended partition layout for eMMC?

Raw SPL/MLO area

FAT partition for kernel/DTB

(Optional) EXT4 for rootfs (though I use RAM FS for now).

Writing Images:

How to correctly use mmc write to flash:

MLO to the boot sector.

zImage and DTB to a FAT partition.

Example commands I’ve tried (but need validation):


=> mmc dev 1
=> mmc write 0x80000000 0x100 0x300 # MLO to boot area (384KB)
=> fatwrite mmc 1:1 0x82000000 zImage ${filesize} # Fails: "Bad device"
Environment Storage:

saveenv fails with ** Bad device mmc 0 **. How to configure environment to use eMMC?

Alternative Methods:

If FAT commands are unavailable, can I use raw mmc write for all images? What offsets/sizes?

Requested Guidance
Could you please provide:

A step-by-step sequence of U-Boot commands to:

Partition eMMC (GPT/MBR).

Write MLO, zImage, and DTB using mmc write or alternatives.

Configure bootcmd for eMMC boot.

Clarification on:

eMMC boot partition numbering (boot0/boot1/user).

Handling embedded RAM FS in zImage (no separate rootfs partition needed).

Debugging tips if fat commands are unavailable.

Board Details
Processor: AM3359

eMMC: 4GB (MTFC4GACAJCN-4M IT)

U-Boot Version: 2018.01

Current Boot Flow: Serial → TFTP → RAM (working).

Thank you for your time and expertise. I’ve attached my U-Boot environment and partition layout for reference. Please let me know if further details are needed.

Best regards,

Raj

  • Hi Raj,

    Please review the AM335x TRM Section 26.1.8.5 "MMC/SD Cards".

    In summary,

    AM335x eMMC boot is from UDA, not boot partitions. The UDA should be MBR partition format, gpt is not supported.

    If you familiar with SD card boot on AM335x, the eMMC UDA would be partitioned/formatted in the same way as SD card boot: UDA has 2 partitions, first partition is in FAT format to host MLO and u-boot.img, and the second partition could be for example ext4 format to host Linux rootfs.

  • Dear Bin Liu,

    Thank you for your response and support.

    We are working with a custom AM3359 EVM board, which does not include an SD card interface. Instead, we are currently using Serial and TFTP boot methods for initial loading and testing.

     Current Progress:
    Using TFTP and serail , we have successfully transferred the following files into RAM:

    u-boot-spl.bin

    u-boot.img

    zImage (which contains a RAM-based root filesystem(i.e we dont have a seperate file system))

    Device Tree Blob (.dtb)

    The system boots successfully from RAM, and we have verified that the zImage with embedded initramfs works perfectly during this temporary setup.

     Objective:
    We now want to permanently boot from eMMC memory—i.e., after every power-off and power-on cycle, the system should boot entirely from eMMC without needing serial or TFTP

    Request for Guidance:
    We would appreciate your detailed guidance on the following points:

    Steps to Copy Files from RAM to eMMC
    Once we load files (zImage, dtb, etc.) into RAM via TFTP, how do we copy them into the correct locations in eMMC using U-Boot commands?

    U-Boot Environment Setup
    Is it necessary to create a boot script like uEnv.txt in eMMC for booting? If so:

    Where exactly should this file be placed?

    What should be its content for booting zImage with RAM filesystem?

    Handling saveenv Failure
    When attempting to use saveenv, U-Boot returns an error such as:
    *** Warning - bad CRC, using default environment
    Failed to save environment to MMC...
    We suspect this may be due to a misconfiguration in the environment storage area.

    Could you help us identify where and how to properly configure CONFIG_ENV_IS_IN_MMC or the environment offset in U-Boot to ensure the environment variables are saved correctly to eMMC?

    Expected Partition Layout
    What should be the recommended eMMC partition layout for:

    U-Boot

    Kernel image(here my zimage itself having ram based file system)

    DTB

    Optional boot scripts (uEnv.txt)

    Automating Boot from eMMC
    Once files are copied into eMMC, what are the required environment variables to configure in U-Boot so that the boot process automatically uses eMMC (mmc1) as the boot source?

    Environment Info:


    Processor: AM3359

    Boot mode: TFTP/Serial (initially)

    Target: Boot entirely from eMMC

    SDK version: TI Processor SDK Linux AM335x 05.00.00.15

    U-Boot version: 2018.01 (TI release)

    We look forward to your technical input on the correct procedure to copy images into eMMC and configure U-Boot for a stable eMMC boot process.

    Thank you again for your support.

    Best regards,
    Raj

  • Hi Raj,

    I have already explained the eMMC UDA partition and format information, you can have all different way to partitioning/formatting eMMC and copy U-boot binaries and root filesystem to the eMMC.

    If this is still not clear, I recommend you get a Beaglebone Black board, and boot it from a SD card, then understand how the sdcard hosts U-Boot and Linux. The eMMC UDA is pretty much works in the same way as the booting sdcard.