Gravando imagem customizada Linux na Toradex Colibri i.MX7

Linux na Toradex Colibri i.MX7
Este post faz parte da série Toradex Colibri i.MX7. Leia também os outros posts da série:

Introdução

 

No artigo Criando uma Distribuição Linux com Yocto Project para Toradex Colibri i.MX7 preparamos o ambiente Host e, utilizando Yocto Project, geramos uma Distribuição Linux customizada. Desta vez iremos abordar uma das formas de gravar a image gerada no SoM Toradex Colibri i.MX7.

 

 

Ferramentas

 

No site da Toradex são fornecidas algumas ferramentas para realizar esta gravação do SO:

 

Utilizaremos o procedimento descrito em Flashing Embedded Linux to iMX7 Modules, onde é utilizado um microSD ou pendrive formatado no sistema de arquivos FAT32 e, utilizando um script fornecido pela Toradex, update.sh, irá preparar e exibir os detalhes para a migração.

 

Oficialmente pode-se fazer download de uma das imagens disponibilizadas no site, descompactar e executar o script "update.sh" em uma das imagens a seguir:

 

 

Customizando a estrutura

 

Será utilizado o "update.sh" com algumas alterações, o restante da estrutura Bootloader, Kernel, Device-Tree e RootFS iremos trocar pelo gerado no artigo de customização da distribuição.

 

Através deste link pode-se fazer download da estrutura alterada e pronta para realizar a gravação, abaixo é o detalhe de como foi criada e alterada.

 

Acessando o diretório build-trdx-imx7/tmp-glibc/deploy/images/colibri-imx7 serão copiados os seguintes arquivos:

 

Angstrom-console-image-glibc-ipk-v2018.06-colibri-imx7.rootfs.ubifs
u-boot-colibri-imx7-2016.11+gitAUTOINC+1b121c6ab5-r0.imx
zImage--4.1-2.0.x+git0+b1555bfbf3-r0-colibri-imx7-20180702170508.bin
zImage--4.1-2.0.x+git0+b1555bfbf3-r0-imx7d-colibri-aster-20180702170508.dtb
zImage--4.1-2.0.x+git0+b1555bfbf3-r0-imx7d-colibri-eval-v3-20180702170508.dtb
zImage--4.1-2.0.x+git0+b1555bfbf3-r0-imx7s-colibri-aster-20180702170508.dtb
zImage--4.1-2.0.x+git0+b1555bfbf3-r0-imx7s-colibri-eval-v3-20180702170508.dtb

 

Será criado o diretório Colibri-iMX7_Angstrom_Console-Image e os respectivos diretórios colibri-imx7_bin e imx_flash.

 

$ mkdir -p ~/Colibri-iMX7_Angstrom_Console-Image/colibri-imx7_bin
$ mkdir -p ~/Colibri-iMX7_Angstrom_Console-Image/imx_flash

 

Serão copiados para o diretório colibri-imx7_bin como utilizado pela Toradex e criados os devidos links simbólicos, utilizando informações da imagem Colibri iMX7 LXDE Image 2.8b3 27/06/2018 será copiado o conteúdo do imx_flash para ~/Colibri-iMX7_Angstrom_Console-Image/imx_flash e os arquivos flash_blk.img, flash_blk.scr, flash_eth.img, flash_eth.scr, fwd_blk.img, fwd_blk.scr, fwd_eth.img e fwd_eth.scr de colibri-imx7_bin para ~/Colibri-iMX7_Angstrom_Console-Image/colibri-imx7_bin, ficando com a nossa estrutura como a seguir:

 

