PICO-PI-IMX7 U-Boot Partition

Hello, I am new to here, just found your post about PICO PI IMX7, but I got problem on it.

for Bootloader: U-Boot, it complains “no cc” when I run the compile for imx7d, so I understand that GCC is missing from system, however we already have a cross compiler installed in previous step, should we make more changes to Makefile (or ENV variables), or simply install the Ubuntu gcc? (I am on Ubuntu 20.04 LTS)

Before waiting for your answer, I tried to install Ubuntu gcc to move on and test, it does compile (though not sure if the outcome is good or not), moving on to “env default -f -a” I get the following:

=> env default -f -a                                                            
## Resetting to default environment                                             
## Error: Can't force access to "bootcmd"                                       
## Error: Can't force access to "bootdelay"                                     
## Error: Can't force access to "baudrate"                                      
## Error: Can't force access to "loadaddr"                                      
## Error: Can't force access to "arch"                                          
## Error: Can't force access to "cpu"                                           
## Error: Can't force access to "board"                                         
## Error: Can't force access to "board_name"                                    
## Error: Can't force access to "vendor"                                        
## Error: Can't force access to "soc"                                           
## Error: Can't force access to "image"                                         
## Error: Can't force access to "splashpos"                                     
## Error: Can't force access to "splashimage"                                   
## Error: Can't force access to "console"                                       
## Error: Can't force access to "fdt_high"                                      
## Error: Can't force access to "initrd_high"                                   
## Error: Can't force access to "fdtfile"                                       
## Error: Can't force access to "videomode"                                     
## Error: Can't force access to "fdt_addr"                                      
## Error: Can't force access to "fdt_addr_r"                                    
## Error: Can't force access to "kernel_addr_r"                                 
## Error: Can't force access to "pxefile_addr_r"                                
## Error: Can't force access to "ramdisk_addr_r"                                
## Error: Can't force access to "ramdiskaddr"                                   
## Error: Can't force access to "scriptaddr"                                    
## Error: Can't force access to "dfu_alt_info"                                  
## Error: Can't force access to "findfdt"                                       
## Error: Can't force access to "finduuid"                                      
## Error: Can't force access to "partitions"                                    
## Error: Can't force access to "fastboot_partition_alias_system"               
## Error: Can't force access to "setup_emmc"                                    
## Error: Can't force access to "bootmenu_0"                                    
## Error: Can't force access to "bootmenu_1"                                    
## Error: Can't force access to "bootmenu_2"                                    
## Error: Can't force access to "bootmenu_3"                                    
## Error: Can't force access to "mmc_boot"                                      
## Error: Can't force access to "boot_net_usb_start"                            
## Error: Can't force access to "usb_boot"                                      
## Error: Can't force access to "boot_efi_bootmgr"                              
## Error: Can't force access to "boot_efi_binary"                               
## Error: Can't force access to "load_efi_dtb"                                  
## Error: Can't force access to "efi_dtb_prefixes"                              
## Error: Can't force access to "scan_dev_for_efi"                              
## Error: Can't force access to "boot_prefixes"                                 
## Error: Can't force access to "boot_scripts"                                  
## Error: Can't force access to "boot_script_dhcp"                              
## Error: Can't force access to "boot_targets"                                  
## Error: Can't force access to "boot_syslinux_conf"                            
## Error: Can't force access to "boot_extlinux"                                 
## Error: Can't force access to "scan_dev_for_extlinux"                         
## Error: Can't force access to "boot_a_script"                                 
## Error: Can't force access to "scan_dev_for_scripts"                          
## Error: Can't force access to "scan_dev_for_boot"                             
## Error: Can't force access to "scan_dev_for_boot_part"                        
## Error: Can't force access to "bootcmd_mmc0"                                  
## Error: Can't force access to "bootcmd_usb0"                                  
## Error: Can't force access to "bootcmd_pxe"                                   
## Error: Can't force access to "bootcmd_dhcp"                                  
## Error: Can't force access to "distro_bootcmd"

