Hey guys,

I learned the hard way never to buy a dev board without first looking at its resources to make sure they have adequate documentation and support.

All that aside, I was hoping someone would be able to help me flash the NAND on the board. There are a couple avenues that I have taken, but I've gotten stuck right before completion each time. I have an image to flash, and access to the board via my 32-bit Linux PC.

The board that I have is the Olimex A13-OLinuXino-WiFi.

Here's the different methods I've attempted:




Using ADB
This is what I'm most familiar with. The only place I'm stuck is finding out what block to flash the image to.

From what I've heard...

Code:
/dev/block/nanda     bootloader
/dev/block/nandc     boot
/dev/block/nandg     recovery


But, I have no clue if that applies to all A13's.

My assumption is to run the following code, but... that's what it is... an assumption. Anyone able to shed some light on this?

Code:
cat /sdcard/imagefile.img > /dev/block/nand<1?>
sync; sync; sync
echo -n boot | busybox dd of=/dev/block/nand<2?> count=1 conv=sync; sync





Using LiveSuit
LiveSuit is the toolset that AllWinner released for their A1X SoCs... the problem is it seems like they only have a Windows or 64-bit Linux version. Since I'm only on 32-bit Linux, I obviously can't compile it. I've searched everywhere for a 32-bit version




Using sunxi-tools
LiveSuit utilizes sunxi-tools to flash the board. However... I can't for the life of me find any documentation surrounding it or any type of process around how to flash the board. It's all a mystery. There are two tools that I have been told to look at: nand-part and fel*. nand-part is a tool to manage the NAND partitions, while fel is a tool for writing directly to the NAND (specifying blocks, start and size).

NAND Map Memory

Code:
-name-        -start-       -size-     
bootloader  : 100000        1000000     
env         : 1100000       200000     
boot        : 1300000       2000000     
system      : 3300000       10000000   
data        : 13300000      20000000   
misc        : 33300000      100000     
recovery    : 33400000      2000000     
cache       : 35400000      10000000   
UDISK       : 45400000      a8400000


Is it a safe assumption that these correspond with the blocks in /dev/block/?

As in, /dev/block/nanda = bootloader, /dev/block/nadab = env?





Using awutil
A new one! AllWinner Utilities has a tool called `awflash` which is supposed to be comparable to LiveSuit and flashes using the same method. The only problem is I can't get it to compile.


Code:
swivel-mac:awflash swivelgames$ make -k awflash
cc -I/Developer/Platforms/.de650d.245/.de650d.244/SDKs/iPhoneSimulator4.1.sdk/usr/include/pcap/ -L/usr/local/lib -Wall -o awflash awflash.c -lusb
awflash.c:67: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
awflash.c:114: warning: ‘struct usb_dev_handle’ declared inside parameter list
awflash.c:114: warning: its scope is only this definition or declaration, which is probably not what you want
awflash.c: In function ‘fex_xfer’:
awflash.c:137: warning: implicit declaration of function ‘usb_bulk_write’
awflash.c:144: warning: implicit declaration of function ‘usb_bulk_read’
awflash.c: At top level:
awflash.c:172: warning: ‘struct usb_dev_handle’ declared inside parameter list
awflash.c: In function ‘fex_command’:
awflash.c:174: warning: passing argument 1 of ‘fex_xfer’ from incompatible pointer type
awflash.c:182: warning: passing argument 1 of ‘fex_xfer’ from incompatible pointer type
awflash.c:199: warning: passing argument 1 of ‘fex_xfer’ from incompatible pointer type
awflash.c:209: warning: passing argument 1 of ‘fex_xfer’ from incompatible pointer type
awflash.c:221: warning: passing argument 1 of ‘fex_xfer’ from incompatible pointer type
awflash.c:230: warning: passing argument 1 of ‘fex_xfer’ from incompatible pointer type
awflash.c:240: warning: passing argument 1 of ‘fex_xfer’ from incompatible pointer type
awflash.c:245: warning: passing argument 1 of ‘fex_xfer’ from incompatible pointer type
awflash.c:257: warning: passing argument 1 of ‘fex_xfer’ from incompatible pointer type
awflash.c:274: warning: passing argument 1 of ‘fex_xfer’ from incompatible pointer type
awflash.c:280: warning: passing argument 1 of ‘fex_xfer’ from incompatible pointer type
awflash.c:296: warning: passing argument 1 of ‘fex_xfer’ from incompatible pointer type
awflash.c: In function ‘main’:
awflash.c:358: warning: implicit declaration of function ‘usb_init’
awflash.c:360: warning: implicit declaration of function ‘usb_set_debug’
awflash.c:362: warning: implicit declaration of function ‘locate_device’
awflash.c:362: warning: assignment makes pointer from integer without a cast
awflash.c:367: warning: implicit declaration of function ‘usb_set_configuration’
awflash.c:371: warning: implicit declaration of function ‘usb_claim_interface’
awflash.c:375: warning: implicit declaration of function ‘usb_set_altinterface’
awflash.c:417: warning: passing argument 1 of ‘fex_xfer’ from incompatible pointer type
awflash.c:420: warning: passing argument 1 of ‘fex_xfer’ from incompatible pointer type
awflash.c:423: warning: passing argument 1 of ‘fex_xfer’ from incompatible pointer type
make: *** [awflash] Error 1


