At91sam9x35 Buildroot configs

Discussion around AT91RM9200 and SAM9 Series Products.

Moderator: nferre

AleFachini
Posts: 5
Joined: Tue May 30, 2017 7:41 pm

At91sam9x35 Buildroot configs

Thu Oct 12, 2017 7:52 pm

Hello:
I am currently beginning with at91sam9x35ek. I've read and followed these documentations:

linux4sam/bin/view/Linux4SAM/BuildRootB ... nux_U_boot
linux4sam/bin/view/Linux4SAM/BuildRoot_9x5

Doing what was described in these documents i got on Ubuntu 16.04 LTS the following resulting files, I am using this buildroot tag; 2016.02-rc3:
buildroot/output/images$ ls
at91bootstrap.bin at91sam9x35ek.dtb rootfs.ubifs
at91sam9g15ek.dtb at91sam9x5ek-nandflashboot-uboot-3.8.bin u-boot.bin
at91sam9g25ek.dtb boot.bin zImage
at91sam9g35ek.dtb rootfs.tar
at91sam9x25ek.dtb rootfs.ubi
I have to flash the device with windows where my Ubuntu VM runs.
The flashing addresses aree found inside the script for flashing being:
  • 0x0 for atboostrap.bin
  • 0x40000 for u-boot.bin
  • 0x180000 for at91sam9x35ek.dtb
  • 0x200000 for zImage
  • 0x800000 for rootfs.ubi
This configuration won't boot KERNEL. System goes to u-boot> prompt and when i use:
bootz 0x22000000 - 0x21000000
Results in:
Wrong Ramdisk Image Format
Ramdisk image is corrupt or invalid


Now. i have this demo:
linux4sam-buildroot-at91sam9x5ek-4.2

This demo contains the following files(relevant):
at91sam9x5ek-nandflashboot-uboot-3.6.0.bin
at91sam9x35ek.dtb
u-boot-at91sam9x5ek_nandflash.bin
ubootEnvtFileNandFlash.bin
zImage-at91_dt
rootfs-at91sam9.ubi
I flash them with SAM-BA 2.12 on windows 10 at the following addresses:
  • 0x0 for at91sam9x5ek-nandflashboot-uboot-3.6.0.bin
  • 0x40000 for u-boot-at91sam9x5ek_nandflash.bin
  • 0xc0000 for ubootEnvtFileNandFlash.bin
  • 0x180000 for at91sam9x35ek.dtb
  • 0x200000 for zImage-at91_dt
  • 0x800000 for rootfs-at91sam9.ubi
THis configuraion and these files work up to buildroot login prompt without issues.

So i have a set of questions may be related to my inexperience:

1- In my Buildroots build on my Ubuntu enviroment, if the file at91bootstrap.bin is my ATbootstrap bootloader, what is the file at91sam9x5ek-nandflashboot-uboot-3.8.bin?

2- What is the file boot.bin?

3-Where is the file with the U_BOOT enviroment variables, in the compiled Buildroot results?????

4-I used "make at91sam9x5ek_defconfig", then "make". Does this means that the default configuration in these files are not working???

5- Where do i set for building the file with Uboot Environment Variables?

6- Do i need to apply patches to the newest Bootloader version?

7- How do i do to change UBI format to jffs2 for compiling? i know how to do it in buildroot's menuconfig, but environment variables still sets to UBI.


Thanks for your help and patience since I dont really know much about this.
blue_z
Location: USA
Posts: 1498
Joined: Thu Apr 19, 2007 10:15 pm

Re: At91sam9x35 Buildroot configs

Fri Oct 13, 2017 1:20 am

AleFachini wrote:I am using this buildroot tag; 2016.02-rc3
why use a rc (release candidate) version instead of the actual release?

AleFachini wrote:This configuration won't boot KERNEL. System goes to u-boot> prompt and when i use:
bootz 0x22000000 - 0x21000000
Results in:
Wrong Ramdisk Image Format
Ramdisk image is corrupt or invalid
Without the actual boot log, it is impossible to determine what is going on.
The error that you're reporting is inconsistent with the command you claim to have used.
Based on the sloppiness in this post (e.g. misspellings and typos) , I can only assume that the command that you claim to have used is not actually what you entered.

AleFachini wrote:1- In my Buildroots build on my Ubuntu enviroment, if the file at91bootstrap.bin is my ATbootstrap bootloader, what is the file at91sam9x5ek-nandflashboot-uboot-3.8.bin?
It's a copy of at91bootstrap.bin, with its full name indicating board, source, target, and version.

