How to flash latest u-boot on pocket reform

Hi,

@andypiper @digitalrayne @Chartreuse I am reaching out to you because according to Flashing eMMC Bootloader / Unbricking (IMX8MP) you are the people (other than MNT) who not only know how to flash u-boot to imx8mplus but also how to recover if something goes wrong.

We have some somewhat important fixes collected in the imx8mplus u-boot repository like the fdtfile issue or setting the screen rotation via u-boot. I created a merge request to tag the latest git HEAD: release 2024-11-14 (!3) · Merge requests · Reform / MNT Reform i.MX8MPlus U-Boot Build · GitLab

I need some volunteers to help me with that because:

  1. somebody needs to test the flash.bin files produced by above MR3 actually work when flashed onto the imx8mplus and
  2. does reform-flash-uboot do the right thing on the imx8mplus? The latest reform-tools upload (version 1.60) allows reform-flash-uboot to flash u-boot on imx8mplus but with a warning. Does that actually work? Can somebody try this out?

Thank you!! :heart:

3 Likes

I’m currently running the RK3588 in my Pocket Reform so it’s not straightforward for me to check any of this; unlikely to be able to help before next week at the earliest.

2 Likes

@josch I tested both the reform-flash-uboot script and the flash.bin from the MR linked (I used this artifact).

TL;DR is that both work correctly on my Pocket Reform with IMX8MP, with a couple of small notes below.

For reform-flash-uboot, I installed a fresh copy of the latest Pocket Reform system image for IMX8MP to SD card, and updated all packages, then rebooted. After this, I ran reform-flash-uboot emmc as root. Uboot was downloaded and updated correctly, and a reboot afterward is successful. I reviewed the reform-flash-uboot script and it is updating the correct device and downloading the correct uboot.bin for IMX8MP Pocket Reform. So, no issues there that I can see and the process tested correctly

For the new uboot on the linked MR, I downloaded the file manually, and then ran the following:

wget https://source.mnt.re/josch/reform-imx8mp-uboot/-/jobs/6780/artifacts/raw/imx8mp-mnt-pocket-reform-flash.bin
echo 0 > /sys/class/block/mmcblk2boot0/force_ro
dd if=imx8mp-mnt-pocket-reform-flash.bin of=/dev/mmcblk2boot0
sync
reboot

After this was finished, upon reboot, I had a small hiccup which I think was related to a bad install I still haven’t properly cleaned from my Pocket Reform’s eMMC, which was partially wiped. I noted on boot that /dev/mmcblk2* was being mounted and checked, and it didn’t boot correctly. I rebooted again and the Pocket booted from the SD-card install automatically, which booted perfectly with the new uboot, no issues at all.

To make sure my dodgy eMMC install was causing the issue I experienced, I then wiped my eMMC entirely (with wipefs -a /dev/mmcblk2, skipping uboot of course, as force_ro was still set to 1 on mmcblk2boot0, preventing writes to the boot blocks) and rebooted and everything worked as expected. The Pocket Reform booted from the system image on the SD card with the new uboot on eMMC without any issues at all.

So that hiccup on first boot seems explainable as remnants of a dodgy eMMC install, and not related to the new uboot image. Just documenting this for completeness. As far as I can test, this is all working correctly too.

I do notice that on the new uboot there is a brief green flash on the screen prior to the text console appearing - it doesn’t prevent anything from working and goes away immediately, but I thought I should mention it. It’s purely a cosmetic difference I noticed. Hope this helps!

5 Likes

This is absolutely exactly what I was looking for! Thank you!!! :heart: :heart: :heart: :heart: :heart: (spamming the hearts here as it seems that even forum mods are only allowed to click the “like” button once – thank you!! :smiling_face_with_three_hearts:)

5 Likes