Hi,
there is no method described in the manual. I guess many (most?) people interested in an open
hardware development device are using linux.
I hope there are any tools available and the documentation can be extended.
Thanks
Steffen
Hi,
there is no method described in the manual. I guess many (most?) people interested in an open
hardware development device are using linux.
I hope there are any tools available and the documentation can be extended.
Thanks
Steffen
Remember that the RIoT board is targeted specifically for Android development, not mainline linux.
It's also not a truly open hardware design as the actual CAD files are not provided. There are Gerbers available now which allow you to produce an exact copy, but the Mentor/KiCad/Eagle/whatever source files are not available so you can't easily modify it.
There are better choices if you want an open hardware board, for eaxmple the Olimex OLinuXino boards.
However, the user manual has section 5 on how to build linux kernel images and you'll find a linux download on this page RIoTboard
Thanks for the reply. You are right - it's maybe not that open.
I have seen the linux image. My problem is, that i don't see a way to upload it to the riotboards eMMc. The mfg tool is not
running on my linux desktop.
I don't have a board, but can't you just write it to an SD card and boot from that ? Assuming the sizes work out it's probably possible to just dd the image to the eMMC afterwards.
There's no real requirement for the mfgtools, but if you're stuck on doing it that way, you can try https://github.com/boundarydevices/imx_usb_loader which is what's used for other i.MX6 boards. I've used it successfully on sabre-lite
AFAIK you can only boot Linux from the internal eMMC — not from the external.
James Carruthers wrote:
AFAIK you can only boot Linux from the internal eMMC — not from the external.
Where did you get that information ?
The user manual says otherwise (and other i.MX6 systems can boot from varying places)
So once you set the boot switches to SD you can boot whatever you like from SD.
<html><head><title>Jive SBS</title></head>
<body><font face="arial,helvetica,sans-serif">
<b>Error</b><br><font size="-1">
An general error occurred while processing your request.
</font></font></body></html>
It's on Page 44 of the UM that it mentions that Linux currently only boots from eMMC. Though maybe that means eventually it'll have an SD option. As you stated, the chip can boot from either interface, so it seems to be a software configuration thing for Linux.
anthony_h wrote:
It's on Page 44 of the UM that it mentions that Linux currently only boots from eMMC.
Unfortunately that's so vague as to be pointless.. From a Linux point of view eMMC and SD are identical as they use the same driver. If u-boot can load android from eMMC there's no reason to believe it can't load Linux - since android is based on a linux kernel.
The wording seems strange too "Currently the Linux system on the RIoTboard supports only booting from the eMMC" but as we all know it arrives with Android installed, so 'currently' there is no linux on the board... If there was, it wouldn't be an issue
I'm wondering if what it really means is that the ancient 3.0.35 based image from the download page is brain-damaged enough that it's incapable of doing so. In a different thread there's a devicetree file for the 3.13 kernel which should effectively remove any kernel based obstacles. The only remaining problem would be if u-boot or the ubuntu image have hard-coded something and any of those should be fixable.
It's a pity there's no SPI rom like the Sabre-Lite. A decent version of u-boot in SPI essentially makes it possible to easily boot from anywhere.
anthony_h wrote:
It's on Page 44 of the UM that it mentions that Linux currently only boots from eMMC.
My board arrived at the weekend, so I can now refute the claim made in the UM for certain. Exactly what the manual is referring to in that section on p44 isn't clear, what is clear is that it's either misleading or just plain wrong.
I setup a uSD card today with mainline u-boot (0b2da7e209f4110b7c81d578336a10330e4a4404 from 28th March with the patches mentioned here http://www.element14.com/community/thread/32560/l/mainline-u-boot ) and a 3.14 kernel with madewish patches from http://www.element14.com/community/thread/31675?start=16&tstart=0 and have it booting directly from uSD without problem.
The user manual is also particularly unhelpful, Table 4-3 on page 46 shows "Boot Switch Configuration - SD", technically correct but useless information... The SoC has four SD interfaces, the table shows the config to boot from the full-size SD slot at J6 on the underside of the board. To boot from the uSD (J7 on the top of the board) you have to set D7 On, D8 Off. You'll want to grab IMX6SDLRM from Documentation to work out exactly what the switches do. Start with Chapter 8..
I tried the same way, using the mainstream git sources of u-boot, added the riot patches and uploaded with the MfgTool2.exe. But I'm getting no u-boot message on the serial debug console like with the original version. Do I have to use the u-boot.bin or u-boot.imx file?
git clone git://git.denx.e/u-boot.git
<apply patch>
make riotboard_config
CROSS_COMPILE=armv7a-hardfloat-linux-gnueabi- make
<install u-boot.bin with MfgTool2.exe>
Could you post or upload your corresponding file?
You want u-boot.imx. I didn't try to upload it using the tool, I just wrote it to a uSD card and then set the switches appropriately
<html><head><title>Jive SBS</title></head>
<body><font face="arial,helvetica,sans-serif">
<b>Error</b><br><font size="-1">
An general error occurred while processing your request.
</font></font></body></html>
<html><head><title>Jive SBS</title></head>
<body><font face="arial,helvetica,sans-serif">
<b>Error</b><br><font size="-1">
An general error occurred while processing your request.
</font></font></body></html>
the card should have the first partition start at sector 2048, not sector 63.
You then write u-boot.imx to the card starting at 1K with a command something like
dd if=u-boot.imx of=/dev/sdX bs=1024 seek=1
The attached version will look for a file called /bootscript in the first partition.. unfortunately my only copy of that file is on the uSD card that's currently at home, I'll post a copy of it later today. Even without this, you should still get the u-boot console on the serial port.
However if you have the switches set incorrectly you get nothing.
u-boot.imx.zip |
I think the attachment is ok u-boot.imx has 326656 bytes, here is the situation:
I think the attachment is ok u-boot.imx has 326656 bytes, here is the situation:
Hmm... like I said, I don't have the board here, so it's difficult to check switch settings. I'll do so later this afternoon and let you know.
file size looks correct, and the exact command I used to write it from the history was dd if=u-boot.imx of=/dev/sdb bs=1024 seek=1 using a usb SD adapter.
Unfortunately uploads here seem to be limited to 50MB, but maybe we just need to find a way to get you a straight copy of my uSD image to try.
I found this log in my terminals history showing what you should see, you should at least get the u-boot part with probably an error about missing /bootscript
U-Boot 2014.04-rc2-00094-g7d72f06-dirty (Mar 30 2014 - 18:20:25)
CPU: Freescale i.MX6SOLO rev1.1 at 792 MHz
Reset cause: POR
Board: RIoTboard
I2C: ready
DRAM: 1 GiB
MMC: FSL_SDHC: 0, FSL_SDHC: 1, FSL_SDHC: 2
No panel detected: default to HDMI
Display: HDMI (1024x768)
In: serial
Out: serial
Err: serial
Net: FEC [PRIME]
Warning: Your board does not use generic board. Please read
doc/README.generic-board and take action. Boards not
upgraded by the late 2014 may break or be removed.
Hit any key to stop autoboot: 0
start
MMC: no card present
mmc0(part 0) is current device
load..
MMC: no card present
** Bad device mmc 0 **
mmc1 is current device
load..
473 bytes read in 29 ms (15.6 KiB/s)
import...
executing
2836792 bytes read in 192 ms (14.1 MiB/s)
kernel_loaded
33044 bytes read in 76 ms (423.8 KiB/s)
fdt_loaded
Kernel image @ 0x12000000 [ 0x000000 - 0x2b4938 ]
## Flattened Device Tree blob at 11000000
Booting using the fdt blob at 0x11000000
Using Device Tree in place at 11000000, end 1100b113
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 3.14.0-imx (root@sl1) (gcc version 4.8.2 (GCC) ) #9 SMP Tue Apr 1 14:04:31 UTC 2014
[ 0.000000] CPU: ARMv7 Processor [412fc09a] revision 10 (ARMv7), cr=10c5387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] Machine model: RIoTboard i.MX6SDL
[ 0.000000] cma: CMA: reserved 16 MiB at 3e800000
[ 0.000000] Memory policy: Data cache writeback
[ 0.000000] CPU: All CPU(s) started in SVC mode.
[ 0.000000] PERCPU: Embedded 8 pages/cpu @edfce000 s8320 r8192 d16256 u32768
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 260624
[ 0.000000] Kernel command line: console=ttymxc1,115200n8 rootwait root=/dev/mmcblk0p1 enable_wait_mode=off
[ 0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[ 0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[ 0.000000] Memory: 1017160K/1048576K available (3802K kernel code, 169K rwdata, 1280K rodata, 196K init, 353K bss, 31416K reserved, 270336K highme)
[ 0.000000] Virtual kernel memory layout:
Matthias Schwartz wrote:
I think the attachment is ok u-boot.imx has 326656 bytes, here is the situation:
root@fubar01:~/riotboard# ls -l u-boot.imx
-rw-r--r-- 1 root root 326656 Mar 30 19:23 u-boot.imx
root@fubar01:~/riotboard# sha256sum u-boot.imx
36c4d61fa46203b8c4297c94ce5833739674a4bea92ea5766b631b5ab4a5b4ab u-boot.imx
Hopefully that can confirm the file you have is the same.
Yes the sha256sum is correct. I think the problem is not the u-boot.imx image. Either the dd call failed or the system needs additional information on the boot device, perhaps the u-boot parameters or some checksum. Or something on my board is corrupt.
I tried dd to /dev/mmcblk0 and /dev/mmcblk1 directly from ubuntu on the RIoT-board and dd to /dev/sda from an x86 linux system with USB to SD converter. Same effect with both. I checked the dip switches multiple times. Are there different board revisions with different switch settings?
When I'm using your u-boot in the serial download mode for BootStrap your UBoot-2014.04-rc2...dirty starts, first success
as far as I know, the only requirement is that the u-boot.imx file is written at 1K into the card.. it's obviously important that you don't create a filesystem at sector 63 as that would overwrite u-boot. Hence you create the first partition at 2048 blocks (1MByte) into the card.
The very same method works on the Wandboard and I've used it sucessfully there too.
Likewise, I've not seen anything to suggest there's more than one revision of the board. I suppose it's possible that one of the boot settings resistors from p18 of the schematics is missing, but it seems less likely if you're able to get the original images to boot.
If the serial download mode gets you something on the console then it seems it's likely to be switch settings, wrong SD card slot, failed write to the card, or maybe the boot rom is doing something your sd card doesn't like while trying to load u-boot..
Switch settings:
<html><head><title>Jive SBS</title></head>
<body><font face="arial,helvetica,sans-serif">
<b>Error</b><br><font size="-1">
An general error occurred while processing your request.
</font></font></body></html>
or maybe this is better with them highlighted?
uSD Card:
<html><head><title>Jive SBS</title></head>
<body><font face="arial,helvetica,sans-serif">
<b>Error</b><br><font size="-1">
An general error occurred while processing your request.
</font></font></body></html>
Card installed here:
<html><head><title>Jive SBS</title></head>
<body><font face="arial,helvetica,sans-serif">
<b>Error</b><br><font size="-1">
An general error occurred while processing your request.
</font></font></body></html>
# fdisk -l /dev/sdc
Disk /dev/sdc: 7948 MB, 7948206080 bytes
10 heads, 4 sectors/track, 388096 cylinders, total 15523840 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/sdc1 2048 2099199 1048576 83 Linux
filesystem is ext2, but none of that should matter to get output from u-boot itself.
/bootscript sits in that ext2 partition and contains the following
fdt_high=0xffffffff initrd_high=0xffffffff kaddr=0x12000000 loadkernel=load ${dtype} ${disk}:1 ${loadaddr} /boot/zImage bargs=setenv bootargs console=ttymxc1,115200n8 rootwait root=/dev/mmcblk0p1 enable_wait_mode=off loadfdt=load ${dtype} ${disk}:1 0x11000000 /boot/${fdt_file} foobar=run bargs; if run loadkernel; then echo kernel_loaded ; if run loadfdt; then echo fdt_loaded; bootz ${loadaddr} - 0x11000000 ; else echo fail1; bootz ; fi ; fi ; echo failed to boot
and yes, that last line needs to be on a single line..
required kernel files go in /boot and are imx6s-riotboard.dtb & zImage, all three of which are attached..
sha256sums:
32d4b7d5ecc0b8838c8575e62cb689124fcaee6dc3babf0bbb76e975f9ad8ab8 bootscript
1e9f7ae6820a2febe71b8591d079995b36c7e07a80cc52dd3bf8c937aefddc5a imx6s-riotboard.dtb
5078d1023d49d62146826cd33af67789337aecd32240ff836d25fb9abf275ee4 zImage
Note that the kernel is quite minimal, there may not be enough in it to run a traditional distro like debian or ubuntu, but it's enough to prove booting works.
Matthias Schwartz wrote:
or the system needs additional information on the boot device, perhaps the u-boot parameters or some checksum.
That doesn't appear to be the case.. Mostly out of curosity to know if my build of u-boot would work on a full sized SD card, I completely zeroed a card, then wrote just that u-boot.imx at 1KB. Took out the uSD, put the full size SD in the other slot, swapped switches 7 & 8, turned it on and the u-boot prompt appears.. Not even a partition table on the card.
Thanks a lot for your detailed information!
Especially the kernel file and the dtb will be very useful to try.
At the moment I don't see what I've done wrong and suspecting some hidden misconfiguration of the board.
Another question. How do u-boot know which serial console and speed it should use for the output before the boot parameter of u-boot are set (setenv console...)? Perhaps everything is working except the console output.
The console used is effectively hard-coded by the board config you build u-boot for. If you look in include/configs/embestmx6boards.h in the u-boot source, you'll find some lines near the top like
#define CONFIG_MXC_UART_BASE UART2_BASE #define CONFIG_CONSOLE_DEV "ttymxc0" #define CONFIG_MMCROOT "/dev/mmcblk1p2" #ifdef CONFIG_RIOTBOARD #define CONFIG_DEFAULT_FDT_FILE "imx6s-riotboard.dtb" #elif defined CONFIG_MARSBOARD #define CONFIG_DEFAULT_FDT_FILE "imx6q-marsboard.dtb" #else #error Please define a board (RIOTBOARD or MARSBOARD) #endif
CONFIG_CONSOLE_DEV gets used later for the default built-in environment, but I expect that it's really CONFIG_MXC_UART_BASE that sets what the console will be. I'm not 100% sure what gets used where though, or if you can fully override the u-boot console output by setting the var in the environment.
Matthias Schwartz wrote:
- Your u-boot.imx on internal eMMC: no message at all, same as above but used /dev/mmcblk0 instead /dev/mmcblk1
From my booted uSD, I've wiped the eMMC, created a blank partition, wrote u-boot.imx as follows:
root@riotboard:~# dd if=/dev/zero of=/dev/mmcblk1 bs=1M count=20 20+0 records in 20+0 records out 20971520 bytes (21 MB) copied, 2,27716 s, 9,2 MB/s root@riotboard:~# fdisk /dev/mmcblk1 Welcome to fdisk (util-linux 2.24). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Device does not contain a recognized partition table. Created a new DOS disklabel with disk identifier 0x9f52ed0f. Command (m for help): n Partition type: p primary (0 primary, 0 extended, 4 free) e extended Select (default p): p Partition number (1-4, default 1): 1 First sector (2048-7503871, default 2048): Last sector, +sectors or +size{K,M,G,T,P} (2048-7503871, default 7503871): Created a new partition 1 of type 'Linux' and of size 3,6 GiB. Command (m for help): p Disk /dev/mmcblk1: 3,6 GiB, 3841982464 bytes, 7503872 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 Disklabel type: dos Disk identifier: 0x9f52ed0f Device Boot Start End Blocks Id System /dev/mmcblk1p1 2048 7503871 3750912 83 Linux Command (m for help): w The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks. root@riotboard:~# dd if=u-boot.imx of=/dev/mmcblk1 bs=1024 seek=1 319+0 records in 319+0 records out 326656 bytes (327 kB) copied, 0,0783677 s, 4,2 MB/s
then powered down, reset the switches to the default eMMC boot settings from table 4-2 in the manual, removed all SD cards, powered it back on and I instantly get the U-Boot 2014.04-rc2... It obviously doesn't boot fully as it's still missing a kernel and filesystem, but it seems there's nothing particularly special needed.
So possibly your board does have a problem... Or it'll be something so simple that you can't see it when it's staring you in the face... We've all been there