Colibri-iMX7_Angstrom_Console-Image $ tree
.
├── colibri-imx7_bin
│   ├── flash_blk.img
│   ├── flash_blk.scr
│   ├── flash_eth.img
│   ├── flash_eth.scr
│   ├── fwd_blk.img
│   ├── fwd_blk.scr
│   ├── fwd_eth.img
│   ├── fwd_eth.scr
│   ├── imx7d-colibri-aster.dtb -> zImage--4.1-2.0.x+git0+b1555bfbf3-r0-imx7d-colibri-aster-20180702170508.dtb
│   ├── imx7d-colibri-eval-v3.dtb -> zImage--4.1-2.0.x+git0+b1555bfbf3-r0-imx7d-colibri-eval-v3-20180702170508.dtb
│   ├── imx7s-colibri-aster.dtb -> zImage--4.1-2.0.x+git0+b1555bfbf3-r0-imx7s-colibri-aster-20180702170508.dtb
│   ├── imx7s-colibri-eval-v3.dtb -> zImage--4.1-2.0.x+git0+b1555bfbf3-r0-imx7s-colibri-eval-v3-20180702170508.dtb
│   ├── mk-u-boot-scripts.sh
│   ├── ubifs.img
│   ├── u-boot-colibri-imx7-2016.11+gitAUTOINC+1b121c6ab5-r0.imx
│   ├── u-boot.imx -> u-boot-colibri-imx7-2016.11+gitAUTOINC+1b121c6ab5-r0.imx
│   ├── u-boot-nand.imx -> u-boot-colibri-imx7-2016.11+gitAUTOINC+1b121c6ab5-r0.imx
│   ├── zImage -> zImage--4.1-2.0.x+git0+b1555bfbf3-r0-colibri-imx7-20180702170508.bin
│   ├── zImage--4.1-2.0.x+git0+b1555bfbf3-r0-colibri-imx7-20180702170508.bin
│   ├── zImage--4.1-2.0.x+git0+b1555bfbf3-r0-imx7d-colibri-aster-20180702170508.dtb
│   ├── zImage--4.1-2.0.x+git0+b1555bfbf3-r0-imx7d-colibri-eval-v3-20180702170508.dtb
│   ├── zImage--4.1-2.0.x+git0+b1555bfbf3-r0-imx7s-colibri-aster-20180702170508.dtb
│   ├── zImage--4.1-2.0.x+git0+b1555bfbf3-r0-imx7s-colibri-eval-v3-20180702170508.dtb
│   ├── zImage-imx7d-colibri-aster.dtb -> zImage--4.1-2.0.x+git0+b1555bfbf3-r0-imx7d-colibri-aster-20180702170508.dtb
│   ├── zImage-imx7d-colibri-eval-v3.dtb -> zImage--4.1-2.0.x+git0+b1555bfbf3-r0-imx7d-colibri-eval-v3-20180702170508.dtb
│   ├── zImage-imx7s-colibri-aster.dtb -> zImage--4.1-2.0.x+git0+b1555bfbf3-r0-imx7s-colibri-aster-20180702170508.dtb
│   └── zImage-imx7s-colibri-eval-v3.dtb -> zImage--4.1-2.0.x+git0+b1555bfbf3-r0-imx7s-colibri-eval-v3-20180702170508.dtb
├── imx_flash
│   ├── imx_usb
│   ├── imx_usb.conf
│   ├── mkfs.ubifs
│   ├── mx7_usb_rom.conf
│   ├── mx7_usb_sdp_uboot.conf
│   └── mx7_usb_work.conf
└── update.sh

 

Ao gerar a Distribuição Linux configuramos o IMAGE_FSTYPE para agregar o ubifs, e foi gerado o Angstrom-console-image-glibc-ipk-v2018.06-colibri-imx7.rootfs.ubifs, que renomeamos para ubifs.img conforme está no diretório Colibri-iMX7_Angstrom_Console-Image/colibri-imx7_bin/. Desta forma não será necessário o "update.sh" gerar o ubifs baseado no conteúdo do diretório rootfs que foi omitido. Foi esta alteração realizada no "update.sh", removemos a geração do ubifs.img.

 

O script "update.sh" apenas ignora a geração do ubifs.img e utiliza um pronto, e pode ser baixado aqui.

 

 

Gravando a image

 

Nesta etapa será preparado um cartão microSD que será formato em FAT32 e criada a estrutura para a correta atualização.

 

Ao conectar o microSD pode-se utilizar o comando "lsblk" para identificar o nome do dispositivo de block:

 

$ lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda           8:0    0 931,5G  0 disk
├─sda1        8:1    0  46,6G  0 part /
├─sda2        8:2    0 232,9G  0 part /home
├─sda3        8:3    0 186,3G  0 part /opt
└─sda4        8:4    0 465,9G  0 part /data
sr0          11:0    1  1024M  0 rom  
mmcblk0     179:0    0   7,4G  0 disk
└─mmcblk0p1 179:1    0   7,4G  0 part /media/cbueno/7F25-4C88

 

Pronto! Podemos identificar o dispositivo /dev/mmcblk0 como sendo nosso microSD, e a próxima etapa desmontar e formatar a unidade:

 

$ sudo umount /dev/mmcblk0p1
$ sudo mkfs.fat -F32 -v -I -n "TDX_UPGRADE" /dev/mmcblk0p1 
mkfs.fat 3.0.28 (2015-05-16)
/dev/mmcblk0p1 has 4 heads and 16 sectors per track,
hidden sectors 0x0800;
logical sector size is 512,
using 0xf8 media descriptor, with 15521792 sectors;
drive number 0x80;
filesystem has 2 32-bit FATs and 8 sectors per cluster.
FAT size is 15129 sectors, and provides 1936437 clusters.
There are 32 reserved sectors.
Volume ID is 9699a2b6, volume label TDX_UPGRADE.
$

 

Removendo o microSD e conectando novamente temos a nova unidade:

 

$ lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda           8:0    0 931,5G  0 disk
├─sda1        8:1    0  46,6G  0 part /
├─sda2        8:2    0 232,9G  0 part /home
├─sda3        8:3    0 186,3G  0 part /opt
└─sda4        8:4    0 465,9G  0 part /data
sr0          11:0    1  1024M  0 rom  
mmcblk0     179:0    0   7,4G  0 disk
└─mmcblk0p1 179:1    0   7,4G  0 part /media/cbueno/TDX_UPGRADE

 

Com a estrutura alterada e preparada, ou após download da imagem e descompactar, acesse o diretório e execute o script "update.sh" conforme o caminho de montagem do dispositivo microSD, neste caso /media/cbueno/TDX_UPGRADE.

 

~/Downloads/Toradex/Colibri-iMX7_Angstrom_Console-Image $ ./update.sh -o /media/cbueno/TDX_UPGRADE/
[sudo] senha para cbueno:
Successfully copied data to target folder.

To flash the Colibri iMX7 module a running U-Boot is required. Boot the
module to the U-Boot prompt and

insert the SD card, USB flash drive or when using TFTP connect Ethernet only
and enter:
'run setupdate'

then to update all components enter:
'run update'

Alternatively, to update U-Boot enter:
'run update_uboot'
to update a component stored in UBI enter:
'run prepare_ubi'
followed by one of:
'run update_kernel'
'run update_fdt'
'run update_rootfs'


If you don't have a working U-Boot anymore, connect your PC to the module's
USB client port, bring the module into the serial download mode and start the update.sh
script with the -d option. This will copy U-Boot into the module's RAM and
execute it.

Then use the following command to get U-Boot running:
'./update.sh -d'

Next, recreate the Boot Configuration Block and the Toradex Config Block:
'run setupdate'
'run update_uboot'
'run create_bcb'
'cfgblock create'

 

Uma mensagem com "Successfully copied data to target folder" será exibida no terminal e na sequência as possibilidades e opções de atualização. Neste caso queremos atualizar todos componentes, então será conectado um cabo serial para acesso ao console do Bootloader U-boot e executar os comandos `run setupdate` e `run update`.

 

Conecte o microSD na Toradex BaseBoard suportada, energize a placa, interrompa o bootloader e execute os comandos `run setupdate` e na sequencia `run update`.

 

U-Boot 2016.11-2.8.1+g30a1208 (Dec 29 2017 - 01:45:55 +0000)

CPU:   Freescale i.MX7D rev1.2 996 MHz (running at 792 MHz)
CPU:   Extended Commercial temperature grade (-20C to 105C) at 38C
Reset cause: POR
DRAM:  512 MiB
PMIC:  RN5T567 LSIVER=0x01 OTPVER=0x0d
NAND:  512 MiB
MMC:   FSL_SDHC: 0
*** Warning - bad CRC, using default environment

Video: 640x480x18
In:    serial
Out:   serial
Err:   serial
Model: Toradex Colibri iMX7 Dual 512MB V1.1C, Serial# 02910742
Net:   FEC0
Hit any key to stop autoboot:  0
Colibri iMX7 #
Colibri iMX7 #
Colibri iMX7 #
Colibri iMX7 #
Colibri iMX7 #
Colibri iMX7 #
Colibri iMX7 # run setupdate
reading colibri_imx7/flash_blk.img
2707 bytes read in 21 ms (125 KiB/s)
## Executing script at 80800000
enter "run update" to update the entire module
Colibri iMX7 # run update
...
ubi0: fastmap WL pool size: 100
ubi0: attached mtd1 (name "mtd=4", size 508 MiB)
ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
ubi0: good PEBs: 4060, bad PEBs: 4, corrupted PEBs: 0
ubi0: user volume: 4, internal volumes: 1, max. volumes count: 128
ubi0: max/mean erase counter: 2/1, WL threshold: 4096, image sequence number: 0
ubi0: available PEBs: 0, total reserved PEBs: 4060, PEBs reserved for bad PEB handling: 76
reading colibri_imx7/zImage
5933384 bytes read in 275 ms (20.6 MiB/s)
5933384 bytes written to volume kernel
reading colibri_imx7/imx7d-colibri-eval-v3.dtb
45016 bytes read in 25 ms (1.7 MiB/s)
45016 bytes written to volume dtb
reading colibri_imx7/ubifs.img
105771008 bytes read in 4618 ms (21.8 MiB/s)
105771008 bytes written to volume rootfs
resetting ...

 

Foram omitidas algumas mensagens, mas após o "resetting…" é para ter ocorrido com sucesso o upgrade, e um boot completo será realizado.

 

U-Boot 2016.11-2.7.4+g1b121c6 (Jul 03 2018 - 17:17:47 +0000)

CPU:   Freescale i.MX7D rev1.2 996 MHz (running at 792 MHz)
CPU:   Extended Commercial temperature grade (-20C to 105C) at 30C
Reset cause: POR
DRAM:  512 MiB
PMIC:  RN5T567 LSIVER=0x01 OTPVER=0x0d
NAND:  512 MiB
MMC:   FSL_SDHC: 0
*** Warning - bad CRC, using default environment