Anyone able to help me out with any of these methods? You would think with four options there would be SOME sort of resource or documentation out there to help me out. But, you know...

Any help would be appreciated!
I finally got `awflash` to compile! Turned out none of my usb libs had usb_dev_handle in them. I had to use MacPorts to install libusb-legacy and that worked perfectly. After wrestling with the makefile a little bit to force it to see the library (lol) it finally built.

Hopefully I'll have more luck with `awflash` then I did with the other methods. Anyone have any insight in to this? If anyone has (or can find) any resources or documentation surrounding awflash, that'd be a huge help.
How many partitions do you have on the board? You asked on IRC about the partitions, and I see you wrote this:

'As in, /dev/block/nanda = bootloader, /dev/block/nadab = env? "


Code:
/dev/block/nanda     bootloader
/dev/block/nandc     boot
/dev/block/nandg     recovery


Here I have annotated this table with likely mappings:


Code:
-name-        -start-       -size-     
bootloader  : 100000        1000000      nanda
env         : 1100000       200000      nandb
boot        : 1300000       2000000      nandc
system      : 3300000       10000000    nandd
data        : 13300000      20000000    nande
misc        : 33300000      100000      nandf
recovery    : 33400000      2000000      nandg
cache       : 35400000      10000000    nandh
UDISK       : 45400000      a8400000    nandi

Notice that the nandX's in order match the three you listed. It is highly probably that the partitions are lettered in physical layout order.
That's what I came to assume. The million dollar question is: What partition am I flashing? No one seems to be able to answer that question :S

fel from sunxi-tools has the following syntax:

Code:
swivel-mac:sunxi swivelgames$ ./fel
Usage: ./fel command arguments... [command...]
   hex[dump] address length   Dumps memory region in hex
   dump address length      Binary memory dump
   exe[cute] address      Call function address
   read address length file   Write memory contents into file
   write address file      Store file contents into memory
   ver[sion]         Show BROM version
   clear address length      Clear memory
   fill address length value   Fill memory


awflash from awutils has the following syntax:

Code:
swivel-mac:awflash swivelgames$ ./awflash
usage: ./awflash [-B] [-r size] offset file