And I also get the following error

=> 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> [<interface> <dev>] [list]                                 
  - device firmware upgrade via <USB_controller>                                
    on device <dev>, attached to interface                                      
    <interface>                                                                 
    [list] - list available alt settings                                        

Tried to follow some other post and found following command but also not helped:

=> ums 0 mmc 0                                                                  
** Invalid partition 1 **                                                      

So now I am unable to start the board with USB, what can be wrong here? Thanks
P.S. Sorry I have no idea why some fonts looking weird in my post.

Once you “export” a variable in a terminal, ‘only’ that active terminal will contain a variable, so if you start another terminal session, you’ll need to re-export…

Please verify that you were able to see the correct lsusb device, and were able to use imx_usb_loader to get to a u-boot prompt…

Once in a u-boot prompt, ignore all errors and complete:

#SERIAL_CONSOLE_U_BOOT
=> env default -f -a
=> setenv bootm_boot_mode nonsec
=> saveenv
=> mmc partconf 0 0 7 0

Then still issue:

=> ums 0 mmc 0

Then just format the drive like the guide shows…

Regards,

Yes I know the EXPORT command is only for that specific session, but the point is, “cc” in Makefile is small letter while the environment variable is capitcal “CC”, so I have to install the Ubuntu “gcc” package in order to compile. (There seems to have no error on compilation)

After loading the img file, here is what I get:

Downloading file of size 501090 to 0x877fffc0… done
Jumping to header at 0x877fffc0
Header Tag is not an IMX image
�ound header at 0x877fffc0

Is there any problem with “Header tag”?

U-Boot 2021.01 (May 26 2021 - 01:48:35 +0900)

CPU: Freescale i.MX7D rev1.2 1000 MHz (running at 792 MHz)
CPU: Commercial temperature grade (0C to 95C) at 43C
Reset cause: POR
Model: TechNexion PICO-IMX7D Board and PI baseboard
Board: i.MX7D PICOSOM
I2C: ready
DRAM: 512 MiB
PMIC: PFUZE3000 DEV_ID=0x30 REV_ID=0x11
MMC: FSL_SDHC: 2, FSL_SDHC: 1, FSL_SDHC: 0
Loading Environment from MMC… OK
In: serial
Out: serial
Err: serial
Net: eth0: ethernet@30be0000
Hit any key to stop autoboot: 0

Then I run following:

=> env default -f -a
=> setenv bootm_boot_mode nonsec
=> saveenv
=> mmc partconf 0 0 7 0

But the last one has problem:

=> ums 0 mmc 0                                                                  
** Invalid partition 1 **         
=> 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> [<interface> <dev>] [list]                                 
  - device firmware upgrade via <USB_controller>                                
    on device <dev>, attached to interface                                      
    <interface>                                                                 
    [list] - list available alt settings            

I tried many times but still getting same error. I owned 2 i.MX7d (one was given by a friend) and both exhibit exact same problem so I don’t believe it’s hardware issue.

From Ubuntu I can see following devices when I plug in the board:

Bus 001 Device 007: ID 0525:b4a4 Netchip Technology, Inc. USB download gadget
Bus 004 Device 003: ID 0403:6001 Future Technology Devices International, Ltd FT232 Serial (UART) IC

Using lsblk command doesn’t show any extra block storage device on my desktop.

Sorry, i mis-read your question. I get a lot of emails about failure to export the variable… I’ve add build-essential to the u-boot section as a recommend package for the native cc.

Okay, looks like we can drop the “-f” flag…

=> env default -a

This happens when the partition table on the eMMC is blank, or un-readable by u-boot… Usually the fix is:

=> ums 0 mmc 0

On my board:

=> 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> [<interface> <dev>] [list]
  - device firmware upgrade via <USB_controller>
    on device <dev>, attached to interface
    <interface>
    [list] - list available alt settings