Video: 640x480x18
In:    serial
Out:   serial
Err:   serial
Model: Toradex Colibri iMX7 Dual 512MB V1.1C, Serial# 02910742
Net:   FEC0
Hit any key to stop autoboot:  0
Booting from NAND...
ubi0: default fastmap pool size: 200
ubi0: default fastmap WL pool size: 100
ubi0: attaching mtd1
ubi0: attached by fastmap
ubi0: fastmap pool size: 200
ubi0: fastmap WL pool size: 100
ubi0: attached mtd1 (name "mtd=4", size 508 MiB)
ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
ubi0: good PEBs: 4060, bad PEBs: 4, corrupted PEBs: 0
ubi0: user volume: 4, internal volumes: 1, max. volumes count: 128
ubi0: max/mean erase counter: 3/1, WL threshold: 4096, image sequence number: 0
ubi0: available PEBs: 0, total reserved PEBs: 4060, PEBs reserved for bad PEB handling: 76
Read 0 bytes from volume kernel to 81000000
No size specified -> Using max size (5933384)
Read 0 bytes from volume dtb to 82000000
No size specified -> Using max size (45016)
Kernel image @ 0x81000000 [ 0x000000 - 0x5a8948 ]
## Flattened Device Tree blob at 82000000
   Booting using the fdt blob at 0x82000000
   Using Device Tree in place at 82000000, end 8200dfd7
   Updating MTD partitions...

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Initializing cgroup subsys cpuacct
[    0.000000] Linux version 4.1.44-2.7.4+gb1555bf ([email protected]) (gcc version 7.3.0 (GCC) ) #1 SMP Mon Jul 2 16:52:19 UTC 2018
[    0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] Machine model: Toradex Colibri iMX7D on Colibri Evaluation Board V3
[    0.000000] Reserved memory: created CMA memory pool at 0x98000000, size 128 MiB
[    0.000000] Reserved memory: initialized node linux,cma, compatible id shared-dma-pool
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] PERCPU: Embedded 12 pages/cpu @97b7f000 s16908 r8192 d24052 u49152
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 130048
[    0.000000] Kernel command line: ubi.mtd=ubi root=ubi0:rootfs rw rootfstype=ubifs ubi.fm_autoconvert=1 console=tty1 console=ttymxc0,115200n8 consoleblank=0 video=mxsfb:[email protected]
[    0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Memory: 377012K/524288K available (7402K kernel code, 337K rwdata, 2576K rodata, 388K init, 425K bss, 16204K reserved, 131072K cma-reserved, 0K highmem)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0xa0800000 - 0xff000000   (1512 MB)
[    0.000000]     lowmem  : 0x80000000 - 0xa0000000   ( 512 MB)
[    0.000000]     pkmap   : 0x7fe00000 - 0x80000000   (   2 MB)
[    0.000000]     modules : 0x7f000000 - 0x7fe00000   (  14 MB)
[    0.000000]       .text : 0x80008000 - 0x809c6ae0   (9979 kB)
[    0.000000]       .init : 0x809c7000 - 0x80a28000   ( 388 kB)
[    0.000000]       .data : 0x80a28000 - 0x80a7c4c0   ( 338 kB)
[    0.000000]        .bss : 0x80a7f000 - 0x80ae94ac   ( 426 kB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[    0.000000] Hierarchical RCU implementation.
[    0.000000]     Additional per-CPU info printed with stalls.
[    0.000000]     RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] Architected cp15 timer(s) running at 8.00MHz (phys).
[    0.000000] clocksource arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x1d854df40, max_idle_ns: 440795202120 ns
[    0.000006] sched_clock: 56 bits at 8MHz, resolution 125ns, wraps every 2199023255500ns
[    0.000018] Switching to timer-based delay loop, resolution 125ns
[    0.000541] mxc_clocksource_init 3000000
[    0.000552] Ignoring duplicate/late registration of read_current_timer delay
[    0.000568] clocksource mxc_timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 637086815595 ns
[    0.001988] Console: colour dummy device 80x30
[    0.002752] console [tty1] enabled
[    0.002782] Calibrating delay loop (skipped), value calculated using timer frequency.. 16.00 BogoMIPS (lpj=80000)
[    0.002831] pid_max: default: 32768 minimum: 301
[    0.002957] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.002989] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.003629] Initializing cgroup subsys freezer
[    0.003669] Initializing cgroup subsys debug
[    0.003725] CPU: Testing write buffer coherency: ok
[    0.003995] /cpus/[email protected] missing clock-frequency property
[    0.004032] /cpus/[email protected] missing clock-frequency property
[    0.004062] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.004136] Setting up static identity map for 0x80008280 - 0x800082d8
[    0.005994] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.006073] Brought up 2 CPUs
[    0.006129] SMP: Total of 2 processors activated (32.00 BogoMIPS).
[    0.006154] CPU: All CPU(s) started in SVC mode.
[    0.006723] devtmpfs: initialized
[    0.020292] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[    0.020696] clocksource jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.020761] futex hash table entries: 512 (order: 3, 32768 bytes)
[    0.025871] pinctrl core: initialized pinctrl subsystem
[    0.027124] NET: Registered protocol family 16
[    0.033838] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.059965] cpuidle: using governor ladder
[    0.089980] cpuidle: using governor menu
[    0.103689] DDR type is DDR3!
[    0.110747] imx7d_enet_clk_sel: failed to get enet_out clock, assuming ext. clock source
[    0.110843] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.110885] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.111793] imx7d-pinctrl 30270000.lpsr-gpr: initialized IMX pinctrl driver
[    0.112008] imx7d-pinctrl 302c0000.iomuxc-lpsr: initialized IMX pinctrl driver
[    0.113437] imx7d-pinctrl 30330000.iomuxc: initialized IMX pinctrl driver
[    0.115321] MU is ready for cross core communication!
[    0.129644] mxs-dma 33000000.dma-apbh: initialized
[    0.131556] VCC_USB[1-4]: supplied by 5V
[    0.132092] vgaarb: loaded
[    0.132740] SCSI subsystem initialized
[    0.133299] usbcore: registered new interface driver usbfs
[    0.133395] usbcore: registered new interface driver hub
[    0.133500] usbcore: registered new device driver usb
[    0.133765] 30800000.aips-bus:usbphy_nop1 supply vcc not found, using dummy regulator
[    0.134067] 30800000.aips-bus:usbphy_nop2 supply vcc not found, using dummy regulator
[    0.135279] i2c i2c-0: IMX I2C adapter registered
[    0.135314] i2c i2c-0: can't use DMA
[    0.135827] i2c i2c-3: IMX I2C adapter registered
[    0.135860] i2c i2c-3: can't use DMA
[    0.135993] Linux video capture interface: v2.00
[    0.136068] pps_core: LinuxPPS API ver. 1 registered
[    0.136096] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <[email protected]>
[    0.136163] PTP clock support registered
[    0.136961] MIPI CSI2 driver module loaded
[    0.137265] Advanced Linux Sound Architecture Driver Initialized.
[    0.138627] Switched to clocksource arch_sys_counter
[    0.149818] NET: Registered protocol family 2
[    0.150673] TCP established hash table entries: 4096 (order: 2, 16384 bytes)
[    0.150757] TCP bind hash table entries: 4096 (order: 3, 32768 bytes)
[    0.150853] TCP: Hash tables configured (established 4096 bind 4096)
[    0.150927] UDP hash table entries: 256 (order: 1, 8192 bytes)
[    0.150978] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[    0.151175] NET: Registered protocol family 1
[    0.151492] RPC: Registered named UNIX socket transport module.
[    0.151523] RPC: Registered udp transport module.
[    0.151548] RPC: Registered tcp transport module.
[    0.151572] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.152895] imx rpmsg driver is registered.
[    0.153875] Bus freq driver module loaded
[    0.161938] VFS: Disk quotas dquot_6.6.0
[    0.162174] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.163911] NFS: Registering the id_resolver key type
[    0.163996] Key type id_resolver registered
[    0.164023] Key type id_legacy registered
[    0.164064] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    0.164610] ntfs: driver 2.1.32 [Flags: R/W].
[    0.165114] fuse init (API version 7.23)
[    0.168822] io scheduler noop registered
[    0.168864] io scheduler deadline registered
[    0.169074] io scheduler cfq registered (default)
[    0.171565] backlight supply power not found, using dummy regulator
[    0.173134] MIPI DSI driver module loaded
[    0.175256] 30730000.lcdif supply lcd not found, using dummy regulator
[    0.175472] fbcvt: [email protected]: CVT Name - .307M3
[    0.241857] mxsfb 30730000.lcdif: failed to find mxc display driver
[    0.250670] Console: switching to colour frame buffer device 80x30
[    0.268795] mxsfb 30730000.lcdif: initialized
[    0.271629] imx-sdma 30bd0000.sdma: no event needs to be remapped
[    0.273465] imx-sdma 30bd0000.sdma: loaded firmware 4.2
[    0.278455] imx-sdma 30bd0000.sdma: initialized
[    0.281409] 30860000.serial: ttymxc0 at MMIO 0x30860000 (irq = 280, base_baud = 1500000) is a IMX
[    1.044668] console [ttymxc0] enabled
[    1.050823] 30890000.serial: ttymxc1 at MMIO 0x30890000 (irq = 281, base_baud = 1500000) is a IMX
[    1.063923] 30880000.serial: ttymxc2 at MMIO 0x30880000 (irq = 282, base_baud = 5000000) is a IMX
[    1.078067] [drm] Initialized drm 1.1.0 20060810
[    1.085110] [drm] Initialized vivante 1.0.0 20120216 on minor 0
[    1.102805] brd: module loaded
[    1.113271] loop: module loaded
[    1.139106] nand: device found, Manufacturer ID: 0xc2, Chip ID: 0xdc
[    1.147430] nand: Macronix MX30LF4G28AB
[    1.153227] nand: 512 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 112
[    1.165260] gpmi-nand 33002000.gpmi-nand: enable the asynchronous EDO mode 5
[    1.174575] Bad block table found at page 262080, version 0x01
[    1.182682] Bad block table found at page 262016, version 0x01
[    1.190882] 5 ofpart partitions found on MTD device gpmi-nand
[    1.198636] Creating 5 MTD partitions on "gpmi-nand":
[    1.205654] 0x000000000000-0x000000080000 : "mx7-bcb"
[    1.213743] 0x000000080000-0x000000200000 : "u-boot1"
[    1.221717] 0x000000200000-0x000000380000 : "u-boot2"
[    1.229634] 0x000000380000-0x000000400000 : "u-boot-env"
[    1.237782] 0x000000400000-0x000020000000 : "ubi"
[    1.246167] gpmi-nand 33002000.gpmi-nand: driver registered.
[    1.255647] spi_imx 30840000.ecspi: probed
[    1.264220] pps pps0: new PPS source ptp0
[    1.272155] libphy: fec_enet_mii_bus: probed
[    1.279769] fec 30be0000.ethernet eth0: registered PHC device 0
[    1.287514] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.295738] ehci-pci: EHCI PCI platform driver
[    1.301919] ehci-mxc: Freescale On-Chip EHCI Host driver
[    1.309131] usbcore: registered new interface driver usb-storage
[    1.316950] usbcore: registered new interface driver usbserial
[    1.324505] usbcore: registered new interface driver usbserial_generic
[    1.332699] usbserial: USB Serial support registered for generic
[    1.340390] usbcore: registered new interface driver ftdi_sio
[    1.347765] usbserial: USB Serial support registered for FTDI USB Serial Device
[    1.358205] usbcore: registered new interface driver pl2303
[    1.365390] usbserial: USB Serial support registered for pl2303
[    1.374231] 30b10200.usbmisc supply vbus-wakeup not found, using dummy regulator
[    1.385039] 30b30200.usbmisc supply vbus-wakeup not found, using dummy regulator
[    1.396041] 30b20200.usbmisc supply vbus-wakeup not found, using dummy regulator
[    1.407949] imx_usb 30b10000.usb: Can't register ci_hdrc platform device, err=-517
[    1.422640] ci_hdrc ci_hdrc.0: EHCI Host Controller
[    1.429620] ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
[    1.458675] ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
[    1.467142] hub 1-0:1.0: USB hub found
[    1.473077] hub 1-0:1.0: 1 port detected
[    1.480000] mousedev: PS/2 mouse device common for all mice
[    1.490408] input: AD7879 Touchscreen as /devices/platform/soc/30800000.aips-bus/30a20000.i2c/i2c-0/0-002c/input/input0
[    1.508663] rtc-ds1307 3-0068: oscillator failed, set time!
[    1.516598] rtc-ds1307 3-0068: rtc core: registered m41t0 as rtc0
[    1.525512] snvs_rtc 30370000.snvs:snvs-rtc-lp: rtc core: registered 30370000.snvs:snvs- as rtc1
[    1.538815] i2c /dev entries driver
[    1.546131] pxp-v4l2 pxp_v4l2_out: initialized
[    1.554758] imx2-wdt 30280000.wdog: timeout 60 sec (nowayout=0)
[    1.563270] sdhci: Secure Digital Host Controller Interface driver
[    1.571621] sdhci: Copyright(c) Pierre Ossman
[    1.578080] sdhci-pltfm: SDHCI platform and OF driver helper
[    1.586725] /soc/[email protected]/[email protected]: voltage-ranges unspecified
[    1.596019] sdhci-esdhc-imx 30b40000.usdhc: Got CD GPIO
[    1.605115] sdhci-esdhc-imx 30b40000.usdhc: No vqmmc regulator found
[    1.658801] mmc0: SDHCI controller on 30b40000.usdhc [30b40000.usdhc] using ADMA
[    1.696991] caam 30900000.caam: Entropy delay = 3200
[    1.706014] caam 30900000.caam: Instantiated RNG4 SH0
[    1.765428] caam 30900000.caam: Instantiated RNG4 SH1
[    1.772369] caam 30900000.caam: device ID = 0x0a16030000000000 (Era -524)
[    1.783066] caam 30900000.caam: job rings = 3, qi = 0
[    1.907601] caam algorithms registered in /proc/crypto
[    1.921998] caam_jr 30901000.jr0: registering rng-caam
[    1.930190] snvs-secvio 30370000.caam-snvs: can't get snvs clock
[    1.938138] snvs-secvio 30370000.caam-snvs: violation handlers armed - non-secure state
[    1.952479] hidraw: raw HID events driver (C) Jiri Kosina
[    1.960028] usbcore: registered new interface driver usbhid
[    1.967431] usbhid: USB HID core driver
[    1.982538] coresight-tmc 30086000.etr: TMC initialized
[    1.989985] coresight-tmc 30084000.etf: TMC initialized
[    1.997203] coresight-tpiu 30087000.tpiu: TPIU initialized
[    2.004802] coresight-funnel 30083000.funnel: FUNNEL initialized
[    2.012817] coresight-funnel 30041000.funnel: FUNNEL initialized
[    2.020862] coresight-replicator replicator: REPLICATOR initialized
[    2.029446] coresight-etm3x 3007c000.etm: ETM initialized
[    2.036892] coresight-etm3x 3007d000.etm: ETM initialized
[    2.049057] sgtl5000 0-000a: sgtl5000 revision 0x11
[    2.092716] imx-sgtl5000 sound: sgtl5000 <-> 308a0000.sai mapping ok
[    2.102490] Netfilter messages via NETLINK v0.30.
[    2.108828] nfnl_acct: registering with nfnetlink.
[    2.115169] nf_conntrack version 0.5.0 (7938 buckets, 31752 max)
[    2.123299] nf_tables: (c) 2007-2009 Patrick McHardy <[email protected]>
[    2.131966] ip_tables: (C) 2000-2006 Netfilter Core Team
[    2.139723] NET: Registered protocol family 10
[    2.147011] ip6_tables: (C) 2000-2006 Netfilter Core Team
[    2.154160] NET: Registered protocol family 17
[    2.160339] bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to load br_netfilter if you need this.
[    2.176440] Bridge firewalling registered
[    2.182247] 8021q: 802.1Q VLAN Support v1.8
[    2.188442] Key type dns_resolver registered
[    2.201732] Registering SWP/SWPB emulation handler
[    2.209327] registered taskstats version 1
[    2.222003] ci_hdrc ci_hdrc.1: EHCI Host Controller
[    2.228282] ci_hdrc ci_hdrc.1: new USB bus registered, assigned bus number 2
[    2.248734] ci_hdrc ci_hdrc.1: USB 2.0 started, EHCI 1.00
[    2.255893] hub 2-0:1.0: USB hub found
[    2.261098] hub 2-0:1.0: 1 port detected
[    2.268238] ubi0: default fastmap pool size: 200
[    2.274275] ubi0: default fastmap WL pool size: 100
[    2.280543] ubi0: attaching mtd4
[    2.379617] ubi0: attached by fastmap
[    2.384628] ubi0: fastmap pool size: 200
[    2.389845] ubi0: fastmap WL pool size: 100
[    2.403248] ubi0: attached mtd4 (name "ubi", size 508 MiB)
[    2.410081] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[    2.418234] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[    2.426327] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[    2.434610] ubi0: good PEBs: 4060, bad PEBs: 4, corrupted PEBs: 0
[    2.442026] ubi0: user volume: 4, internal volumes: 1, max. volumes count: 128
[    2.451847] ubi0: max/mean erase counter: 3/1, WL threshold: 4096, image sequence number: 0
[    2.462817] ubi0: available PEBs: 0, total reserved PEBs: 4060, PEBs reserved for bad PEB handling: 76
[    2.474925] ubi0: background thread "ubi_bgt0d" started, PID 145
[    2.475727] input: gpio-keys as /devices/platform/gpio-keys/input/input1
[    2.491589] rtc-ds1307 3-0068: hctosys: unable to read the hardware clock
[    2.515803] ALSA device list:
[    2.520372]   #0: imx7-colibri-sgtl5000
[    2.526763] UBIFS (ubi0:3): background thread "ubifs_bgt0_3" started, PID 146
[    2.574428] UBIFS (ubi0:3): UBIFS: mounted UBI device 0, volume 3, name "rootfs"
[    2.584965] UBIFS (ubi0:3): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[    2.598196] UBIFS (ubi0:3): FS size: 493936640 bytes (471 MiB, 3890 LEBs), journal size 9023488 bytes (8 MiB, 72 LEBs)
[    2.612436] UBIFS (ubi0:3): reserved for root: 0 bytes (0 KiB)
[    2.620141] UBIFS (ubi0:3): media format: w4/r0 (latest is w4/r0), UUID 8C0106EA-561E-41D7-89D4-1F67EE37EF5B, small LPT model
[    2.635985] VFS: Mounted root (ubifs filesystem) on device 0:14.
[    2.644311] devtmpfs: mounted
[    2.649528] Freeing unused kernel memory: 388K
[    2.716461] random: nonblocking pool is initialized
[    2.792762] systemd[1]: System time before build time, advancing clock.
[    2.847760] systemd[1]: systemd 237 running in system mode. (+PAM -AUDIT -SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP -LIBCRYPTSETUP -GCRYPT -GNUTLS +ACL -XZ +LZ4 -SECCOMP +BLKID -ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid)
[    2.876717] systemd[1]: Detected architecture arm.

