Problems flashing an 8GB DRAM iot-gateway-imx8plus

When flashing a Compulab IOTG-IMX8PLUS 8G DRAM using the tool on wsl2, flashing u-boot fails with LIBUSB_ERROR_IO.
I get the error:

1:1      1/ 2 [HID(W):LIBUSB_ERROR_IO                ] SDPS: boot -f "/usr/src/app//imx-boot-iot-gate-imx8plus-d1d8-sd.bin-flash_evk"

Monitoring the serial port gets me this:

pca9450@25 [ldo4][u] = 1v8
DDRINFO: Cfg attempt: [ 2/4 ]
DDRINFO(?): Samsung 1024MB @ 3000 MHz
DDRINFO: start DRAM init
DDRINFO: DRAM rate 3000MTS
DDRINFO:ddrphy calibration done
DDRINFO: ddrmix config done
DDRINFO(M): mr5-8 [ 0xff070018 ]
DDRINFO(T): mr5-8 [ 0x1050008 ]
spl_dram_init Reset ... 

I’m sure to switch from the -d2d4 image to the -d1d8 image when trying to flash the 8GB gateway.
It does work with a 4GB DRAM 32GB eMMC though

Hello @kirwinr thanks for your message

Could you please share more details on how are you flashing your device? What OS version are you trying to flash? What are you running in your host computer?

Thanks

I’ve tried flashing both 6.0.36 and 6.1.0+rev7.
I’m using https://github.com/balena-os/iot-gate-imx8plus-flashtools.git with the command ./run_container.sh -i $IMG_PATH

I’m not sure what you mean by “What are you running in your host computer?”

Here is how I’m downloading the newest version:

# Get the latest image version from the balena API
LATEST_IMAGE_VERSION=$(balena os versions iot-gate-imx8plus | head -n 1)
echo "Latest image version: $LATEST_IMAGE_VERSION"

# Create a directory to store the images if it does not exist
if [ ! -d "images" ]; then
    mkdir images
fi

# Check if the image is already downloaded
if [ -f "./images/$LATEST_IMAGE_VERSION.img" ]; then
    echo "Image already downloaded, copying to current directory"
    cp "./images/$LATEST_IMAGE_VERSION.img" . &
else
    # Download the latest image
    echo "Downloading image: $LATEST_IMAGE_VERSION" 
    (
        balena os download iot-gate-imx8plus-d1d8 -o ./images/$LATEST_IMAGE_VERSION.img --version $LATEST_IMAGE_VERSION
        cp "./images/$LATEST_IMAGE_VERSION.img" .
    ) &
fi

Hi,

It appears that you are trying to flash a Compulab IOT-GATE-iMX8PLUS 1G-8G DRAM image on a IOT-DIN-D1D8 device. Could you please check if flashing the “Compulab IOTDIN-iMX8P 1G-8G DRAM” OS image triggers the same error?

1 Like

@acostach
I’m sorry, I mistyped. I’m trying to flash an IOTG-IMX8PLUS.

I’ve edited the original post.

Thank you for clarifying, so the device-type is a IOT-GATE-iMX8PLUS 8GB DRAM and the image downloaded is:

iot-gate-imx8plus-d1d8

I wonder if running this on wsl2 has anything to do with the libusb I/O error, unfortunately I don’t have a setup to test.

Can you please check if:

@acostach When flashing u-boot, I get the following output:

Wait for Known USB Device Appear...
New USB Device Attached at 1:1-0616880011523B6E
1:1-0616880011523B6E>Start Cmd:SDPS: boot -f flash.bin.d1d8
11%1:1-0616880011523B6E>Fail HID(W): LIBUSB_ERROR_IO (-1)(1.056s)
New USB Device Attached at 1:1-0616880011523B6E
1:1-0616880011523B6E>Start Cmd:SDPS: boot -f flash.bin.d1d8
11%1:1-0616880011523B6E>Fail HID(W): LIBUSB_ERROR_IO (-1)(0.604s)
New USB Device Attached at 1:1-0616880011523B6E
1:1-0616880011523B6E>Start Cmd:SDPS: boot -f flash.bin.d1d8
11%1:1-0616880011523B6E>Fail HID(W): LIBUSB_ERROR_IO (-1)(0.648s)
New USB Device Attached at 1:1-0616880011523B6E
1:1-0616880011523B6E>Start Cmd:SDPS: boot -f flash.bin.d1d8
100%1:1-0616880011523B6E>Okay (2.986s)
New USB Device Attached at 1:1-0616880011523B6E
1:1-0616880011523B6E>Start Cmd:FB: ucmd setenv fastboot_dev mmc
1:1-0616880011523B6E>Okay (0.022s)
1:1-0616880011523B6E>Start Cmd:FB: ucmd setenv mmcdev ${emmc_dev}
1:1-0616880011523B6E>Okay (0.573s)
1:1-0616880011523B6E>Start Cmd:FB: ucmd mmc dev ${emmc_dev}
1:1-0616880011523B6E>Okay (0.539s)
1:1-0616880011523B6E>Start Cmd:FB: flash bootloader flash.bin.d1d8
0x400000001:1-0616880011523B6E>Okay (0.707s)
1:1-0616880011523B6E>Start Cmd:FB: ucmd if env exists emmc_ack; then ; else setenv emmc_ack 0; fi;
1:1-0616880011523B6E>Okay (0.012s)
1:1-0616880011523B6E>Start Cmd:FB: ucmd mmc partconf ${emmc_dev} ${emmc_ack} 1 0
1:1-0616880011523B6E>Okay (0.012s)
1:1-0616880011523B6E>Start Cmd:FB: Done
1:1-0616880011523B6E>Okay (0s)

I’m hesitant on blaming it on wsl2 because when flashing iot-gate-imx8plus-d2d4 to a 4 GB DRAM gateway, it works fine.

Ok, so flashing the recovery u-boot from IOT-GATE-IMX8PLUS and SBC-IOT-IMX8PLUS: U-Boot: Recovery - Compulab Mediawiki works as expected? I do see libusub IO errors in the log you shared above so it’s not clear if it does fully work as expected or not

@acostach It works after a series of retries.

Thanks @kirwinr , so it seems this may not be related to the actual OS image. I pinged our partner about this in the github issue

@acostach Thank you for your help!

@acostach
Now that the solution is merged into the os image, how long will it take to show up when querying os versions? I’ve noticed that the github releases page has releases all the way up to v6.1.0+rev28 whereas the latest version accessible from the cli is v6.1.0+rev7.

@kirwinr the new v6.3.11 images in balena-cloud include the changes that Compulab kindly provided. Let us know if the issue is still present with this new release

1 Like