=> ums 0 mmc 0
UMS: LUN 0, dev 0, hwpart 0, sector 0x0, count 0x720000

and my drive pop’s up:

[25638.609951] usb 7-3.7.6: New USB device found, idVendor=0525, idProduct=a4a5, bcdDevice= 2.21
[25638.609957] usb 7-3.7.6: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[25638.609959] usb 7-3.7.6: Product: USB download gadget
[25638.609961] usb 7-3.7.6: Manufacturer: FSL
[25638.611093] usb-storage 7-3.7.6:1.0: USB Mass Storage device detected
[25638.611222] usb-storage 7-3.7.6:1.0: Quirks match for vid 0525 pid a4a5: 10000
[25638.611252] scsi host3: usb-storage 7-3.7.6:1.0
[25639.612413] scsi 3:0:0:0: Direct-Access     Linux    UMS disk 0       ffff PQ: 0 ANSI: 2
[25639.612637] sd 3:0:0:0: Attached scsi generic sg4 type 0
[25639.612869] sd 3:0:0:0: [sde] 7471104 512-byte logical blocks: (3.83 GB/3.56 GiB)
[25639.612988] sd 3:0:0:0: [sde] Write Protect is off
[25639.612990] sd 3:0:0:0: [sde] Mode Sense: 0f 00 00 00
[25639.613122] sd 3:0:0:0: [sde] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[25639.660704] sd 3:0:0:0: [sde] Attached SCSI removable disk

In Linux i can then create a partition table on /dev/sde and dfu utils work…

So why does u-boot fail to load with: ums 0 mmc 0… I’m going to try v2021.04 and v2021.07-rc3 work correctly and update the guide, but i would try either of those…

In summation, while doing usb-boot, i’d fully expect this work:

=> env default -a
=> setenv bootm_boot_mode nonsec
=> saveenv
=> mmc partconf 0 0 7 0
=> ums 0 mmc 0

and your eMMC to show up on your PC as a usb flash drive…

Regards,

Thanks for your help, but I still getting Invalid partition error

=> �                                                                            
U-Boot SPL 2021.01 (May 26 2021 - 03:57:51 +0900)                               
Trying to boot from USB SDP                                                     
SDP: initialize...                                                              
SDP: handle requests...                                                         
Downloading file of size 501074 to 0x877fffc0... done                           
Jumping to header at 0x877fffc0                                                 
Header Tag is not an IMX image                                                  
�ound header at 0x877fffc0                                                      
                                                                                
U-Boot 2021.01 (May 26 2021 - 03:57:51 +0900)                                   
                                                                                
CPU:   Freescale i.MX7D rev1.2 1000 MHz (running at 792 MHz)                    
CPU:   Commercial temperature grade (0C to 95C) at 43C                          
Reset cause: POR                                                                
Model: TechNexion PICO-IMX7D Board and PI baseboard                             
Board: i.MX7D PICOSOM                                                           
I2C:   ready                                                                    
DRAM:  512 MiB                                                                  
PMIC:  PFUZE3000 DEV_ID=0x30 REV_ID=0x11                                        
MMC:   FSL_SDHC: 2, FSL_SDHC: 1, FSL_SDHC: 0                                    
Loading Environment from MMC... OK                                              
In:    serial                                                                   
Out:   serial                                                                   
Err:   serial                                                                   
Net:   eth0: ethernet@30be0000                                                  
Hit any key to stop autoboot:  0                                                
=> env default -a                                                               
## Resetting to default environment                                             
=> setenv bootm_boot_mode nonsec                                                
=> saveenv                                                                      
Saving Environment to MMC... Writing to MMC(0)... OK                            
=> mmc partconf 0 0 7 0                                                         
=> 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> [<interface> <dev>] [list]                                 
  - device firmware upgrade via <USB_controller>                                
    on device <dev>, attached to interface                                      
    <interface>                                                                 
    [list] - list available alt settings                                        
                                                                                