Welcome to The Ångström Distribution v2018.06!

[    2.909973] systemd[1]: Set hostname to <colibri-imx7>.
…
…
...
.---O---.                                           
|       |                  .-.           o o        
|   |   |-----.-----.-----.| |   .----..-----.-----.
|       |     | __  |  ---'| '--.|  .-'|     |     |
|   |   |  |  |     |---  ||  --'|  |  |  '  | | | |
'---'---'--'--'--.  |-----''----''--'  '-----'-'-'-'
                -'  |
                '---'

The Angstrom Distribution colibri-imx7 ttymxc0

Angstrom v2018.06 - Kernel

colibri-imx7 login: 

 

Pronto! A partir deste momento para qualquer pacote, biblioteca, ferramenta adicionada no Yocto Project troque apenas o ubifs.img e repita o processo. Caso alterações no kernel ou device-tree aconteçam, delete o arquivo e substitua e certifique-se de refazer os link simbólicos corretamente.

 

Boa diversão e até a próxima!

 

 

Saiba mais

 

Acelerando o Build de Yocto com ajuda da Nuvem

Embarcando ScadaBR com Yocto na Toradex Colibri i.MX6

Yocto Project: Quick Start

 

 

Referências

 

https://developer.toradex.com/software/linux/linux-software#Binary_Images

