RomBoot Freezing at "Resetting CPU" for Sama5d3 Xplained

Moderator: nferre

Bader97
Posts: 9
Joined: Tue Oct 30, 2018 3:02 pm

RomBoot Freezing at "Resetting CPU" for Sama5d3 Xplained

Tue Dec 04, 2018 3:07 pm

Hi,

I have finally received my TTL cable, and can now view the Bootlog for my Sama5d3 Xplained.
What I have done:
1) Ran the demo retrieved from ftp://ftp.linux4sam.org/pub/demo/linux4sam_5.8/
by placing the files in the same directory as sam-ba and then executing the command "./demo_linux_nandflash.sh" which is successful and the board boots normally.
2) I built and Image and dtbs for the board by doing the following:
cd linux-at91
export CROSS_COMPILE=arm-linux-gnueabi-
export ARCH=arm
make sama5_defconfig
make

The resulting binaries used are: ~/linux-at91/arch/arm/boot/zImage
and ~/linux-at91/arch/arm/boot/dts/at91-sama5d3_xplained.dtb

Then I went back to the sam-ba directory, where I ran the command:
./sam-ba -p serial -b sama5d3-xplained -a nandflash -c erase:0x180000:0x400000 -c write:at91-sama5d3_xplained.dtb:0x180000 -c write:zImage:0x200000

Upon download of these two binaries, I then hit the Reset button (BP2) and the following Bootlog is the output:
AT91Bootstrap 3.8.10 (Wed Mar 28 19:46:50 CEST 2018)

NAND: ONFI flash detected
NAND: Manufacturer ID: 0x2c Chip ID: 0xda
NAND: Page Bytes: 2048, Spare Bytes: 64
NAND: ECC Correctability Bits: 4, ECC Sector Bytes: 512
NAND: Disable On-Die ECC
NAND: Initialize PMECC params, cap: 4, sector: 512
NAND: Image: Copy 0xa0000 bytes from 0x40000 to 0x26f00000
NAND: Done to load image
<debug_uart>

U-Boot 2017.03-linux4sam_5.8 (Mar 28 2018 - 19:46:54 +0200)

CPU: SAMA5D36
Crystal frequency: 12 MHz
CPU clock : 528 MHz
Master clock : 132 MHz
DRAM: 256 MiB
NAND: 256 MiB
MMC: Atmel mci: 0, Atmel mci: 1
In: serial@ffffee00
Out: serial@ffffee00
Err: serial@ffffee00
Net:
Error: ethernet@f0028000 address not set.
No ethernet found.
Hit any key to stop autoboot: 0

NAND read: device 0 offset 0x180000, size 0x87c2
34754 bytes read: OK

NAND read: device 0 offset 0x200000, size 0x375ea0
3628704 bytes read: OK
## Flattened Device Tree blob at 21000000
Booting using the fdt blob at 0x21000000
Loading Device Tree to 2fb1e000, end 2fb2d334 ... OK

Starting kernel ...

data abort
pc : [<24a89d38>] lr : [<00000014>]
reloc pc : [<41089d38>] lr : [<1c600014>]
sp : 24e44328 ip : 00000020 fp : 24e4331c
r10: 24a88b81 r9 : 24a894dc r8 : 24e44340
r7 : 24e54340 r6 : 00000000 r5 : 00000000 r4 : 24e432f4
r3 : 811ed6c1 r2 : 00000000 r1 : 00003ae8 r0 : 00000024
Flags: nZCv IRQs off FIQs off Mode SVC_32
Resetting CPU ...

I hope I have provided adequate information, and please let me know if there's any further information to provide.
Thank you for you help.
Regards.
blue_z
Location: USA
Posts: 1784
Joined: Thu Apr 19, 2007 10:15 pm

Re: RomBoot Freezing at "Resetting CPU" for Sama5d3 Xplained

Wed Dec 05, 2018 1:05 am

