I have an imx8mmevk board, and I want to generate an image with Yocto containing Mender,
So I did follow the demo mender from this website: Mender-demo
The image core-image-base was built successfully, and now I have the choice to flash the image in an SDCARD or in the eMMC flash,
SDCARD was flashed correctly with dd , and the system boots correctly
For the eMMC I’m using uuu (Universal Update Utiliy) of NXP to flash it, I’m fimilar with this tool and I always flash the eMMC, but to flash the eMMC I need to give the bootloader alone and the image img too,
the question is when I’m giving it the u-boot-imx and the sdimg it fails,
And I think the problem is that the sdimg is already containing a BOOT partition
I have an idea with MENDER_BOOT_PART_SIZE_MB = “0”
Is my idea is correct or there is an other solution ?
I think you are on the right track, and the problem is probably that the sdimg contains the bootloader binary as well.
To disable this you would need to override this variable (set it to an empty string), which will disable the logic to embedded the U-Boot binary in to the sdimg file.
This is not working , I made it an empty string and I rebuilt core-image-base
And I flashed the emmc of the board with :
imx-boot-imx8mmevk-sd.bin-flash_evk as bootloader
and core-image-base-imx8mmevk-20191111091630.sdimg as the image
but when booting the board it stuck at u-boot , I think because it’s not the right bootloader it dont know that the emmc is splitted as 4 partitions
I changed the MENDER_STORAGE_DEVICE_imx8mmevk = “/dev/mmcblk1” to 0
and still not booting
I think the problem is with the bootloader
How can I generate a mender u-boot separatly ,
help plesae
CPU: Freescale i.MX8MMQ rev1.0 1800 MHz (running at 1200 MHz)
CPU: Commercial temperature grade (0C to 95C) at 43C
Reset cause: POR
Model: FSL i.MX8MM EVK board
DRAM: 2 GiB
TCPC: Vendor ID [0x1fc9], Product ID [0x5110], Addr [I2C1 0x52]
Power supply on USB2
TCPC: Vendor ID [0x1fc9], Product ID [0x5110], Addr [I2C1 0x50]
MMC: FSL_SDHC: 0, FSL_SDHC: 1
Loading Environment from MMC… *** Warning - bad CRC, using default environment
Failed (-5)
No panel detected: default to MIPI2HDMI
adv7535_init: Can’t find device id=0x3d, on bus 1
Display: MIPI2HDMI (1920x1080)
Video: 1920x1080x24
In: serial
Out: serial
Err: serial
switch to partitions #0, OK
mmc1(part 0) is current device
flash target is MMC:1
Net:
Warning: ethernet@30be0000 using MAC address from ROM
eth0: ethernet@30be0000
Fastboot: Normal
Normal Boot
Hit any key to stop autoboot: 0
switch to partitions #0, OK
mmc1(part 0) is current device
** Unable to read file boot.scr **
Saving Environment to MMC… Writing to redundant MMC(1)… OK
Card did not respond to voltage select!
** Bad device mmc 0 **
Booting from net …
ethernet@30be0000 Waiting for PHY auto negotiation to complete… TIMEOUT!
Could not initialize PHY ethernet@30be0000
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
BOOTP broadcast 4
BOOTP broadcast 5
BOOTP broadcast 6
BOOTP broadcast 7
.
.
.
The Uboot doesn’t seem to recognize the MMC device #1: “Bad device MMC1”
My guess is that is the SDCard and there is not one inserted. That is the default if you follow the instructions you linked above. You may be able to change the settings in your local.conf for MENDER_STORAGE_DEVICE* to point at mmcblk0 instead but that’s just a guess. https://github.com/mendersoftware/meta-mender-community/blob/sumo/meta-mender-imx/templates/local.conf.append
I made everything , pointing to mmcblk0
But here’s the output of some mmc info:
u-boot=> mmc list
FSL_SDHC: 0
FSL_SDHC: 1 (eMMC)
u-boot=> mmc part
Partition Map for MMC device 1 – Partition Type: DOS
Part Start Sector Num Sectors UUID Type
1 49152 32768 9695e9d0-01 0c Boot
2 81920 425984 9695e9d0-02 83
3 507904 425984 9695e9d0-03 83
4 933888 262144 9695e9d0-04 83
u-boot=> mmc dev
switch to partitions #0, OK
mmc1(part 0) is current device
What should I do now please help,
I need to flash the eMMC
[EDIT1]
I have a guess here: mmc1(part 0) is current device
I think it’s coorectly pointing to mmc1 which is the eMMC but part0, it needs to point to part1 which is the boot
[EDIT2]
I tried to switch to part 1 with:
u-boot=> mmc dev 1 1
switch to partitions #1, OK
mmc1(part 1) is current device
I need to make it permanent, cuz when I try to boot after the edit, it return to part 0
[EDIT3]
I followed the serial output when flashing the eMMC , and this is what is shown at the end:
…
downloading of 1418832 bytes finished
writing to partition ‘bootloader’
support sparse flash partition for bootloader
Initializing ‘bootloader’
switch to partitions #1, OK
mmc1(part 1) is current device
Writing ‘bootloader’
MMC write: dev # 1, block # 66, count 2772 … 2772 blocks written: OK
Writing ‘bootloader’ DONE!
You see it : mmc1(part 1) is current device
But when I boot it still looking : mmc1(part 0)
Yes, so MMC device 1 is indeed the eMMC. I’ve never worked on this specific board so I can’t add much more. What is the mechanism you are using to write the UBoot?
I’m using iMX8 Mini board
And to flash the eMMC I’m usiing UUU(Universal Update Utility) from NXP official
And in order to flash the eMMC I need to give it two arguments : uboot + .sdimg
And to flash the SD card I only need the sdimg because it’s having the uboot inside.
So for the SDK it’s okay,
The eMMC is flashed but can’t boot, I need to tell the U-boot to boot from dev1 part 1
u-boot=> run mender_setup
u-boot=> print bootargs
bootargs=console=ttymxc1,115200 earlycon=ec_imx6q,0x30890000,115200 root=/dev/nfs ip=dhcp nfsroot=:,v3,tcp
u-boot=> print bootcmd
bootcmd=mmc dev ${mmcdev}; if mmc rescan; then if run loadbootscript; then run bootscript; else run mender_setup; if run loadimage; then run mmcboot; run mender_try_to_recover; else run mender_try_to_recover; run netboot; fi; fii
u-boot=>
My local.conf : Same as the demo one: (removing the comments)