PICO-PI-IMX7: Editing and Recovery/Linux 4.19.x

@RobertCNelson I have two questions:

  1. In 4: On Board in u-boot run a few default commands:
    dfu 0 mmc 0

Did you have the error I refer to on the attached screen?

  1. In 11: install core-image-base-imx7d-pico.sdimg to board
    Do you wait for the image (* .SDIMG) to be flashed before giving control-c to the u-boot console/cli
    or not?

I think you attached the wrong screenshot…

You need to wait till dd is fully done running…

Regards,

@RobertCNelson Is not wrong screenshot, But look this:

I’m referring to this error below, which I always have and you don’t seem to have had.

I prepare my board on mfgtool2 before starting the procedures.

dfu 0 mmc 0
Couldn’t find part #1 on mmc device #0
DFU entities configuration failed!
(partition table does not match dfu_alt_info?)
dfu - Device Firmware Upgrade

Usage:
dfu <USB_controller> [list]

  • device firmware upgrade via <USB_controller>
    on device , attached to interface

[list] - list available alt settings

It’s looking for a partition…

Just run:

ums 0 mmc 0

and

sudo dd if=core-image-base-imx7d-pico.sdimg of=/dev/sdb bs=1M ; sudo sync

Once to create the initial partition table…

Then start back at step 1…

Regards,

@RobertCNelson my board (thud Yocto 2.6) only accepts ipv6, not have Wifi, x11 (or other) not have apt-get (or opkg)

Post a bug report to the authors of that image, or add the pkg’s yourself.

Remember, that’s not my image, you should really contact the authors directly.

Regards,

@RobertCNelson ok b r o. I also saw something like this yesterday (about systemd.network)


tks

@RobertCNelson I promise that this will be my last question for you about Yocto. About x11, opkg and wi-fi I will manage alone:

At the end of the link below, in the doubts Issues with systemd-networkd - General Discussions - Mender Hub (Issues with systemd-networkd) neither of the two guys managed to make me ping 192.168.1.1 and/or ping 8.8.8.8. Any help from you, however small, is welcome.

Not have ipv4 (with dhcp configuration):

dmesg | grep eth0

[ 1.770490] fec 30be0000.ethernet eth0: registered PHC device 0
[ 12.348166] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 14.408696] fec 30be0000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[ 14.417292] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

https://drive.google.com/drive/folders/1sqXvfolncaNiPhVSylMUyAtL92NlXQGR?usp=sharing

Wow, what a buggy Yocto image. I’ve also confirmed here, ipv4 doesn’t seem to be enabled out of the box…

root@imx7d-pico:~# ifconfig -a eth0
eth0      Link encap:Ethernet  HWaddr 00:1F:7B:86:60:19
          inet6 addr: fe80::21f:7bff:fe86:6019/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:327 errors:0 dropped:126 overruns:0 frame:0
          TX packets:35 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:23449 (22.8 KiB)  TX bytes:7112 (6.9 KiB)

Feel free to drop Yocto and switch back to Debian/Ubuntu.

Regards,

@RobertCNelson When I tried to use your u-boot (2020 version) I got the errors below, despite having registered the ip correctly (printenv ipaddr result 192.168.1.128). If I solve this, I think I will have ipv4 on my imx7d-pico/Yocto

No, that’s looking for a mac address…

Try setting:

setenv ethaddr 00:01:02:03:04:05

Regards,

@RobertCNelson What about this ? I will need mii commands in u-boot ? pls Where I can find u-boot with mii commands do see PHY

You have a few issues there… For one, you are running a different version of SPL and u-boot, which isn’t good…

You can setup extlinux with:

https://www.digikey.com/eewiki/display/linuxonarm/PICO-PI-IMX7#PICO-PI-IMX7-Setupextlinux.conf

Regards,

@RobertCNelson 1) Why I need extlinux in my case? 2) Why this u-boot version don’t have mii command ?
3) What about TFTP from server 192.168.1.1 our IP address is 192.168.1.103?
4) What about missing environment variable: pxeuuid?

  1. What about missing environment variable: bootfile?

Because that’s what mainline u-boot needs for YOU to tell it what to do, via config_distro_bootcmd

#define BOOT_TARGET_DEVICES(func) \
	func(MMC, mmc, 0) \
	func(USB, usb, 0) \
	func(PXE, pxe, na) \
	func(DHCP, dhcp, na)

#include <config_distro_bootcmd.h>

Boot order is:

  1. MMC
  2. USB
  3. PXE ← this is where your log is stuck…
  4. DHCP

So, add an extlinux file so the MMC will actually load your kernel…

Just booted my board:

=> version
U-Boot 2020.07 (Aug 19 2020 - 15:48:41 -0500)

arm-linux-gnueabihf-gcc (Linaro GCC 6.5-2018.12) 6.5.0
GNU ld (Linaro_Binutils-2018.12) 2.27.0.20161229

=> mii
Unknown command 'mii' - try 'help'

Enable the config option in u-boot, it defaults to not enabled…

Do you have a TFTP server running on 192.168.1.1? This is PXE Boot, you aren’t using this…