Bader97 wrote: I hope I have provided adequate information ...
Actually you have not, but there is just enough information that indicates two possible sources that could cause a boot failure.
However your title is bogus, and does not reflect the problem you are encountering.
Where is this "RomBoot" [sic] in your boot log?
There's clearly a data abort exception that is reported in the log, yet you ignore that and call it "Freezing at "Resetting CPU""?
The first salient step in problem solving is to properly describe and identify the problem.

Bader97 wrote: The resulting binaries used are: ~/linux-at91/arch/arm/boot/zImage
and ~/linux-at91/arch/arm/boot/dts/at91-sama5d3_xplained.dtb
You need to report the actual sizes of these two files.

Bader97 wrote: Then I went back to the sam-ba directory, where I ran the command:
./sam-ba -p serial -b sama5d3-xplained -a nandflash -c erase:0x180000:0x400000 -c write:at91-sama5d3_xplained.dtb:0x180000 -c write:zImage:0x200000
(You need to learn how to use the quote and code tags to properly format your post.)
This is the first point where boot failure could have been induced.
You only specified that NAND flash should be erased for 0x400000 bytes starting at offset 0x180000.
Assuming that aligns with an erase block, that erase operation only allocates NAND area 0x00200000 to 0x580000 for the kernel image.
If your zImage file is larger than 0x380000 bytes, then the complete image may not be properly stored in NAND.

Bader97 wrote: Upon download of these two binaries, I then hit the Reset button (BP2) and the following Bootlog is the output:
AT91Bootstrap 3.8.10 (Wed Mar 28 19:46:50 CEST 2018)
...
U-Boot 2017.03-linux4sam_5.8 (Mar 28 2018 - 19:46:54 +0200)

NAND read: device 0 offset 0x180000, size 0x87c2
34754 bytes read: OK

NAND read: device 0 offset 0x200000, size 0x375ea0
3628704 bytes read: OK
A report of the U-Boot environment would be ideal, since that is the second point where boot failure can be induced.
So I'll assume that you're blindly using the existing U-Boot environment of Linux4SAM_5.8, which has :
bootcmd=nand read 0x21000000 0x00180000 0x87c2; nand read 0x22000000 0x00200000 0x375ea0; bootz 0x22000000 - 0x21000000
This bootcmd has a nasty customization of specifying the exact sizes of the .dtb and zImage files read from the NAND flash into memory.
If your replacement files that you built are larger than the demo files, then this bootcmd will not properly load them.

A data abort exception is the likely outcome of trying to execute a truncated zImage.
Of course there are other possible causes for a data abort, but these two obvious issues need to be resolved first.

Regards
Bader97
Posts: 9
Joined: Tue Oct 30, 2018 3:02 pm

Re: RomBoot Freezing at "Resetting CPU" for Sama5d3 Xplained

Wed Dec 05, 2018 3:20 pm

Hey blue_z,

Thank you for your reply, and I apologize for my sloppiness but I am not too experienced with community discussions. Your U-boot Environment comment is remarkable; it helped me understand a lot more about how this board works.

Since then, I have reboot the board, stopped the autoboot (by pressing any button), changed the U-boot Environment by doing
"editenv bootcmd" and then changed
this: "bootcmd=nand read 0x21000000 0x00180000 0x87c2; nand read 0x22000000 0x00200000 0x375ea0; bootz 0x22000000 - 0x21000000"
to this: "bootcmd=nand read 0x21000000 0x00180000 0x87c2; nand read 0x22000000 0x00200000 0x3b9fe0; bootz 0x22000000 - 0x21000000" since the size of the zImage I am using is 3,907,552 bytes.
after that I used "saveenv" to save these settings and then i did a "boot" command.

One thing I noticed is that I cannot seem to change the first line of the "bootcmd" environment. I am not sure why that is, so I did not change the .dtb file and only changed the kernel image.

Nevertheless, the bootloader did not abort, and using the command "uname -a" gave me the updated kernel image time, which is exactly what I've been trying to achieve.

Again I would like to thank you for your help, and to apologize for my formatting.

Return to “SAMA5-based”

Who is online

Users browsing this forum: No registered users and 2 guests