A13-Olinuxino-WiFi - Flash NAND using ADB

Started by Swivelgames, February 02, 2013, 06:48:57 AM

Previous topic - Next topic

Swivelgames

Hey guys,

Using ADB, I was able to connect to my board and transfer the default a13 wifi image. However, I don't want to use the instructions from another tutorial for another device. Currently, I'm being told to do the following:

cat /sdcard/imagefile.img > /dev/block/nandd
sync; sync; sync
echo -n boot | busybox dd of=/dev/block/nandc count=1 conv=sync; sync


Can someone confirm these or let me know of a different way to flash the image on to the device?


Swivelgames

LiveSuit does not support my linux distro. At the same time, I enjoy using command line more, as I like to learn how to do things manually and see how it all works and fits together. I learn a lot more when using command line.

I'm using ADB right now, and I'm able to access the board and have full root access. Can someone please steer me in the right direction? I feel like I'm playing with fire, here, and I don't want to brick my board.

JohnS

The only safe way to do it is to use LiveSuit.  Anything else is at your own risk.

Swivelgames

JohnS, indeed. That is understood. It would be of help, however, if someone could point me in the right direction and help me make some educated guesses. Obviously, it's my device and I'm taking a risk of bricking it even if I use LiveSuit, as anyone is when flashing a device.

However, since my distro isn't supported, and my firmware seems to be faulty, I'd hope someone would be able to help me out in some way.

vinifr

Here is nand map memory:
--------fastboot partitions--------
-total partitions:9-
-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


You can to use sunxi-tools https://github.com/linux-sunxi/sunxi-tools, specifically nand-part and fel*

Swivelgames

#6
I'm having trouble building the tools. Any help would be appreciated.

I downloaded, made, and installed libusb-1.0.9 as well.

Ideas? (Please be patient with me, as I'm not the most experienced of all, but I'm learning).

swivel-mac:sunxi swivelgames$ make
gcc -g -O0 -Wall -Wextra -std=c99 -D_POSIX_C_SOURCE=200112L -Iinclude/ `pkg-config --cflags libusb-1.0`  -o fel fel.c  `pkg-config --libs libusb-1.0`
Package libusb-1.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libusb-1.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libusb-1.0' found
Package libusb-1.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libusb-1.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libusb-1.0' found
fel.c:21:20: error: libusb.h: No such file or directory
fel.c:49: error: expected ')' before '*' token
fel.c:63: error: expected ')' before '*' token
fel.c:77: error: expected ')' before '*' token
fel.c:88: error: expected ')' before '*' token
fel.c:95: error: expected ')' before '*' token
fel.c:102: error: expected ')' before '*' token
fel.c:121: error: expected ')' before '*' token
fel.c:131: error: expected ')' before '*' token
fel.c:137: error: expected ')' before '*' token
fel.c:164: error: expected ')' before '*' token
fel.c:171: error: expected ')' before '*' token
fel.c:178: error: expected ')' before '*' token
fel.c:250: error: expected ')' before '*' token
fel.c:257: error: expected ')' before '*' token
fel.c:263: error: expected ')' before '*' token
fel.c: In function 'main':
fel.c:273: error: 'libusb_device_handle' undeclared (first use in this function)
fel.c:273: error: (Each undeclared identifier is reported only once
fel.c:273: error: for each function it appears in.)
fel.c:273: error: 'handle' undeclared (first use in this function)
fel.c:274: warning: implicit declaration of function 'libusb_init'
fel.c:291: warning: implicit declaration of function 'libusb_open_device_with_vid_pid'
fel.c:296: warning: implicit declaration of function 'libusb_claim_interface'
fel.c:302: warning: implicit declaration of function 'aw_fel_hexdump'
fel.c:305: warning: implicit declaration of function 'aw_fel_dump'
fel.c:309: warning: implicit declaration of function 'aw_fel_execute'
fel.c:312: warning: implicit declaration of function 'aw_fel_get_version'
fel.c:317: warning: implicit declaration of function 'aw_fel_write'
fel.c:323: warning: implicit declaration of function 'aw_fel_read'
fel.c:328: warning: implicit declaration of function 'aw_fel_fill'



EDIT
DONE!
swivel-mac:sunxi swivelgames$ export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig"
swivel-mac:sunxi swivelgames$ make
gcc -g -O0 -Wall -Wextra -std=c99 -D_POSIX_C_SOURCE=200112L -Iinclude/ `pkg-config --cflags libusb-1.0`  -o fel fel.c  `pkg-config --libs libusb-1.0`
gcc -g -O0 -Wall -Wextra -std=c99 -D_POSIX_C_SOURCE=200112L -Iinclude/  -o pio pio.c
pio.c:313: warning: unused parameter 'argc'
gcc -g -O0 -Wall -Wextra -std=c99 -D_POSIX_C_SOURCE=200112L -Iinclude/  -o nand-part nand-part.c



Is there documentation for sunxi-tools like nand-part and fel?


Swivelgames

Alright, I was able to get `awflash` to work after over at cubieforums pointed me in the right direction. I'll attempt to flash it using that since, I've been told, it's basically the same as LiveSuit. Will update with the results.

The awutils package contains `awflash`.

So now that I have awflash, where do I flash "sun5i_android_a13-evb800x600_VGA_EN_SD.img" to? boot? misc? system?

vinifr

Hi,

Awesome! ;D  I do not know this tool.

Quote from: PeeJay on September 19, 2012, 10:19:53 AM
Boot = kernel + initramfs
System = Android system files + programs
Data = user data

juaneduardodelgado

Hey Swivelgames,

Did it work? were u able to program the android image using this?

Thanks.

Vinuthan

Hi,
How did you copy the A13 olinixino Wifi image from the NAND using ADB? Can you tell me how?
I also need to take a back up of it so..