Obviously, I plug in the offset from the given partition (and in `fel`s case, the size of either the partition or the image as well). But... I have no clue which partition to flash. Unless I'm missing the boat all together and I really have no clue what I'm talking about when I say 'flash' (which don't think anyone including myself would rule our for a second).


Edit ftr

Code:
root@android:/dev/block # ls -la
brw------- root     root       7,   0 1970-01-01 08:00 loop0
brw------- root     root       7,   1 1970-01-01 08:00 loop1
brw------- root     root       7,   2 1970-01-01 08:00 loop2
brw------- root     root       7,   3 1970-01-01 08:00 loop3
brw------- root     root       7,   4 1970-01-01 08:00 loop4
brw------- root     root       7,   5 1970-01-01 08:00 loop5
brw------- root     root       7,   6 1970-01-01 08:00 loop6
brw------- root     root       7,   7 1970-01-01 08:00 loop7
brw------- root     root      93,   0 1970-01-01 08:00 nanda
brw------- root     root      93,   8 1970-01-01 08:00 nandb
brw------- root     root      93,  16 1970-01-01 08:00 nandc
brw------- root     root      93,  24 1970-01-01 08:00 nandd
brw------- root     root      93,  32 1970-01-01 08:00 nande
brw-rw-rw- system   system    93,  40 1970-01-01 08:00 nandf
brw------- root     root      93,  48 1970-01-01 08:00 nandg
brw------- root     root      93,  56 1970-01-01 08:00 nandh
brw------- root     root      93,  64 1970-01-01 08:00 nandi
brw------- root     root       1,   0 1970-01-01 08:00 ram0
brw------- root     root       1,   1 1970-01-01 08:00 ram1
drwxr-xr-x root     root              1970-01-01 08:00 vold


edit 2
ftr

Code:
root@android:/ # cat /proc/partitions                                         
major minor  #blocks  name

  93        0      16384 nanda
  93        8       2048 nandb
  93       16      32768 nandc
  93       24     262144 nandd
  93       32     524288 nande
  93       40       1024 nandf
  93       48      32768 nandg
  93       56     262144 nandh
  93       64    2756608 nandi
Trying to also figure out why it's not booting in the first place. Figured I'd paste this stuff in here, ftr.

$ dmesg > dmesg.txt
$ logcat -d > logcat.txt
$ cat /proc/cpuinfo > cpuinfo.txt
$ getprop > prop.txt

Image to Flash: sun5i_android_a13-evb800x600_VGA_EN_SD.img

[edit]
Looks like this is where it is failing to boot:
Code:
D/dalvikvm(  151): GC_CONCURRENT freed 542K, 9% free 5970K/6535K, paused 2ms+2ms
D/dalvikvm(  151): GC_CONCURRENT freed 428K, 9% free 6034K/6599K, paused 2ms+3ms
E/System  (  151): ******************************************
E/System  (  151): ************ Failure starting core service
E/System  (  151): java.lang.ArrayIndexOutOfBoundsException: src.length=8192 srcPos=1 dst.length=8192 dstPos=0 length=-1
E/System  (  151):    at java.lang.System.arraycopy(Native Method)
E/System  (  151):    at org.kxml2.io.KXmlParser.fillBuffer(KXmlParser.java:1489)
E/System  (  151):    at org.kxml2.io.KXmlParser.skip(KXmlParser.java:1574)
E/System  (  151):    at org.kxml2.io.KXmlParser.parseStartTag(KXmlParser.java:1049)
E/System  (  151):    at org.kxml2.io.KXmlParser.next(KXmlParser.java:369)
E/System  (  151):    at org.kxml2.io.KXmlParser.next(KXmlParser.java:310)
E/System  (  151):    at com.android.server.pm.Settings.readGrantedPermissionsLPw(Settings.java:1844)
E/System  (  151):    at com.android.server.pm.Settings.readSharedUserLPw(Settings.java:1826)
E/System  (  151):    at com.android.server.pm.Settings.readLPw(Settings.java:1263)
E/System  (  151):    at com.android.server.pm.PackageManagerService.<init>(PackageManagerService.java:927)
E/System  (  151):    at com.android.server.pm.PackageManagerService.main(PackageManagerService.java:833)
E/System  (  151):    at com.android.server.ServerThread.run(SystemServer.java:166)
I/SystemServer(  151): Input Method Service
F/SystemServer(  151): BOOT FAILURE starting Input Manager Service
F/SystemServer(  151): java.lang.NullPointerException
F/SystemServer(  151):    at android.app.PendingIntent.getBroadcast(PendingIntent.java:293)
F/SystemServer(  151):    at com.android.server.InputMethodManagerService.<init>(InputMethodManagerService.java:548)
F/SystemServer(  151):    at com.android.server.ServerThread.run(SystemServer.java:281)
W/SystemServer(  151): ***********************************************
E/AndroidRuntime(  151): Error reporting WTF
E/AndroidRuntime(  151): java.lang.NullPointerException
E/AndroidRuntime(  151):    at com.android.internal.os.RuntimeInit.wtf(RuntimeInit.java:345)
E/AndroidRuntime(  151):    at android.util.Log$1.onTerribleFailure(Log.java:103)
E/AndroidRuntime(  151):    at android.util.Log.wtf(Log.java:278)
E/AndroidRuntime(  151):    at com.android.server.ServerThread.reportWtf(SystemServer.java:75)
E/AndroidRuntime(  151):    at com.android.server.ServerThread.run(SystemServer.java:284)
I/SystemServer(  151): Accessibility Manager
F/SystemServer(  151): BOOT FAILURE starting Accessibility Manager
F/SystemServer(  151): java.lang.NullPointerException
F/SystemServer(  151):    at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1072)
F/SystemServer(  151):    at android.app.ContextImpl.registerReceiver(ContextImpl.java:1047)
F/SystemServer(  151):    at android.app.ContextImpl.registerReceiver(ContextImpl.java:1041)
F/SystemServer(  151):    at com.android.internal.content.PackageMonitor.register(PackageMonitor.java:65)
F/SystemServer(  151):    at com.android.server.accessibility.AccessibilityManagerService.registerPackageChangeAndBootCompletedBroadcastReceiver(AccessibilityManagerService.java:278)
F/SystemServer(  151):    at com.android.server.accessibility.AccessibilityManagerService.<init>(AccessibilityManagerService.java:172)
F/SystemServer(  151):    at com.android.server.ServerThread.run(SystemServer.java:289)
F/SystemServer(  151): BOOT FAILURE making display ready
F/SystemServer(  151): java.lang.NullPointerException
F/SystemServer(  151):    at com.android.server.ServerThread.run(SystemServer.java:297)
W/SystemServer(  151): ***********************************************
E/AndroidRuntime(  151): Error reporting WTF
E/AndroidRuntime(  151): java.lang.NullPointerException
E/AndroidRuntime(  151):    at com.android.internal.os.RuntimeInit.wtf(RuntimeInit.java:345)
E/AndroidRuntime(  151):    at android.util.Log$1.onTerribleFailure(Log.java:103)
E/AndroidRuntime(  151):    at android.util.Log.wtf(Log.java:278)
E/AndroidRuntime(  151):    at com.android.server.ServerThread.reportWtf(SystemServer.java:75)
E/AndroidRuntime(  151):    at com.android.server.ServerThread.run(SystemServer.java:292)
W/SystemServer(  151): ***********************************************
F/SystemServer(  151): BOOT FAILURE performing boot dexopt
F/SystemServer(  151): java.lang.NullPointerException
F/SystemServer(  151):    at com.android.server.ServerThread.run(SystemServer.java:303)
E/AndroidRuntime(  151): Error reporting WTF
E/AndroidRuntime(  151): java.lang.NullPointerException
E/AndroidRuntime(  151):    at com.android.internal.os.RuntimeInit.wtf(RuntimeInit.java:345)
E/AndroidRuntime(  151):    at android.util.Log$1.onTerribleFailure(Log.java:103)
E/AndroidRuntime(  151):    at android.util.Log.wtf(Log.java:278)
E/AndroidRuntime(  151):    at com.android.server.ServerThread.reportWtf(SystemServer.java:75)
E/AndroidRuntime(  151):    at com.android.server.ServerThread.run(SystemServer.java:299)
W/SystemServer(  151): ***********************************************
E/AndroidRuntime(  151): Error reporting WTF
E/AndroidRuntime(  151): java.lang.NullPointerException
E/AndroidRuntime(  151):    at com.android.internal.os.RuntimeInit.wtf(RuntimeInit.java:345)
E/AndroidRuntime(  151):    at android.util.Log$1.onTerribleFailure(Log.java:103)
E/AndroidRuntime(  151):    at android.util.Log.wtf(Log.java:278)
E/AndroidRuntime(  151):    at com.android.server.ServerThread.reportWtf(SystemServer.java:75)
E/AndroidRuntime(  151):    at com.android.server.ServerThread.run(SystemServer.java:305)
W/dalvikvm(  151): threadid=11: thread exiting with uncaught exception (group=0x409e41f8)
I/Process (  151): Sending signal. PID: 151 SIG: 9
E/AndroidRuntime(  151): *** FATAL EXCEPTION IN SYSTEM PROCESS: android.server.ServerThread
E/AndroidRuntime(  151): java.lang.NullPointerException
E/AndroidRuntime(  151):    at com.android.server.ServerThread.run(SystemServer.java:309)
E/AndroidRuntime(  151): Error reporting crash
E/AndroidRuntime(  151): java.lang.NullPointerException
E/AndroidRuntime(  151):    at com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException(RuntimeInit.java:72)
E/AndroidRuntime(  151):    at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:693)
E/AndroidRuntime(  151):    at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690)
I/ServiceManager(   77): service 'entropy' died
I/ServiceManager(   77): service 'telephony.registry' died
I/ServiceManager(   77): service 'power' died
I/ServiceManager(   77): service 'sensorservice' died
I/ServiceManager(   77): service 'usagestats' died
I/ServiceManager(   77): service 'batteryinfo' died
I/Zygote  (   82): Exit zygote because system server (151) has terminated
I/ServiceManager(   77): service 'media.audio_flinger' died
I/ServiceManager(   77): service 'media.player' died
I/ServiceManager(   77): service 'media.camera' died
I/ServiceManager(   77): service 'media.audio_policy' died
E/gralloc (   81): FBIO_WAITFORVSYNC failed
Not sure what that means for me, though, except that I need to flash it. I have someone who is attempting to help me out, but he's using a different board (same soc)... not helping too much, though, seeing as he's flashing the SD and not the NAND :S

Does no one know how to flash that image to NAND without LiveSuit? >.>
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement