SPI Flash partitions/U-boot corrupt?

icorbitt
 
Posts: 3
Joined: Thu Dec 18, 2014 9:21 pm

SPI Flash partitions/U-boot corrupt?

Fri Dec 19, 2014 2:13 am

I flashed my Vocore with the stock image from OpenWRT. I used mtd to do it, and it appeared to complete successfully. I rebooted and my Vocore was unresponsive.

I pulled out my trusty 3.3v USB to TTL cable, connected it, and found out I was getting the "bad magic number" error.

I first followed the guide to flash via serial, http://vonger.cn/?topic=connecting-and- ... t-with-osx, and still the bad magic number remained. I then tried the tftpboot trick, and that didn't work either. In a last ditch effort, I tried loading the firmware via TFTP. Still nothing works.

This is when I realized that I wasn't getting exactly what I should've been getting from the "erase linux" command. Based on MarkusZ's output, "erase linux" should erase the linux bank of the flash chip, starting at 0x50000 and going to 0x7b0000. I'm also noticing that cp.linux fails completely. The following is what I'm getting:
Code: Select all
VoCore> erase linux

 Erase linux kernel block !!
From 0x50000 length 0x3B0000
raspi_erase: offs:50000 len:3b0000
...........................................................
VoCore> cp.linux 540004
current count: 5505028

 Copy linux image[5505028 byte] to SPI Flash[0x00050000]....
raspi_write: to:50000 len:540004
VoCore>


I thought something on the dock might be causing this, so I removed the dock, reconnected my USB TTL cable, and supplied a regulated 5V to the Vocore. I get all the same things.

While I'm good with Linux, I have no experience in U-boot, and from my Googling, I'm seeing that the ralink/vocore version of u-boot seems a bit neutered.

At this point I am not too sure what my options are. The only thing I can think of is somehow doing a "factory" flash, to fix the partitions and repair U-boot, and then flash my image.

Any help would be greatly appreciated.

On a side note, I know that the Vocore is operating properly because after some Googling, I tried this with both my custom image and the most recent Vonger released image (they both fail at mounting/enumerating the flash partitions, which I expected due to the flash chip issues detailed above):

Code: Select all
U-Boot for VoCore(based on RT5350)Warning: un-recognized chip ID, please update bootloader!
..
Version: May 30 2014 20:52:36

Press 'x' to console...

.
VoCore> setenv ipaddr 192.168.1.234
VoCore> setenv serverip 192.168.1.24
VoCore> tftp 0x1000000 openwrt.bin

 netboot_common, argc= 3

 NetTxPacket = 0x81FE59C0

 KSEG1ADDR(NetTxPacket) = 0xA1FE59C0

 NetLoop,call eth_halt !

 NetLoop,call eth_init !
Trying Eth0 (10/100-M)

 Waitting for RX_DMA_BUSY status Start... done


 Header Payload scatter function is Disable !!

 ETH_STATE_ACTIVE!!
Using Eth0 (10/100-M) device
TFTP from server 192.168.1.24; our IP address is 192.168.1.234
Filename 'openwrt.bin'.

 TIMEOUT_COUNT=10,Load address: 0x1000000
Loading: checksum bad
checksum bad
checksum bad
checksum bad
checksum bad
checksum bad
checksum bad
checksum bad
Got ARP REPLY, set server/gtwy eth addr (d0:50:99:01:48:6c)
Got it
#################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ####################################
done
Bytes transferred = 5505028 (540004 hex)
NetBootFileXferSize= 00540004
VoCore> bootm

Booting image at 01000000
   Image Name:   MIPS OpenWrt Linux-3.14.26
   Created:      2014-12-17  23:16:37 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    1005290 Bytes = 981.7 kB
   Load Address: 80000000
   Entry Point:  80000000
   Load Kernel: 

   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK

[    0.000000] Linux version 3.14.26 (iancorbitt@ubuntu) (gcc version 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.04 r43707) ) #10 Wed Dec 17 15:16:25 PST 2014
[    0.000000] SoC Type: Ralink RT5350 id:1 rev:3
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 0001964c (MIPS 24KEc)
[    0.000000] MIPS: machine is VoCore
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 02000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x00000000-0x01ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x00000000-0x01ffffff]
[    0.000000] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 16kB, 4-way, VIPT, no aliases, linesize 32 bytes
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
[    0.000000] Kernel command line: console=ttyS0,57600 rootfstype=squashfs,jffs2
[    0.000000] PID hash table entries: 128 (order: -3, 512 bytes)
[    0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Writing ErrCtl register=00036d03
[    0.000000] Readback ErrCtl register=00036d03
[    0.000000] Memory: 29356K/32768K available (2201K kernel code, 115K rwdata, 392K rodata, 164K init, 180K bss, 3412K reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:256
[    0.000000] CPU Clock: 360MHz
[    0.000000] systick: running - mult: 214748, shift: 32
[    0.000000] genirq: Flags mismatch irq 7. 00014600 (timer) vs. 00014600 (systick)
[    0.010000] Calibrating delay loop... 479.23 BogoMIPS (lpj=2396160)
[    0.070000] pid_max: default: 32768 minimum: 301
[    0.070000] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.080000] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.090000] pinctrl core: initialized pinctrl subsystem
[    0.090000] NET: Registered protocol family 16
[    0.120000] bio: create slab <bio-0> at 0
[    0.120000] rt2880_gpio 10000600.gpio: registering 22 gpios
[    0.130000] rt2880_gpio 10000600.gpio: registering 22 irq handlers
[    0.130000] rt2880_gpio 10000660.gpio: registering 6 gpios
[    0.140000] rt2880_gpio 10000660.gpio: registering 6 irq handlers
[    0.150000] Switched to clocksource systick
[    0.150000] NET: Registered protocol family 2
[    0.170000] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.190000] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.190000] TCP: Hash tables configured (established 1024 bind 1024)
[    0.210000] TCP: reno registered
[    0.220000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.220000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.240000] NET: Registered protocol family 1
[    0.250000] rt-timer 10000100.timer: maximum frequency is 7324Hz
[    0.270000] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.330000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.330000] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.360000] msgmni has been set to 57
[    0.360000] io scheduler noop registered
[    0.380000] io scheduler deadline registered (default)
[    0.400000] gpio-export gpio-export.4: 17 gpio(s) exported
[    0.420000] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    0.430000] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 20, base_baud = 2500000) is a 16550A
[    0.450000] console [ttyS0] enabled
[    0.450000] console [ttyS0] enabled
[    0.470000] bootconsole [early0] disabled
[    0.470000] bootconsole [early0] disabled
[    0.490000] m25p80 spi32766.0: found w25q128, expected s25fl064k
[    0.510000] m25p80 spi32766.0: w25q128 (16384 Kbytes)
[    0.510000] 4 ofpart partitions found on MTD device spi32766.0
[    0.530000] Creating 4 MTD partitions on "spi32766.0":
[    0.540000] 0x000000000000-0x000000030000 : "uboot"
[    0.550000] 0x000000030000-0x000000040000 : "uboot-env"
[    0.570000] 0x000000040000-0x000000050000 : "factory"
[    0.580000] 0x000000050000-0x000001000000 : "firmware"
[    0.600000] spi spi32766.1: setup: requested speed is too low 500000 Hz
[    0.600000] spi-rt2880 10000b00.spi: can't setup spi32766.1, status -22
[    0.630000] spi_master spi32766: spi_device register error /palmbus@10000000/spi@b00/mmc-slot@1
[    0.650000] ralink_soc_eth 10100000.ethernet eth0: ralink at 0xb0100000, irq 5
[    0.670000] rt3xxx-usbphy usbphy.3: loaded
[    0.670000] rt2880_wdt 10000120.watchdog: Initialized
[    0.690000] TCP: cubic registered
[    0.690000] NET: Registered protocol family 17
[    0.710000] 8021q: 802.1Q VLAN Support v1.8
[    0.710000] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[    0.740000] Please append a correct "root=" boot option; here are the available partitions:
[    0.740000] 1f00             192 mtdblock0  (driver?)
[    0.760000] 1f01              64 mtdblock1  (driver?)
[    0.770000] 1f02              64 mtdblock2  (driver?)
[    0.780000] 1f03           16064 mtdblock3  (driver?)
[    0.790000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

Vonger
 
Posts: 896
Joined: Sun Oct 19, 2014 6:00 am

Re: SPI Flash partitions/U-boot corrupt?

Sat Dec 20, 2014 4:07 am

The official openwrt is 8MB, you might have to change it.
And uboot is 8MB too. That might cause compatible problem due to your bin file is so big :) I did not try such big firmware yet.

Chris
 
Posts: 3
Joined: Tue Dec 02, 2014 4:47 pm

Re: SPI Flash partitions/U-boot corrupt?

Sat Dec 20, 2014 9:22 pm

I had a very similar problem and found the following solution:

I tried to flash the image of vonger http://vonger.cn/upload/vocore.16m.mjpg.bin. For this I used the "sysupgrade" utility in opewrt. The command seemed to work fine, but when I rebooted and looked at the logs in dmsg I saw a lot of read errors from the flash.

I repeated the procedure and this time the VOCORE was unbootable.

I now tried to use the flash method via u-boot but the the same error as "icorbitt" described in his post occurred. Indeed the size of that image is 0x3c0004 which is larger than 0x3b0000 which is the length spit out by the erase command in u-boot. I guess this is what Vonger mentioned: If flashing with u-boot the image must not be longer than 0x3b0000???

I now tried to flash vongers image http://vonger.cn/upload/vocore.16m.microsd.bin which is only 0x380004 long. And this worked without problems.

Since I have the VOCORE1.0 I have a 16MB flash. I guess from openwrt I now can flash larger images in principle. But why the sysupgrade utility failed in the first place I have not understood. Is it supposed to work correctly in vocore?

Vonger
 
Posts: 896
Joined: Sun Oct 19, 2014 6:00 am

Re: SPI Flash partitions/U-boot corrupt?

Mon Dec 22, 2014 7:26 am

please try the 8MB old firmware, might recover it.
http://vonger.cn/upload/vocore.bin

icorbitt
 
Posts: 3
Joined: Thu Dec 18, 2014 9:21 pm

Re: SPI Flash partitions/U-boot corrupt?

Sun Dec 28, 2014 5:42 pm

Thanks a TON Vonger. Flashing with the original 8M vocore.bin got me back working.

pma61
 
Posts: 12
Joined: Fri Nov 21, 2014 6:19 pm

Re: SPI Flash partitions/U-boot corrupt?

Mon Jan 19, 2015 2:06 pm

I have a similar problem (never appeared before):
Code: Select all
U-Boot for VoCore(based on RT5350)Warning: un-recognized chip ID, please update bootloader!
.
Version: May 30 2014 20:52:36

Press 'x' to console...

.
VoCore> loadb
## Ready for binary (kermit) download to 0x80100000 at 57600 bps...

(Back at MacBook-Pro-di-Francesco.local)
----------------------------------------------------
Kermit> send /Users/pma61/Downloads/vocore.bin
Kermit> c
Connecting to /dev/tty.usbserial, speed 57600
 Escape character: Ctrl-\ (ASCII 28, FS): enabled
Type the escape character followed by C to get back,
or followed by ? to see other options.
----------------------------------------------------
## Total Size      = 0x00340004 = 3407876 Bytes
## Start Addr      = 0x80100000
VoCore> erase linux

 Erase linux kernel block !!
From 0x50000 length 0x3B0000
raspi_erase: offs:50000 len:3b0000
...........................................................
VoCore> cp.linux 340004

 Copy linux image[514416623 byte] to SPI Flash[0x00050000]....
raspi_write: to:50000 len:1ea95fef


The image is the official.
Seams that there's a problem with u-boot command "cp.linux 340004": look at image size (byte) and look at the other one after "loadb" command.
Now I cannot write the image, I'll try to boot with tftp and flash with "mtd" command.

Greenwire-Elektronik
 
Posts: 101
Joined: Thu Dec 04, 2014 6:31 am

Re: SPI Flash partitions/U-boot corrupt?

Mon Jan 19, 2015 9:01 pm

You could also use tftp and uboot - so far your command seems to be correct - clearly, cp.linux is using the wrong size. Have you tried a different notation like 0x00340004?
Buy now - breakout board for VoCore to easy adapting your idea!

Follow us on Twitter or facebook!

pma61
 
Posts: 12
Joined: Fri Nov 21, 2014 6:19 pm

Re: SPI Flash partitions/U-boot corrupt?

Wed Jan 21, 2015 10:23 am

Vonger already solved my problem in wiki:
Note: if cp.linux size error, please call tftpboot then CTRL + C cancel, then cp.linux again, it should be ok.

:D

igaran
 
Posts: 8
Joined: Fri Feb 20, 2015 7:03 pm

Re: SPI Flash partitions/U-boot corrupt?

Fri Mar 06, 2015 8:10 pm

Vokore unpacked, plugged in, and does not work
Last edited by igaran on Sat Mar 07, 2015 8:28 am, edited 1 time in total.

igaran
 
Posts: 8
Joined: Fri Feb 20, 2015 7:03 pm

Re: SPI Flash partitions/U-boot corrupt?

Fri Mar 06, 2015 8:15 pm

I have a similar problem