AleFachini wrote:2- What is the file boot.bin?
It's a copy of at91bootstrap.bin, renamed for use in VFAT booting schemes.
If you did a full directory listing (i.e. with file lengths) (and file compares for full verification), then the relationship of these duplicate files would not be so mysterious.

AleFachini wrote:3-Where is the file with the U_BOOT enviroment variables, in the compiled Buildroot results?????
There is no such file of U-Boot environment variables built by Buildroot or by the U-Boot make.

AleFachini wrote:4-I used "make at91sam9x5ek_defconfig", then "make". Does this means that the default configuration in these files are not working???
To be determined.

AleFachini wrote:5- Where do i set for building the file with Uboot Environment Variables?
Already answered in #3.

AleFachini wrote:6- Do i need to apply patches to the newest Bootloader version?
??

AleFachini wrote:7- How do i do to change UBI format to jffs2 for compiling? i know how to do it in buildroot's menuconfig, but environment variables still sets to UBI.
Your wording is nonsensical. UBI refers to a volume manager, while JFFS2 is a filesystem. UBI and UBIFS are preferred over JFFS2. IOW why do you want to go backwards?

Regards
AleFachini
Posts: 5
Joined: Tue May 30, 2017 7:41 pm

Re: At91sam9x35 Buildroot configs

Fri Oct 13, 2017 2:24 pm

Mister Blue:

Thank you very much for your reply, i apologize for my bad english.

To shed some light to some of your answers:

I used That tag because is the exact Tag of the linux4sam example and i was not shure if there was a problem with newer versions, It is not strange that this things happen. I also produced the build with TAG 2017.03 and the same results were obtanined.

In regard to the Boot Log:
RomBOOT


AT91Bootstrap 3.8.7 (lun oct 9 13:46:05 ART 2017)

1-Wire: Loading 1-Wire information ...
1-Wire: ROM Searching ... Done, 3 1-Wire chips found

1-Wire: BoardName | [Revid] | VendorName
#0 SAM9x5-EK [B0] FLEX
#1 SAM9X35-CM [B2] RONETIX
#2 SAM9x5-DM [B0] FLEX

1-Wire: Board sn: 0x4010466 revision: 0x10421

NAND: ONFI flash detected
NAND: ONFI para CRC error!
NAND: Manufacturer ID: 0xad Chip ID: 0xda
WARNING: Fail to disable On-Die ECC
Nand flash is not ONFI compliant, use 2-bit/512-byte ecc.
NAND: Initialize PMECC params, cap: 2, sector: 512
NAND: Image: Copy 0x80000 bytes from 0x40000 to 0x26f00000
NAND: Done to load image


U-Boot 2015.01-linux4sam_4.7-rc2 (Oct 12 2017 - 15:18:13)

CPU: AT91SAM9X35
Crystal frequency: 12 MHz
CPU clock : 400 MHz
Master clock : 133.333 MHz
DRAM: 128 MiB
WARNING: Caches not enabled
NAND: 256 MiB
MMC: mci: 0
*** Warning - bad CRC, using default environment

In: serial
Out: serial
Err: serial
Net: macb0
Error: macb0 address not set.

Hit any key to stop autoboot: 0

NAND read: device 0 offset 0x200000, size 0x300000
3145728 bytes read: OK
Wrong Image Format for bootm command
ERROR: can't get kernel image!
U-Boot >
Environment Variables print:
U-Boot> printenv
baudrate=115200
bootargs=console=ttyS0,115200 earlyprintk mtdparts=atmel_nand:256k(bootstrap)ro,
512k(uboot)ro,256k(env),256k(env_redundant),256k(spare),512k(dtb),6M(kernel)ro,-
(rootfs) rootfstype=ubifs ubi.mtd=7 root=ubi0:rootfs rw
bootcmd=nand read 0x22000000 0x200000 0x300000; bootm 0x22000000
bootdelay=3
ethact=macb0

Environment size: 333/131067 bytes
Immediately did bootz (because is zImage):
U-Boot> bootz 0x22000000 - 0x21000000
Kernel image @ 0x22000000 [ 0x000000 - 0x385ed8 ]
ERROR: Did not find a cmdline Flattened Device Tree
Could not find a valid device tree
U-Boot> bootz 0x22000000 0x21000000
Kernel image @ 0x22000000 [ 0x000000 - 0x385ed8 ]
Wrong Ramdisk Image Format
Ramdisk image is corrupt or invalid
U-Boot>
Notice the errors with and without "-" in the command, I understand that i'm new at U-Boot and everything, but whats the difference? Should i set manually my environment variables?.

Thank You In advance.
blue_z
Location: USA
Posts: 1498
Joined: Thu Apr 19, 2007 10:15 pm

Re: At91sam9x35 Buildroot configs

Sat Oct 14, 2017 2:25 am

AleFachini wrote:i apologize for my bad english.
Not a problem; I can deal with it, but if doesn't make sense I'll tell you.
What is a problem is when you incorrectly describe what you did and/or what happened.

AleFachini wrote:I used That tag because is the exact Tag of the linux4sam example and i was not shure if there was a problem with newer versions, It is not strange that this things happen.
There can always be a "problem" with any version. But the release version (once it is available) should always be preferable to a release candidate version.

AleFachini wrote:I also produced the build with TAG 2017.03 and the same results were obtanined.
Because apparently in U-Boot, the default environment variables for this board was unfortunately only partially updated to support Device Trees.

AleFachini wrote:Notice the errors with and without "-" in the command, ...
I am well aware of the different variations of that boot command, and that's the reason why I challenged you on your (bogus) description.

The error messages are entirely consistent.
Since only one image was loaded from NAND flash into main memory (i.e. `nand read ...`)), there is only the kernel image and no Device Tree blob nor an initrd image.
You tried two variations of the boot command that specified two memory addresses for two images, and each time U-Boot complained that the second address did not have a valid image (since it contained garbage values).

AleFachini wrote:... I understand that i'm new at U-Boot and everything, but whats the difference?
You need to read the documentation.
The description for the arguments to the bootm and bootz commands can be displayed at the U-Boot command line (i.e. `help bootz`), and at 5.9.4.2. bootm - boot application image from memory in the U-Boot document.

AleFachini wrote:Should i set manually my environment variables?
Yes, for testing, and then you can patch U-Boot source code.

Try correcting the U-Boot environment (at the command line) with:

Code: Select all

setenv bootcmd nand read 0x22000000 0x200000 0x500000\; nand read 0x21000000 0x180000 0x80000\; bootz 0x22000000 - 0x21000000
followed by a bootd command to test it.

Regards
AleFachini
Posts: 5
Joined: Tue May 30, 2017 7:41 pm

Re: At91sam9x35 Buildroot configs

Wed Oct 18, 2017 7:00 pm

Hello Again:
Sadly i went back in the problem. I decided to follow the instructions in linux4sam site, and recompile from sources all the binaries following "to the letter" the guide.

linux4sam/bin/view/Linux4SAM/AT91Bootstrap

https://www.at91.com/linux4sam/bin/view ... SAM/U-Boot
https://www.at91.com/linux4sam/bin/view ... delInUBoot

When i flash At91bootstrap.bin and then u-boot.bin at 0x40000 (using SAM-BA 2.12 windows), I get following console log:
AT91Bootstrap 3.8.7 (lun oct 9 13:46:05 ART 2017)

1-Wire: Loading 1-Wire information ...
1-Wire: ROM Searching ... Done, 3 1-Wire chips found

1-Wire: BoardName | [Revid] | VendorName
#0 SAM9x5-EK [B0] FLEX
#1 SAM9X35-CM [B2] RONETIX
#2 SAM9x5-DM [B0] FLEX

1-Wire: Board sn: 0x4010466 revision: 0x10421

NAND: ONFI flash detected
NAND: ONFI para CRC error!
NAND: Manufacturer ID: 0xad Chip ID: 0xda
WARNING: Fail to disable On-Die ECC
Nand flash is not ONFI compliant, use 2-bit/512-byte ecc.
NAND: Initialize PMECC params, cap: 2, sector: 512
NAND: Image: Copy 0x80000 bytes from 0x40000 to 0x26f00000
NAND: Done to load image
<debug_uart> No serial driver found
resetting ...
First: the AT91Bootstrap 3.8.7 (lun oct 9 13:46:05 ART 2017) is not correct since the compiled atboostrap binary is version 3.8.9 and it is compiled in later date.
Second: this <debug_uart> No serial driver found resetting ... is constantly looping. What should i do? I can't figure/find a u-boot guide for sam9x35ek. And it seems a configuration issue.

To clarify i will put below the commands entered:

1- make ARCH=arm at91sam9x5ek_nandflash_defconfig
2- make ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabi-

Shouldn't this at least boot into u-boot console?

Return to “SAM9 ARM9 MPU”

Who is online

Users browsing this forum: No registered users and 3 guests