https://developer.toradex.com/software/toradex-easy-installer#colibri-imx7

https://developer.toradex.com/knowledge-base/flashing-embedded-linux-to-imx7-modules

 

Outros artigos da série

<< Criando uma distribuição Linux com Yocto Project para Toradex Colibri i.MX7Conectando Toradex Colibri i.MX7 com WiFi >>
Este post faz da série Toradex Colibri i.MX7. Leia também os outros posts da série:
NEWSLETTER

Receba os melhores conteúdos sobre sistemas eletrônicos embarcados, dicas, tutoriais e promoções.

Obrigado! Sua inscrição foi um sucesso.

Ops, algo deu errado. Por favor tente novamente.

Licença Creative Commons Esta obra está licenciada com uma Licença Creative Commons Atribuição-CompartilhaIgual 4.0 Internacional.

Cleiton Bueno
Proprietário da B2Open onde oferecemos consultoria, treinamentos e desenvolvimento em Sistemas Embarcados. Entusiasta a filosofia open-source, mais de 10 anos de experiências em Linux e FOSS. Em sistemas embarcado do firmware baremetal ao Linux Embedded, e há aproximadamente 8 anos desenvolvendo em (C, Python, Qt e muito Shell Script), além de profiling, hardening e tuning para targets com Linux Embarcado. Graduado em Engenharia da Computação pela UNICEP com ênfase em robótica e sistemas embarcados.