Regards,

@RobertCNelson

`sudo mkdir -p /media/rootfs/boot/extlinux/`
`sudo sh -c ` `"echo 'label Linux ${kernel_version}' > /media/rootfs/boot/extlinux/extlinux.conf"`
`sudo sh -c ` `"echo '    kernel /boot/vmlinuz-${kernel_version}' >> /media/rootfs/boot/extlinux/extlinux.conf"`
`sudo sh -c ` `"echo '    append root=/dev/mmcblk2p1 ro rootfstype=ext4 rootwait quiet' >> /media/rootfs/boot/extlinux/extlinux.conf"`
`sudo sh -c ` `"echo '    fdtdir /boot/dtbs/${kernel_version}/' >> /media/rootfs/boot/extlinux/extlinux.conf"` 

I need help to put extlinux because my partition table is different AND I don’t know my kernel version:(Yesterday I do this command with old U-boot 2018:
root@imx7d-pico:~# uname -r

uname -r
4.20.0-rc6-fslc+gbf414f71d713

@RobertCNelson I need help in screen below. I stay enable mii (in correct point) but I can’t use mii command in uboot cli. How to salve .config? Whats name? I need delete u-boot paste everytime or just redo the 5 commands below:

  1. export CC=pwd/gcc-linaro-6.5.0-2018.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-

  2. ${CC}gcc --version

cd u-boot (existing folder)

  1. make ARCH=arm CROSS_COMPILE=${CC} distclean
  2. make ARCH=arm CROSS_COMPILE=${CC} pico-pi-imx7d_defconfig
  3. make ARCH=arm CROSS_COMPILE=${CC}

It’s stored as “.config”, name it what ever you want to name it…

make ARCH=arm CROSS_COMPILE=${CC} distclean
make ARCH=arm CROSS_COMPILE=${CC} pico-pi-mx7d_defconfig
make ARCH=arm CROSS_COMPILE=${CC} menuconfig
cp ./.config ../my-working-config
make ARCH=arm CROSS_COMPILE=${CC}

Regards,

This is going to be for you to figure out:

So let’s look at the basic extlinux.conf file:

label Linux 5.4.58-armv7-lpae-x33
    kernel /boot/vmlinuz-5.4.58-armv7-lpae-x33
    append root=/dev/mmcblk2p1 ro rootfstype=ext4 rootwait quiet
    fdtdir /boot/dtbs/5.4.58-armv7-lpae-x33/

First Line:

label Linux 5.4.58-armv7-lpae-x33

This is just a label and dumped on bootup, it’s value is not used for anything.

2nd line:

    kernel /boot/vmlinuz-5.4.58-armv7-lpae-x33

This is kernel “boot file”, it’s a link to a raw file, access by u-boot:

debian@arm:~$ ls -la /boot/
total 10372
drwxr-xr-x  5 root root     4096 Aug 19 21:08 .
drwxr-xr-x 21 root root     4096 May 10 20:17 ..
-rw-r--r--  1 root root   192123 Aug 19 21:08 config-5.4.58-armv7-lpae-x33
drwxr-xr-x  3 root root     4096 Aug 19 21:08 dtbs
drwxr-xr-x  2 root root     4096 Aug 19 21:08 extlinux
drwxr-xr-x  2 root root     4096 May 10 20:17 uboot
-rwxr-xr-x  1 root root 10404352 Aug 19 21:08 vmlinuz-5.4.58-armv7-lpae-x33 <- kernel file

3rd line:

    append root=/dev/mmcblk2p1 ro rootfstype=ext4 rootwait quiet

This is our bootarg’s appended to the default cmdline:

debian@arm:~$ cat /proc/cmdline 
root=/dev/mmcblk2p1 ro rootfstype=ext4 rootwait quiet
debian@arm:~$ lsblk
NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
mmcblk2      179:0    0  3.6G  0 disk 
└─mmcblk2p1  179:1    0  3.6G  0 part /  <- Root Driver
mmcblk2boot0 179:256  0    2M  1 disk 
mmcblk2boot1 179:512  0    2M  1 disk 

4th line:

    fdtdir /boot/dtbs/5.4.58-armv7-lpae-x33/

This is the directory containing all our device tree’s:

debian@arm:~$ ls -alh /boot/dtbs/5.4.58-armv7-lpae-x33/ | grep pico
-rw-r--r-- 1 debian debian  47K Aug 19 21:04 imx7d-pico-hobbit.dtb
-rw-r--r-- 1 debian debian  47K Aug 19 21:04 imx7d-pico-pi.dtb

So it’s going to be you to convert your Yocto sytem to use extlinux.conf for bootup.

But feel free to switch to Debian or Ubuntu at any time:

Regards,

@RobertCNelson Based on this link: https://patchwork.kernel.org/patch/10066323/ I can put wifi in my imx7d-pico board. But, every time I restart I have to give these three commands below:

1 ) wpa_passphrase test 12345678 > /etc/wpa_supplicant.conf 
2)  wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf -D nl80211 &
3)  udhcpc -i wlan0

I already put it in .bashrc and it didn’t work.

Would you know how to solve this?