A13 Mainline U-boot "Please RESET the board" problem

Started by satilla, December 03, 2018, 05:04:12 PM

Previous topic - Next topic

satilla

I have compiled mainline u-boot according to wiki page. These are rules which I followed;




# mkdir a13-olinuxino-kernel_3.4.90
# cd a13-olinuxino-kernel_3.4.90

2.2. Building mainline u-boot

Then let's download the uboot sources from GitHub repository
Note that the u-boot for A13-OLinuXino is tested with the next branch:

# git rev-parse --verify HEAD
1733259d25015c28c47990ec11af99b3f62f811c

Download u-boot sourses:
# git clone git://git.denx.de/u-boot.git
After the download you should have a new directory

#cd u-boot

Load the configuration file for A13-OLinuXino.

#make CROSS_COMPILE=arm-linux-gnueabihf- A13-OLinuXino_defconfig

you can configure some u-boot settings like DDR3 settings, clocks and other with:

#make menuconfig

It is recommended to choose:

[*]Enable workaround for booting old kernels

the board has stable behaviour with
[408] sunxi dram clock speed
[204] sunxi mbus clock speed

but you can choose other settings depending from your application

save it the settings and exit

build the u-boot

#make CROSS_COMPILE=arm-linux-gnueabihf-

When the build has completed, there will be u-boot-sunxi-with-spl.bin available in your u-boot tree.

Now you have to create a new boot.cmd file with the following contain

setenv bootm_boot_mode sec
setenv bootargs console=ttyS0,115200 root=/dev/mmcblk0p2 rootwait panic=10
load mmc 0:1 0x43000000 script.bin || load mmc 0:1 0x43000000 boot/script.bin
load mmc 0:1 0x42000000 uImage || load mmc 0:1 0x42000000 boot/uImage
bootm 0x42000000

convert boot.cmd in boot.scr with the next command

# mkimage -C none -A arm -T script -d boot.cmd boot.scr

The result should be a new boot.scr file that you have to copy to the first SD card partitition(where uImage and script.bin file are located)


4. Format and setup the SD-card
--------------------------------
We suggest 4GB class 10 micro sd-card but you can use any card between 2GB and 16GB.

First we have to make the correct card partitions, this is done with fdisk.

Plug SD card into your SD card reader and enter in the terminal

# ls /dev/sd
Then press two times <TAB> you will see a list of your sd devices like sda sdb sdc note that some of these devices may be your hard disk so make sure you know which one is your sd card before you proceed as you can damage your HDD if you choose the wrong sd-device. You can do this by unplugging your sd card reader and identify which "sd" devices remove from the list.

Once you know which device is your sdcard like sda use this text instead of the sdX name in the references below:

# fdisk /dev/sdX
then do these steps:

4.1. p
will list your partitions

if there are already partitions on your card do:

4.2. d enter 1
if you have more than one partitition press d while delete them all

4.3. create the first partition, starting from 2048
n enter p enter 1 enter enter +16M

4.4. create second partition
n enter p enter 2 enter enter enter

then list the created partitions:
p enter
if you did everything correctly on 4GB card you should see something like:

Disk /dev/sdg: 3980 MB, 3980394496 bytes
123 heads, 62 sectors/track, 1019 cylinders, total 7774208 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdg1            2048       34815       16384   83  Linux
/dev/sdg2           34816     7774207     3869696   83  Linux

4.7. w

write changes to sd card
now we have to format the file system on the card:

the first partition should be vfat as this is FS which the Allwinner bootloader understands

# mkfs.vfat /dev/sdX1
the second should be normal Linux EXT3 FS

# mkfs.ext3 /dev/sdX2

5. Write the Uboot and sunxi-spl.bin
-------------------------------------
You should be in /home/user/a13-olinuxino-kernel_3.4.90# directory
Note that you have to write u-boot-sunxi-with-spl.bin in /dev/sdX (not sdX1 or sdX2)

# dd if=u-boot-sunxi/u-boot-sunxi-with-spl.bin of=/dev/sdX bs=1024 seek=8

Note that if you use mainline u-boot then you have to copy the generated boot.scr file in the first sdcard partition. For example:

# mkdir /mnt/sd
# mount /dev/sdX1 /mnt/sd
# cp /u-boot/boot.scr /mnt/sd/


7. Write script.bin file
-------------------------
script.bin is a file with very important configuration parameters like port GPIO assignments, DDR memory parameters, Video resolution etc,
download the script.bin using wget command
# wget https://github.com/OLIMEX/OLINUXINO/raw/master/SOFTWARE/A13/A13-build/script.bin
# cp script.bin /mnt/sd
# sync
# umount /dev/sdX1



I have copied boot sector (0 to 2047) from olimex A13 image to new sd card and it starts u-boot without error. I think there is a problem with my u-boot compiling or config file...
I just want to use u-boot command prompt. What am I missing?