NSA320 Broken uboot August 24, 2019 10:47AM |
Registered: 4 years ago Posts: 9 |
Quote
1. uBoot envs config should be defined as followed in your /etc/fw_env.config
cat /etc/fw_env.config
# MTD device name Device offset Env. size Flash sector size Number of sectors
/dev/mtd0 0xc0000 0x20000 0x20000
Quote
sudo ./kwboot -t -B 115200 /dev/ttyAMA0 -b ./uboot.2017.07.tld-1.nsa320.bodhi.tar -p -d
Segmentation Fault
Quote
dmesg | grep ttyAMA0
[1.0837481] 3f201000.serial: ttyAMA0 at MMIO 0x3f201000 (irq = 81, base_baud = 0) is a PL011 rev2
Re: NSA320 Broken uboot August 24, 2019 12:59PM |
Registered: 4 years ago Posts: 9 |
pi@raspberrypi:~ $ sudo ./kwboot -t -B 115200 /dev/ttyAMA0 -b ./uboot.2017.07-tld-1.nsa320.bodhi.tar Sending boot message. Please reboot the target...
pi@raspberrypi:~ $ sudo screen /dev/ttyAMA0 115200,cs8,istrip # no output, nothing happens.
# adding -p throws segmentation fault pi@raspberrypi:~ $ sudo ./kwboot -t -B 115200 /dev/ttyAMA0 -b ./uboot.2017.07-tld-1.nsa320.bodhi.tar -p Segmentation fault
pi@raspberrypi:~ $ sudo ./kwboot -t -B 115200 /dev/ttyAMA0 -b ./uboot.2017.07-tld-1.nsa320.bodhi.tar -d Sending debug message. Please reboot the target...
Re: NSA320 Broken uboot August 24, 2019 02:18PM |
Registered: 4 years ago Posts: 9 |
pi@raspberrypi:~ $ sudo picocom --b 115200 --f n --p n --d 8 /dev/ttyS0 picocom v1.7 port is : /dev/ttyS0 flowcontrol : none baudrate is : 115200 parity is : none databits are : 8 escape is : C-a local echo is : no noinit is : no noreset is : no nolock is : no send_cmd is : sz -vv receive_cmd is : rz -vv imap is : omap is : emap is : crcrlf,delbs, Terminal ready 4: USB EHCI0sgsevu *adc * vs3*neinndSc cubdibacub R EiA2rdv H y key tntialize on egiga0 #ntnly0 nntap Untby # i rt dur. e 0lg t/oad.* b*nc8'*dvi lnm.*e
pi@raspberrypi:~ $ sudo picocom --b 115200 /dev/ttyS0 picocom v1.7 port is : /dev/ttyS0 flowcontrol : none baudrate is : 115200 parity is : none databits are : 8 escape is : C-a local echo is : no noinit is : no noreset is : no nolock is : no send_cmd is : sz -vv receive_cmd is : rz -vv imap is : omap is : emap is : crcrlf,delbs, Terminal ready w 8_R 2MBR CotdNd:e1d :itecs N C,si u enmt iniie e0 Isear:rieteg it anyeto stoputoic.2 B eic(dena nprn a0 ##UnNAD 128 MiB n:ur e eiaoe
-Boot 2017.07-tld-1 (Sep 05 2017 - 00:46:11 -0700) ZyXEL NSA320 2-Bay Power Media Server SoC: Kirkwood 88F6281_A1 DRAM: 512 MiB WARNING: Caches not enabled NAND: 128 MiB *** Warning - bad CRC, using default environment In: serial Out: serial Err: serial Net: egiga0 MV88E1318 PHY initialized on egiga0 0 any key to stop autoboot: 5 starting USB... USB0: USB EHCI 1.00 scanning bus 0 for devices... 2 USB Device(s) found scanning usb for storage dide_preinit failed ## Unknown partition table type 0 ## Unknown partition table type 0 ## Unknown partition table type 0 ## Unknown partition table type 0 ## Unknown partition table type 0 ## Unknown partition table type 0 ## Unknown partition table type 0 loading envs from usb 0 ... ** Bad device usb 0 ** no IDE devices available running scan_disk ... Scan device usb device usb 0:1 ** Bad device usb 0 ** device usb 1:1 ** Bad device usb 1 ** device usb 2:1 ** Bad device usb 2 ** device uide_preinit failed device ide 0:1 ** Bad device ide 0 ** device ide 1:1 ** Bad device ide 1 ** device ide 2:1 ** Bad device ide 2 ** device ide 3:1 ** Bad device ide 3 ** loading uImage ... ** Bad device usb 0 ** loading uInitrd ... ** Bad device usb 0 ** loading DTB /boot/dts/kirkwood-nsa320.dtb ... ** Bad device usb 0 ** Unknown command 'bootm0x800000' - try 'help' resetting ...
Re: NSA320 Broken uboot August 24, 2019 02:27PM |
Registered: 7 years ago Posts: 366 |
Re: NSA320 Broken uboot August 24, 2019 02:37PM |
Admin Registered: 13 years ago Posts: 18,570 |
alias myserial='picocom --b 115200 --f n --p n --d 8 /dev/ttyUSB0'
Quote
I have only connected RX and TX. Following this https://forum.doozan.com/read.php?3,51739,51919#msg-51919
picocom --b 115200 --f n --p n --d 8 /dev/ttyS0
picocom --b 115200 --f n --p n --d 8 /dev/ttyAMA0
Quote
Ok, so I got serial working.
For anyone troubling with RPI + Serial. You need to disable Bluetooth on the RPI, since the pins seems to be shared, or something. After doing this, I finally could get output from the NSA320 serial (https://openenergymonitor.org/forum-archive/node/12311.html)
Re: NSA320 Broken uboot August 24, 2019 02:40PM |
Registered: 4 years ago Posts: 9 |
pi@raspberrypi:~ $ sudo picocom --b 115200 --f n --p n --d 8 /dev/ttyAMA0 picocom v1.7 port is : /dev/ttyAMA0 flowcontrol : none baudrate is : 115200 parity is : none databits are : 8 escape is : C-a local echo is : no noinit is : no noreset is : no nolock is : no send_cmd is : sz -vv receive_cmd is : rz -vv imap is : omap is : emap is : crcrlf,delbs, Terminal ready U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:46:11 -0700) ZyXEL NSA320 2-Bay Power Media Server SoC: Kirkwood 88F6281_A1 DRAM: 512 MiB WARNING: Caches not enabled NAND: 128 MiB *** Warning - bad CRC, using default environment In: serial Out: serial Err: serial Net: egiga0 MV88E1318 PHY initialized on egiga0 Hit any key to stop autoboot: 0 2 USB Device(s) ide_preinit failed ## Unknown partition table type 0 ## Unknown partition table type 0 ## Unknown partition table type 0 ## Unknown partition table type 0 ## Unknown partition table type 0 ## Unknown partition table type 0 ## Unknown partition table type 0 loading envs from usb 0 ... ** Bad device usb 0 ** no IDE devices available running scan_disk ... E: ide_preinit failed device ide 0:1 ** Bad device ide 0 ** device ide 1:1 ** Bad device ide 1 ** device ide 2:1 ** Bad device ide 2 ** device ide 3:1 ** Bad device ide 3 ** loading uImage ... ** Bad device usb 0 ** loading uInitrd ... ** Bad device usb 0 ** loading DTB /boot/dts/kirkwood-nsa320.dtb ... ** Bad device usb 0 ** Unknown command 'bootm0x800000' - try 'help' resetting ...
Re: NSA320 Broken uboot August 24, 2019 02:43PM |
Admin Registered: 13 years ago Posts: 18,570 |
> scanning bus 0 for devices... 2 USB Device(s) > found > scanning usb for storage dide_preinit > ** Bad device usb 0 **
setenv dtb_file '/boot/dts/kirkwood-nsa320.dtb' boot
Re: NSA320 Broken uboot August 24, 2019 02:44PM |
Admin Registered: 13 years ago Posts: 18,570 |
Quote
Edit: I actually update the uboot or is this the stock one? sorry for the silly question, not sure how to check versions.
ver printenv
*** Warning - bad CRC, using default environment
Re: NSA320 Broken uboot August 24, 2019 02:48PM |
Registered: 4 years ago Posts: 9 |
>Quote
Edit: I actually update the uboot or is
> this the stock one? sorry for the silly question,
> not sure how to check versions.
> ver > printenv >
sudo picocom --b 115200 --f n --p n --d 8 /dev/ttyAMA0 picocom v1.7 port is : /dev/ttyAMA0 flowcontrol : none baudrate is : 115200 parity is : none databits are : 8 escape is : C-a local echo is : no noinit is : no noreset is : no nolock is : no send_cmd is : sz -vv receive_cmd is : rz -vv imap is : omap is : emap is : crcrlf,delbs, Terminal ready U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:46:11 -0700) ZyXEL NSA320 2-Bay Power Media Server SoC: Kirkwood 88F6281_A1 DRAM: 512 MiB WARNING: Caches not enabled NAND: 128 MiB *** Warning - bad CRC, using default environment In: serial Out: serial Err: serial Net: egiga0 MV88E1318 PHY initialized on egiga0 Hit any key to stop autoboot: 1 7 4 3 0 p�����n��jfjf���
Quote
And you did not flash the env image. So your envs need adjustment to boot the USB rootfs!
Re: NSA320 Broken uboot August 24, 2019 03:11PM |
Admin Registered: 13 years ago Posts: 18,570 |
Re: NSA320 Broken uboot August 24, 2019 03:15PM |
Registered: 4 years ago Posts: 9 |
pi@raspberrypi:~ $ sudo stty -F /dev/ttyAMA0 -a speed 115200 baud; rows 0; columns 0; line = 0; intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 0; -parenb -parodd -cmspar cs8 hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke -flusho -extproc
sudo picocom --b 115200 --f n --p n --d 8 /dev/ttyAMA0 --imap lfcrlf
Re: NSA320 Broken uboot August 24, 2019 03:20PM |
Registered: 4 years ago Posts: 9 |
NSA320> ver U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:46:11 -0700) ZyXEL NSA320 2-Bay Power Media Server gcc (Debian 6.3.0-18) 6.3.0 20170516 GNU ld (GNU Binutils for Debian) 2.28
NSA320> printenv arcNumber=3956 baudrate=115200 bootcmd=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec; reset bootcmd_exec=run load_uimage; if run load_initrd; then if run load_dtb; then bootm $load_uimage_addr $load_initrd_addr $load_dtb_addr; else bootm $load_uimage_addr $load_initrd_addr; fi; else if run load_dtb; then bootm $load_uimage_addr - $load_dtb_addr; else bootm$load_uimage_addr; fi; fi bootcmd_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi bootdelay=10 bootdev=usb console=console=ttyS0,115200 device=0:1 devices=usb ide disks=0 1 2 3 dtb_file=/boot/dts/kirkwood-nsa320.dtb ethact=egiga0 ethaddr=52:3b:20:9c:11:51 if_netconsole=ping $serverip ipaddr=192.168.0.231 led_error=orange blinking led_exit=green off led_init=green blinking load_dtb=echo loading DTB $dtb_file ...; load $bootdev $device $load_dtb_addr $dtb_file load_dtb_addr=0x1c00000 load_initrd=echo loading uInitrd ...; load $bootdev $device $load_initrd_addr /boot/uInitrd load_initrd_addr=0x1100000 load_uimage=echo loading uImage ...; load $bootdev $device $load_uimage_addr /boot/uImage load_uimage_addr=0x800000 mainlineLinux=yes mtdids=nand0=orion_nand mtdparts=mtdparts=orion_nand:0x100000(uboot),0x80000(stock_uboot_env),0x80000(key_store),0x80000(info),0xA00000(etc),0xA00000(kernel_1),0x2FC0000(rootfs1),0xA00000(kernel_2),0x2FC0000(rootfs2) partition=nand0,2 preboot_nc=run if_netconsole start_netconsole scan_disk=echo running scan_disk ...; scan_done=0; setenv scan_usb "usb start"; setenv scan_ide "ide reset"; setenv scan_mmc "mmc rescan"; for dev in $devices; do if test $scan_done -eq 0; then echo Scan device $dev; run scan_$dev; for disknum in $disks; do if test $scan_done -eq 0; then echo device $dev $disknum:1; if load $dev $disknum:1 $load_uimage_addr /boot/uImage 1; then scan_done=1; echo Found bootable drive on $dev $disknum; setenv device $disknum:1; setenv bootdev $dev; fi; fi; done; fi; done serverip=192.168.0.220 set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts $custom_params start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version; stderr=serial stdin=serial stdout=serial uenv_addr=0x810000 uenv_import=echo importing envs ...; env import -t $uenv_addr $filesize uenv_init_devices=setenv init_usb "usb start"; setenv init_ide "ide reset"; setenv init_mmc "mmc rescan"; for devtype in $devices; do run init_$devtype; done; uenv_load=run uenv_init_devices; setenv uenv_loaded 0; for devtype in $devices; do for disknum in 0; do run uenv_read_disk; done; done; uenv_read=echo loading envs from $devtype $disknum ...; if load $devtype $disknum:1 $uenv_addr /boot/uEnv.txt; then setenv uenv_loaded 1; fi uenv_read_disk=if test $devtype -eq mmc; then if $devtype part; then run uenv_read; fi; else if $devtype part $disknum; then run uenv_read; fi; fi usb_ready_retry=15 Environment size: 3016/131068 bytes
Re: NSA320 Broken uboot August 24, 2019 05:10PM |
Admin Registered: 13 years ago Posts: 18,570 |
Re: NSA320 Broken uboot August 24, 2019 05:11PM |
Registered: 4 years ago Posts: 9 |
Re: NSA320 Broken uboot August 24, 2019 05:34PM |
Admin Registered: 13 years ago Posts: 18,570 |
Re: NSA320 Broken uboot August 24, 2019 05:52PM |
Registered: 4 years ago Posts: 9 |
pi@raspberrypi:~ $ uname -a Linux raspberrypi 4.14.98-v7+ #1200 SMP Tue Feb 12 20:27:48 GMT 2019 armv7l GNU/Linux
sudo stty -F /dev/ttyAMA0 onlcr sudo stty -F /dev/ttyAMA0 115200 cs8 sudo picocom --b 115200 --f n --p n --d 8 /dev/ttyAMA0 --imap lfcrlf