aaarrr 72 October 5, 2021 Posted October 5, 2021 · Report post 10 minutes ago, Овчинников Игорь said: подумать не мог что надо не двойные, а одинарные кавычки Двойные тоже можно, отличие в том, что будут подставлены значения переменных: setenv xxx 12345 setenv zzz '$xxx' -> zzz=$xxx setenv zzz "$xxx" -> zzz=12345 Quote Share this post Link to post Share on other sites More sharing options...
Igor68 0 October 6, 2021 Posted October 6, 2021 · Report post Благодарен за подсказку! Смогу испытать, только дома... Теперь, извините кончно, интересует информация о ROOTFS. Должно ли это быть в uboot.env. Кернел меня материт ведь по чёрному... то это не может создать, то другое применить. Или достаточно положить образ по тому адресу, где он указал? Разумеется в том виде какой ему надо - к примеру JFFS. Спасибо! Quote Share this post Link to post Share on other sites More sharing options...
aaarrr 72 October 6, 2021 Posted October 6, 2021 · Report post https://microchipsupport.force.com/s/article/What-is-the-u-boot-command-for-programming-the-jffs2-rootfs-on-SAM9263-EK В вашем случае адрес NAND для rootfs 0x800000. Quote Share this post Link to post Share on other sites More sharing options...
Igor68 0 October 6, 2021 Posted October 6, 2021 (edited) · Report post 3 hours ago, aaarrr said: https://microchipsupport.force.com/s/article/What-is-the-u-boot-command-for-programming-the-jffs2-rootfs-on-SAM9263-EK В вашем случае адрес NAND для rootfs 0x800000. Спасибо!!! Я понял, да и кернел сам сказал: Creating 8 MTD partitions on "atmel_nand": 0x000000000000-0x000000040000 : "bootstrap" 0x000000040000-0x0000000c0000 : "uboot" 0x0000000c0000-0x000000100000 : "env" 0x000000100000-0x000000140000 : "env_redundant" 0x000000140000-0x000000180000 : "spare" 0x000000180000-0x000000200000 : "dtb" 0x000000200000-0x000000800000 : "kernel" 0x000000800000-0x000010000000 : "rootfs" libphy: Fixed MDIO Bus: probed Ещё смущает вот это: atmel_nand 40000000.nand: Use On Flash BBT Bad block table found at page 131008, version 0x01 Bad block table found at page 130944, version 0x01 nand_read_bbt: bad block at 0x000000ea0000 nand_read_bbt: bad block at 0x00000ae40000 Не натолкнуться бы на эти блоки... вот какбы их обойти? Как раз в теле rootfs. Может микросхему заменить? Edited October 6, 2021 by Овчинников Игорь Quote Share this post Link to post Share on other sites More sharing options...
aaarrr 72 October 6, 2021 Posted October 6, 2021 · Report post 17 minutes ago, Овчинников Игорь said: Не натолкнуться бы на эти блоки... вот какбы их обойти? Как раз в теле rootfs. Может микросхему заменить? Они потому и упомянуты, что будут обойдены автоматом. Любая NAND содержит битые блоки. Quote Share this post Link to post Share on other sites More sharing options...
gosha-z 3 October 6, 2021 Posted October 6, 2021 · Report post Я наткнулся на то, что у SAM9X60D1G разные времянки для 3.3V и 1.8V NAND памяти Quote Share this post Link to post Share on other sites More sharing options...
Igor68 0 October 6, 2021 Posted October 6, 2021 (edited) · Report post Доброго времени суток! Простите, но вот собственно и вопрос: как обойти вот это: VFS: Cannot open root device "mtdblock7" or unknown-block(31,7): error -19 Please append a correct "root=" boot option; here are the available partitions: 0100 8192 ram0 (driver?) 0101 8192 ram1 (driver?) 0102 8192 ram2 (driver?) 0103 8192 ram3 (driver?) 1f00 256 mtdblock0 (driver?) 1f01 512 mtdblock1 (driver?) 1f02 256 mtdblock2 (driver?) 1f03 256 mtdblock3 (driver?) 1f04 256 mtdblock4 (driver?) 1f05 512 mtdblock5 (driver?) 1f06 6144 mtdblock6 (driver?) 1f07 253952 mtdblock7 (driver?) Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,7) ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,7) random: fast init done g_serial gadget: full-speed config #2: CDC ACM config random: crng init done Испытывал с файлами, сформированными в buildroot такими: rootfs.jffs2; rootfs.ubi; rootfs.ubifs. Вкзде результат такой же. Правда есть ещё файл rootfs.tar, который не использовал. Так же не понятная фраза (driver?) , отсутсвие средств в ядре? Может пересобрать? Или в U-Boot есть параметр для указвния в U-Boot? Спасибо!!! Edited October 6, 2021 by Овчинников Игорь Quote Share this post Link to post Share on other sites More sharing options...
aaarrr 72 October 6, 2021 Posted October 6, 2021 · Report post 5 minutes ago, Овчинников Игорь said: есть ещё файл rootfs.tar Его можно распаковать на USB флеш, например (root=/dev/sdaX). Просто архив с корневой ФС. 6 minutes ago, Овчинников Игорь said: отсутсвие средств в ядре? Судя по отсутствию упоминаний jffs2/ubi при загрузке, очень на то похоже. Так что make ARCH=arm menuconfig, и добавляем ubi/jffs. Quote Share this post Link to post Share on other sites More sharing options...
Igor68 0 October 6, 2021 Posted October 6, 2021 (edited) · Report post 7 minutes ago, aaarrr said: Его можно распаковать на USB флеш, например (root=/dev/sdaX). Просто архив с корневой ФС. Судя по отсутствию упоминаний jffs2/ubi при загрузке, очень на то похоже. Так что make ARCH=arm menuconfig, и добавляем ubi/jffs. Ну если в ядре, тогда надо пересобирать. Приступаю.......... Edited October 6, 2021 by Овчинников Игорь Quote Share this post Link to post Share on other sites More sharing options...
Igor68 0 October 6, 2021 Posted October 6, 2021 · Report post Для платы at91sam9260ek нет конфига в linux-4.8.6, но есть в buildroot и там же в корневой директории нужный конфиг. Каким-то образом этот конфиг становится актуальным и для этого Linux. Потому и пришлось делать make clean, а потом make ARCH=arm, через menuconfig. Вроде выбрал файловые системы, но я и прошлый раз выбирал. Жду результата...... Quote Share this post Link to post Share on other sites More sharing options...
aaarrr 72 October 6, 2021 Posted October 6, 2021 · Report post 4 minutes ago, Овчинников Игорь said: Для платы at91sam9260ek нет конфига в linux-4.8.6 Скорее всего, есть at91_dt_defconfig Quote Share this post Link to post Share on other sites More sharing options...
Igor68 0 October 6, 2021 Posted October 6, 2021 (edited) · Report post 2 hours ago, aaarrr said: Скорее всего, есть at91_dt_defconfig Да! Такой есть, но в menuconfig есть только выбор процессора arm926ej-s по моему так, но адрес старта мною не найден, а ковыряться в конфигурациях вручную сил нет уже. Да и include не содержит at91sam9260ek.h и другие отсутствуют. Да и результат старта такой: RomBOOT > AT91Bootstrap 3.8.10 (Вс 03 окт 2021 16:22:43 MSK) NAND: Done to load image U-Boot 2016.09.01 (Oct 03 2021 - 16:23:14 +0300) CPU: AT91SAM9260 Crystal frequency: 18.432 MHz CPU clock : 198.656 MHz Master clock : 99.328 MHz DRAM: 64 MiB WARNING: Caches not enabled NAND: 256 MiB In: serial Out: serial Err: serial Net: macb0 Error: macb0 address not set. Hit any key to stop autoboot: 0 NAND read: device 0 offset 0x200000, size 0x377ad8 3635928 bytes read: OK NAND read: device 0 offset 0x140000, size 0x4980 18816 bytes read: OK Bad Linux ARM zImage magic! U-Boot> RomBOOT Это при идентичном U-Boot env. Можно конечно пошаманить с env, но как сказал изо дня в день ложиться после 24:00 и вставать в 5:30 не реально. Сейчас жду окончания сборки.... вот это: /usr/bin/ld: scripts/dtc/dtc-parser.tab.o:(.bss+0x10): повторное определение «yylloc»; scripts/dtc/dtc-lexer.lex.o:(.bss+0x0): здесь первое определение Достало уже - опять вручную править. Одно радует, что сборка не начигается с начала. Edited October 6, 2021 by Овчинников Игорь Quote Share this post Link to post Share on other sites More sharing options...
aaarrr 72 October 6, 2021 Posted October 6, 2021 · Report post 21 minutes ago, Овчинников Игорь said: адрес старта мною не найден Что есть адрес старта? 21 minutes ago, Овчинников Игорь said: Да и include не содержит at91sam9260ek.h и другие отсутствуют. Для связи ядра с конкретной железкой достаточно dts. Какие-либо специфические хидеры или board-файлы могут отсутствовать. 20 minutes ago, Овчинников Игорь said: size 0x377ad8 Сильно сомневаюсь, что длина не изменилась. 24 minutes ago, Овчинников Игорь said: Достало уже - опять вручную править Так исправить один раз и забыть закомитить: diff --git a/scripts/dtc/dtc-lexer.l b/scripts/dtc/dtc-lexer.l index 615b7ec65..d3694d6cf 100644 --- a/scripts/dtc/dtc-lexer.l +++ b/scripts/dtc/dtc-lexer.l @@ -38,7 +38,6 @@ LINECOMMENT "//".*\n #include "srcpos.h" #include "dtc-parser.tab.h" -YYLTYPE yylloc; extern bool treesource_error; /* CAUTION: this will stop working if we ever use yyless() or yyunput() */ Quote Share this post Link to post Share on other sites More sharing options...
Igor68 0 October 6, 2021 Posted October 6, 2021 · Report post 44 minutes ago, aaarrr said: Что есть адрес старта? Для связи ядра с конкретной железкой достаточно dts. Какие-либо специфические хидеры или board-файлы могут отсутствовать. Сильно сомневаюсь, что длина не изменилась. Так исправить один раз и забыть закомитить: diff --git a/scripts/dtc/dtc-lexer.l b/scripts/dtc/dtc-lexer.l index 615b7ec65..d3694d6cf 100644 --- a/scripts/dtc/dtc-lexer.l +++ b/scripts/dtc/dtc-lexer.l @@ -38,7 +38,6 @@ LINECOMMENT "//".*\n #include "srcpos.h" #include "dtc-parser.tab.h" -YYLTYPE yylloc; extern bool treesource_error; /* CAUTION: this will stop working if we ever use yyless() or yyunput() */ Уже крыша едет, про длину забыл. Вот отчёт: U-Boot> nand read 0x22000000 0x200000 0x382840; nand read 0x22800000 0x140000 0x4980; bootz 0x22000000 - 0x22800000 NAND read: device 0 offset 0x200000, size 0x382840 3680320 bytes read: OK NAND read: device 0 offset 0x140000, size 0x4980 18816 bytes read: OK Kernel image @ 0x22000000 [ 0x000000 - 0x382840 ] ## Flattened Device Tree blob at 22800000 Booting using the fdt blob at 0x22800000 Loading Device Tree to 23eb2000, end 23eb997f ... OK Starting kernel ... Booting Linux on physical CPU 0x0 Linux version 4.8.6 (igor@debianNUC7PJYH) (gcc version 9.3.0 (Buildroot 2021.02.3) ) #1 Thu Oct 7 00:33:26 MSK 2021 CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=0005317f CPU: VIVT data cache, VIVT instruction cache OF: fdt:Machine model: Atmel at91sam9260ek Memory policy: Data cache writeback Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256 Kernel command line: console=ttyS0,115200 earlyprintk mtdparts=atmel_nand:256k(bootstrap)ro,512k(uboot)ro,256k(env),256k(env_redundant),256k(spare),512k(dtb),6M(kernel)ro,-(rootfs) root=/dev/mtdblock7 rw rootfstype=jffs2 PID hash table entries: 256 (order: -2, 1024 bytes) Dentry cache hash table entries: 8192 (order: 3, 32768 bytes) Inode-cache hash table entries: 4096 (order: 2, 16384 bytes) Memory: 57488K/65536K available (4899K kernel code, 175K rwdata, 1744K rodata, 220K init, 127K bss, 8048K reserved, 0K cma-reserved) Virtual kernel memory layout: vector : 0xffff0000 - 0xffff1000 ( 4 kB) fixmap : 0xffc00000 - 0xfff00000 (3072 kB) vmalloc : 0xc4800000 - 0xff800000 ( 944 MB) lowmem : 0xc0000000 - 0xc4000000 ( 64 MB) modules : 0xbf000000 - 0xc0000000 ( 16 MB) .text : 0xc0008000 - 0xc04d1118 (4901 kB) .init : 0xc06ad000 - 0xc06e4000 ( 220 kB) .data : 0xc06e4000 - 0xc070ff20 ( 176 kB) .bss : 0xc070ff20 - 0xc072fd28 ( 128 kB) NR_IRQS:16 nr_irqs:16 16 clocksource: pit: mask: 0x7ffffff max_cycles: 0x7ffffff, max_idle_ns: 9620954980 ns sched_clock: 32 bits at 128 Hz, resolution 7812500ns, wraps every 16777215996093750ns Console: colour dummy device 80x30 Calibrating delay loop... 98.72 BogoMIPS (lpj=385024) pid_max: default: 32768 minimum: 301 Mount-cache hash table entries: 1024 (order: 0, 4096 bytes) Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes) CPU: Testing write buffer coherency: ok Setting up static identity map for 0x20008400 - 0x2000847c devtmpfs: initialized clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 14931722236523437 ns pinctrl core: initialized pinctrl subsystem NET: Registered protocol family 16 DMA: preallocated 256 KiB pool for atomic coherent allocations AT91: Detected SoC: at91sam9260, revision 2 No ATAGs? gpio-at91 fffff400.gpio: at address c485a400 gpio-at91 fffff600.gpio: at address c485c600 gpio-at91 fffff800.gpio: at address c485e800 pinctrl-at91 ahb:apb:pinctrl@fffff400: initialized AT91 pinctrl driver clocksource: tcb_clksrc: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 153935280796 ns SCSI subsystem initialized usbcore: registered new interface driver usbfs usbcore: registered new interface driver hub usbcore: registered new device driver usb i2c-gpio i2c-gpio-0: using pins 23 (SDA) and 24 (SCL) Linux video capture interface: v2.00 Advanced Linux Sound Architecture Driver Initialized. clocksource: Switched to clocksource tcb_clksrc NET: Registered protocol family 2 TCP established hash table entries: 1024 (order: 0, 4096 bytes) TCP bind hash table entries: 1024 (order: 0, 4096 bytes) TCP: Hash tables configured (established 1024 bind 1024) UDP hash table entries: 256 (order: 0, 4096 bytes) UDP-Lite hash table entries: 256 (order: 0, 4096 bytes) NET: Registered protocol family 1 RPC: Registered named UNIX socket transport module. RPC: Registered udp transport module. RPC: Registered tcp transport module. RPC: Registered tcp NFSv4.1 backchannel transport module. futex hash table entries: 256 (order: -1, 3072 bytes) workingset: timestamp_bits=30 max_order=14 bucket_order=0 io scheduler noop registered (default) fffff200.serial: ttyS0 at MMIO 0xfffff200 (irq = 16, base_baud = 6208000) is a ATMEL_SERIAL console [ttyS0] enabled fffb0000.serial: ttyS1 at MMIO 0xfffb0000 (irq = 26, base_baud = 6208000) is a ATMEL_SERIAL atmel_usart fffb0000.serial: Not supported ip name nor version, set to uart fffb4000.serial: ttyS2 at MMIO 0xfffb4000 (irq = 27, base_baud = 6208000) is a ATMEL_SERIAL atmel_usart fffb4000.serial: Not supported ip name nor version, set to uart [drm] Initialized drm 1.1.0 20060810 brd: module loaded loop: module loaded ssc fffbc000.ssc: Atmel SSC device at 0xc4890000 (irq 31) atmel_nand 40000000.nand: No DMA support for NAND access. nand: device found, Manufacturer ID: 0xec, Chip ID: 0xda nand: Samsung NAND 256MiB 3,3V 8-bit nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64 atmel_nand 40000000.nand: Use On Flash BBT Bad block table found at page 131008, version 0x01 Bad block table found at page 130944, version 0x01 nand_read_bbt: bad block at 0x000000ea0000 nand_read_bbt: bad block at 0x00000ae40000 8 cmdlinepart partitions found on MTD device atmel_nand Creating 8 MTD partitions on "atmel_nand": 0x000000000000-0x000000040000 : "bootstrap" 0x000000040000-0x0000000c0000 : "uboot" 0x0000000c0000-0x000000100000 : "env" 0x000000100000-0x000000140000 : "env_redundant" 0x000000140000-0x000000180000 : "spare" 0x000000180000-0x000000200000 : "dtb" 0x000000200000-0x000000800000 : "kernel" 0x000000800000-0x000010000000 : "rootfs" libphy: Fixed MDIO Bus: probed macb fffc4000.ethernet: invalid hw address, using random libphy: MACB_mii_bus: probed Davicom DM9161A fffc4000.etherne:00: attached PHY driver [Davicom DM9161A] (mii_bus:phy_addr=fffc4000.etherne:00, irq=-1) macb fffc4000.ethernet eth0: Cadence MACB rev 0x0001010c at 0xfffc4000 irq 28 (f6:96:3d:16:95:ff) ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver ehci-atmel: EHCI Atmel driver ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver ohci-atmel: OHCI Atmel driver at91_ohci 500000.ohci: USB Host Controller at91_ohci 500000.ohci: new USB bus registered, assigned bus number 1 at91_ohci 500000.ohci: irq 33, io mem 0x00500000 usb usb1: New USB device found, idVendor=1d6b, idProduct=0001 usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1 usb usb1: Product: USB Host Controller usb usb1: Manufacturer: Linux 4.8.6 ohci_hcd usb usb1: SerialNumber: at91 hub 1-0:1.0: USB hub found hub 1-0:1.0: 2 ports detected usbcore: registered new interface driver cdc_acm cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters usbcore: registered new interface driver usb-storage usbcore: registered new interface driver usbserial usbcore: registered new interface driver usbserial_generic usbserial: USB Serial support registered for generic usbcore: registered new interface driver ftdi_sio usbserial: USB Serial support registered for FTDI USB Serial Device usbcore: registered new interface driver pl2303 usbserial: USB Serial support registered for pl2303 udc: at91_udc version 3 May 2006 g_serial gadget: Gadget Serial v2.4 g_serial gadget: g_serial ready mousedev: PS/2 mouse device common for all mice rtc-at91sam9 fffffd20.rtc: rtc core: registered fffffd20.rtc as rtc0 rtc-at91sam9 fffffd20.rtc: rtc0: SET TIME! AT91: Starting after general reset at91_wdt fffffd40.watchdog: watchdog is disabled at91_wdt: probe of fffffd40.watchdog failed with error -22 atmel_mci fffa8000.mmc: version: 0x210 atmel_mci fffa8000.mmc: using PDC atmel_mci fffa8000.mmc: Atmel MCI controller at 0xfffa8000 irq 30, 1 slots usbcore: registered new interface driver usbhid usbhid: USB HID core driver iio iio:device0: Resolution used: 10 bits iio iio:device0: not support touchscreen in the adc compatible string. NET: Registered protocol family 10 sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver NET: Registered protocol family 17 input: gpio_keys as /devices/soc0/gpio_keys/input/input0 rtc-at91sam9 fffffd20.rtc: hctosys: unable to read the hardware clock ALSA device list: No soundcards found. VFS: Cannot open root device "mtdblock7" or unknown-block(31,7): error -19 Please append a correct "root=" boot option; here are the available partitions: 0100 8192 ram0 (driver?) 0101 8192 ram1 (driver?) 0102 8192 ram2 (driver?) 0103 8192 ram3 (driver?) 1f00 256 mtdblock0 (driver?) 1f01 512 mtdblock1 (driver?) 1f02 256 mtdblock2 (driver?) 1f03 256 mtdblock3 (driver?) 1f04 256 mtdblock4 (driver?) 1f05 512 mtdblock5 (driver?) 1f06 6144 mtdblock6 (driver?) 1f07 253952 mtdblock7 (driver?) Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,7) ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,7) random: fast init done g_serial gadget: full-speed config #2: CDC ACM config Интересно где же я накосячил... Отключаюсь... как морально так и физически. Quote Share this post Link to post Share on other sites More sharing options...
aaarrr 72 October 6, 2021 Posted October 6, 2021 · Report post .config от ядра прикрепите - посмотрим. Quote Share this post Link to post Share on other sites More sharing options...