Booting image at bc050000 .
Image Name: MIPS OpenWrt Linux-3.14.25
Created: 2014-12-04 9:37:17 UTC
Image Type: MIPS Linux Kernel Image (lzma compressed)
Data Size: 1056141 Bytes = 1 MB
Load Address: 80000000
Entry Point: 80000000
Load Kernel: .................

Verifying Checksum ... OK
Uncompressing Kernel Image ... OK

[ 0.000000] Linux version 3.14.25 (vonger@Vongers-MBP.lan) (gcc version 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.04 r43457) ) #5 Thu Dec 4 17:37:05 CST 2014
[ 0.000000] SoC Type: Ralink RT5350 id:1 rev:3
[ 0.000000] bootconsole [early0] enabled
[ 0.000000] CPU0 revision is: 0001964c (MIPS 24KEc)
[ 0.000000] MIPS: machine is VoCore
[ 0.000000] Determined physical RAM map:
[ 0.000000] memory: 02000000 @ 00000000 (usable)
[ 0.000000] Initrd not found or empty - disabling initrd
[ 0.000000] Zone ranges:
[ 0.000000] Normal [mem 0x00000000-0x01ffffff]
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x00000000-0x01ffffff]
[ 0.000000] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[ 0.000000] Primary data cache 16kB, 4-way, VIPT, no aliases, linesize 32 bytes
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 8128
[ 0.000000] Kernel command line: console=ttyS0,57600 rootfstype=squashfs,jffs2
[ 0.000000] PID hash table entries: 128 (order: -3, 512 bytes)
[ 0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.000000] Writing ErrCtl register=0007171a
[ 0.000000] Readback ErrCtl register=0007171a
[ 0.000000] Memory: 29148K/32768K available (2300K kernel code, 120K rwdata, 456K rodata, 188K init, 180K bss, 3620K reserved)
[ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] NR_IRQS:256
[ 0.000000] CPU Clock: 360MHz
[ 0.000000] systick: running - mult: 214748, shift: 32
[ 0.000000] genirq: Flags mismatch irq 7. 00014600 (timer) vs. 00014600 (systick)
[ 0.010000] Calibrating delay loop... 479.23 BogoMIPS (lpj=2396160)
[ 0.070000] pid_max: default: 32768 minimum: 301
[ 0.070000] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.080000] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.090000] pinctrl core: initialized pinctrl subsystem
[ 0.090000] NET: Registered protocol family 16
[ 0.120000] bio: create slab <bio-0> at 0
[ 0.120000] rt2880_gpio 10000600.gpio: registering 22 gpios
[ 0.130000] rt2880_gpio 10000600.gpio: registering 22 irq handlers
[ 0.130000] rt2880_gpio 10000660.gpio: registering 6 gpios
[ 0.140000] rt2880_gpio 10000660.gpio: registering 6 irq handlers
[ 0.150000] Switched to clocksource systick
[ 0.150000] NET: Registered protocol family 2
[ 0.170000] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.190000] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.190000] TCP: Hash tables configured (established 1024 bind 1024)
[ 0.210000] TCP: reno registered
[ 0.220000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.220000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.240000] NET: Registered protocol family 1
[ 0.250000] rt-timer 10000100.timer: maximum frequency is 7324Hz
[ 0.270000] futex hash table entries: 256 (order: -1, 3072 bytes)
[ 0.310000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 0.330000] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[ 0.360000] msgmni has been set to 56
[ 0.360000] io scheduler noop registered
[ 0.370000] io scheduler deadline registered (default)
[ 0.390000] gpio-export gpio-export.4: 17 gpio(s) exported
[ 0.410000] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[ 0.430000] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 20, base_baud = 2500000) is a 16550A
[ 0.450000] console [ttyS0] enabled
[ 0.450000] console [ttyS0] enabled
[ 0.460000] bootconsole [early0] disabled
[ 0.460000] bootconsole [early0] disabled
[ 0.490000] m25p80 spi32766.0: unrecognized JEDEC id ffffff
[ 0.510000] ralink_soc_eth 10100000.ethernet eth0: ralink at 0xb0100000, irq 5
[ 0.530000] rt3xxx-usbphy usbphy.3: loaded
[ 0.530000] rt2880_wdt 10000120.watchdog: Initialized
[ 0.550000] TCP: cubic registered
[ 0.550000] NET: Registered protocol family 17
[ 0.570000] 8021q: 802.1Q VLAN Support v1.8
[ 0.570000] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[ 0.600000] Please append a correct "root=" boot option; here are the available partitions:
[ 0.600000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[ 108.270000] random: nonblocking pool is initialized

Next
Return to VoCore & VoCore+Dock

Who is online

Users browsing this forum: Google [Bot] and 34 guests