=> ums 0 mmc 0                                                                  
** Invalid partition 1 **                                                       
=> 

BTW I also have a question about the Download Mode jumper setting, since my board was came from Android Things Kit (which is also a Technexion board), and I found a doc here with different jumper settings?

Let’s try a few more things:

=> mmc info
Device: FSL_SDHC
Manufacturer ID: 70
OEM: 100
Name: M6270 
Bus Speed: 52000000
Mode: MMC High Speed (52MHz)
Rd Block Len: 512
MMC version 5.1
High Capacity: Yes
Capacity: 3.6 GiB
Bus Width: 8-bit
Erase Group Size: 512 KiB
HC WP Group Size: 4 MiB
User Capacity: 3.6 GiB
Boot Capacity: 2 MiB ENH
RPMB Capacity: 512 KiB ENH
Boot area 0 is not write protected
Boot area 1 is not write protected
=> mmc part

Partition Map for MMC device 0  --   Partition Type: DOS

Part	Start Sector	Num Sectors	UUID		Type
  1	2048      	7469056   	39e21ae0-01	83 Boot

I wonder if we can create the partition in u-boot…

Correct, my board is also a former Android Things Kit, i belive at the time, i could only get the original Technexion imx.6 pico docs, which had the different jumper settings. They still enable usb boot and eMMC boot modes properly.

Regards,

Here is the output

=> mmc part                                                                     
                                                                                
Partition Map for MMC device 0  --   Partition Type: DOS                        
                                                                                
Part    Start Sector    Num Sectors     UUID            Type                    
=> mmc info                                                                     
Device: FSL_SDHC                                                                
Manufacturer ID: 70                                                             
OEM: 100                                                                        
Name: M6270                                                                     
Bus Speed: 52000000                                                             
Mode: MMC High Speed (52MHz)                                                    
Rd Block Len: 512                                                               
MMC version 5.1                                                                 
High Capacity: Yes                                                              
Capacity: 3.6 GiB                                                               
Bus Width: 8-bit                                                                
Erase Group Size: 512 KiB                                                       
HC WP Group Size: 4 MiB                                                         
User Capacity: 3.6 GiB                                                          
Boot Capacity: 2 MiB ENH                                                        
RPMB Capacity: 512 KiB ENH                                                      
Boot area 0 is not write protected                                              
Boot area 1 is not write protected                                              
=> mmc part                                                                     
                                                                                
Partition Map for MMC device 0  --   Partition Type: DOS                        
                                                                                
Part    Start Sector    Num Sectors     UUID            Type                    
=> 

So the MMC does exist but blank. I was also trying to find a way to create partition but seems no way to do it from u-boot. (I looked at mmc hwpartition command but not sure if this is can work)
While I was searching around and try to think about using fastboot, I issued fastboot usb 0 in u-boot and then from my Ubuntu something looks close:

~/imx_usb_loader/u-boot$ lsusb | grep Netchip
Bus 001 Device 022: ID 0525:a4a5 Netchip Technology, Inc. Pocketbook Pro 903 / Mobius 2 Action Cam

and dmesg gave me this (the USB VID:PID now is the same as yours):

[194762.092303] usb 1-1: USB disconnect, device number 21
[194762.399918] usb 1-1: new high-speed USB device number 22 using ehci-pci
[194762.556777] usb 1-1: New USB device found, idVendor=0525, idProduct=a4a5, bcdDevice= 2.21
[194762.556781] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[194762.556783] usb 1-1: Product: USB download gadget
[194762.556785] usb 1-1: Manufacturer: FSL
[194762.557342] usb-storage 1-1:1.0: USB Mass Storage device detected
[194762.557478] usb-storage 1-1:1.0: Quirks match for vid 0525 pid a4a5: 10000

However, the usb-storage doesn’t show as a block device on my system, so I still cannot proceed.