8
Deixe um comentário

avatar
 
3 Comment threads
5 Thread replies
4 Followers
 
Most reacted comment
Hottest comment thread
4 Comment authors
Jonathan SperbAnderson Ferreira RodriguezCleiton BuenoRafael Dias Recent comment authors
  Notificações  
recentes antigos mais votados
Notificar
Jonathan Sperb
Visitante
Jonathan Sperb

Olá. Os arquivos para download do artigo estão com link quebrado. Poderia verificar? Obrigado.

Anderson Ferreira Rodriguez
Membro
Anderson Ferreira Rodriguez

Olá
estou tendo dificuldades na hora de executar o comando "run setupdate". segue mensagens que apareceram no console:

Colibri iMX7 # run setupdate
reading colibri_imx7/flash_blk.img
** Unable to read file colibri_imx7/flash_blk.img **
** Bad device usb 0 **

me parece que o SD card não está sendo reconhecido pelo Uboot, porque esta mensagem apareceu preparando o SD card tanto com a imagem que gerei como com a imagem do link que foi disponibilizado no artigo.

Rafael Dias
Visitante
Rafael Dias

pergunta: tem que realizar o download da imagem Colibri-iMX7_LXDE-Image_2.8b3.111-20180627?

é o que dá a impressão aqui: "utilizando informações da imagem Colibri iMX7 LXDE Image 2.8b3 27/06/2018"

Rafael Dias
Visitante
Rafael Dias

eu estou seguindo os passos desde o artigo de como construir a imagem com o yocto e reproduzindo aqui no meu ambiente.

Estava imginando que o processo de build era auto-contido, não precisando baixar nada de fora.