32 Replies Latest reply on Apr 11, 2014 10:15 AM by innovina

    How can i flash using Linux?

    roose

      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

        • Re: How can i flash using Linux?

          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

           

            • Re: How can i flash using Linux?

              actually, I take it back.. the gerbers download that appeared the other week isn't really gerbers at all, it's PDFs of the gerbers and as such totally useless for building your own...

               

              The PDFs are of course helpful for examining the design, finding out where to cut tracks and such like, but nothing more. So even less of an open hardware design that I was thinking

              • Re: How can i flash using Linux?
                roose

                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.

                  • Re: How can i flash using Linux?

                    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

                      • Re: How can i flash using Linux?
                        jcarruthers

                        AFAIK you can only boot Linux from the internal eMMC — not from the external.

                          • Re: How can i flash using Linux?

                            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.

                              • Re: How can i flash using Linux?
                                anthony_h

                                 

                                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.

                                  • Re: How can i flash using 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.

                                    • Re: How can i flash using Linux?

                                      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..

                                        • Re: How can i flash using Linux?
                                          innovina

                                          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?

                                            • Re: How can i flash using Linux?

                                              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

                                              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.

                                                • Re: How can i flash using Linux?

                                                  Not really sure if that attachment will work or not, I uploaded a 319KB u-boot.imx and seem to have ended up with a zip file that's a different size

                                                    • Re: How can i flash using Linux?
                                                      innovina

                                                      I think the attachment is ok u-boot.imx has 326656 bytes, here is the situation:

                                                       

                                                      • Original u-Boot console on internal eMMC from RIoT-tools: working, with original ubuntu kernel, but I get CRC error when using my own Gentoo kernel.
                                                        Message from u-Boot (with or without uSD put in):
                                                        Board: i.MX6DL/Solo-SABRESD: unknown-board Board: 0x61011 [POR ]
                                                        *** Warning - bad CRC or MMC, using default environment
                                                        MMC read: dev # 3, block #2048, count 8192 ... 8192 blocks read: OK
                                                        ## Booting kernel from Legacy Image at 1080000000 ...
                                                             Image Name:   Linux-3.0.35-02871-ga35ffe
                                                             Image Type:     ARM Linux Kernel Image (uncompressed)
                                                             Date Size:        3901664 Bytes = 3.7 MB
                                                             Load Address: 10008000
                                                             Entry Point:      10008000
                                                             Verifying Checksum ... OK
                                                             Loading Kernel Image ... OK
                                                        OK
                                                        Starting Kernel ...
                                                        Linux version 3.0.35...
                                                      • Your u-boot.imx on external uSD card: no message at all
                                                        Booted ubuntu from eMMC cleared the uSD with dd if=/dev/zero of=/dev/mmcblk1
                                                        Created 4 partitions on uSD with fdisk starting from sector 2048 (uSD hast 4 heads, 16 sectors, 486192 cylinders)
                                                        Installed u-boot.imx with dd if=u-boot.imx of=/dev/mmcblk1 bs=1024 seek=1
                                                        Powered down the system and set the DIP switch for booting from uSD
                                                        Reboot and no reaction on serial console
                                                      • Your u-boot.imx on internal eMMC: no message at all, same as above but used /dev/mmcblk0 instead /dev/mmcblk1
                                                      • Original u-boot-mx6solo-riot.bin on external uSD card: no message at all like above
                                                      • Reflash original u-boot-mx6solo-riot.bin on internal eMMC: works
                                                      • Reflash Android on external SD card: works I can switch between eMMC ubuntu and SD android via DIP switches
                                                        • Re: How can i flash using Linux?

                                                          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.

                                                          • Re: Re: How can i flash using Linux?

                                                            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:

                                                            • Re: Re: How can i flash using Linux?

                                                              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.

                                                                • Re: How can i flash using Linux?
                                                                  innovina

                                                                  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

                                                                    • Re: How can i flash using Linux?

                                                                      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..

                                                                      • Re: Re: How can i flash using Linux?

                                                                        Switch settings:

                                                                         

                                                                         

                                                                        or maybe this is better with them highlighted?

                                                                        IMG_2393_hl.jpg

                                                                         

                                                                        uSD Card:

                                                                         

                                                                         

                                                                        Card installed here:

                                                                        sdcard.jpeg

                                                                         

                                                                        # 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.

                                                                        • Re: How can i flash using Linux?

                                                                          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.

                                                                            • Re: How can i flash using Linux?
                                                                              innovina

                                                                              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.

                                                                                • Re: Re: How can i flash using Linux?

                                                                                  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.

                                                                          • Re: Re: How can i flash using Linux?

                                                                            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

                                                                              • Re: How can i flash using Linux?
                                                                                radiatortwo

                                                                                I´ve tried your files and could get an SD Card running with it.

                                                                                Only thing is there seems no ext3 filesystem in your kernel image?

                                                                                 

                                                                                But I wanted to boot from the internal eMMC.

                                                                                 

                                                                                Did all the same:

                                                                                Flashed the u-boot image.

                                                                                Created two partitions. One for the bootscript and Kernel files and one for the rootfs.

                                                                                Then removed the SD-Card put the switches to 2-Off 5-Off.

                                                                                And... nothing.

                                                                                No response at all.

                                                                                Then I inserted the SDCard again.

                                                                                And... it´s booting from the SD-Card although the switches are set to boot from eMMC.

                                                                                  • Re: How can i flash using Linux?

                                                                                    Otto Römmich wrote:

                                                                                     

                                                                                    I´ve tried your files and could get an SD Card running with it.

                                                                                    Only thing is there seems no ext3 filesystem in your kernel image?

                                                                                    Probably not, I did say it was a very minimal build  

                                                                                    I tend not to use ext3 if I can avoid it, but especially not on flash. Data journaling with ext3 increases the number of writes, combine that with Write amplification due to wear levelling and you have a recipe for horribly bad performance.

                                                                                    Having checked the config, there's ext2 and nfs, that's it.

                                                                                    Then removed the SD-Card put the switches to 2-Off 5-Off.

                                                                                    And... nothing.

                                                                                    No response at all.

                                                                                    That happens if you have the switches set to boot from a device that doesn't contain the correct data. As far as I can tell, there's no fallback to a different device within the on-chip boot rom (however looking at the boot flow charts in section 8.5.3.2 of the ref manual... well, it's complicated.. easily possible I'm missing something), other than 'Manufacture Mode' which would allow boot from a full size SD card (or, seemingly from the OpenSDA).

                                                                                     

                                                                                    Building a full table of what the switches do is complicated by the fact that changing one switch from off to on might change the function of another three switches. Simplistically, with D1 On, D2 Off, you have D4 on for eMMC mode, off for SD mode, then D7 & D8 pick one of four possible SD interfaces.

                                                                                     

                                                                                    So, are you using a full size card in J6 on the underside of the board ?  Or a uSD in J7 on the top ?  You'll need to change D7 & D8 to match.

                                                                                     

                                                                                    Then I inserted the SDCard again.

                                                                                    And... it´s booting from the SD-Card although the switches are set to boot from eMMC.

                                                                                    SD & eMMC are very similar, it's quite possible you can boot from an SD card while D4 is set to eMMC mode, assuming D7 & D8 have picked one of the SD slots. (or you're using a full size SD card and booting in mfg mode)

                                                                                     

                                                                                    You're making me wonder if there's a problem with the physical switches themselves.. So even though you've turned a switch on, it's not physically shorted the two pins. Matthias was having similar problems that could probably be explained by this.  If you have a multimeter, it should be easy enough to check if anything like that is happening.

                                                                                     

                                                                                    Part of the reason I'd posted the photos was to make sure there wasn't something like some boards having the switches mounted in reverse causing counting from the wrong end or on/off reversals.

                                                                                     

                                                                                    As I've said in earlier posts, I'm able to boot exactly the same u-boot image from any of eMMC, a full size SD, or a uSD in the appropriate slots. 

                                                                                    So we're left with

                                                                                    1. finger trouble, hopefully dd-ing u-Boot 1KB into the card is easy enough that this isn't an issue
                                                                                    2. incompatible SD cards, not impossible and has been a problem for Raspberry Pi
                                                                                    3. switch problems

                                                                                    I suppose it's also possible that the eFUSEs have been blown on some boards in a way that overrides some switch settings, but hopefully that's something we don't have to worry about.

                                                                                     

                                                                                    I should probably add that as I don't have a windows machine, I've never used the MFG Tool. Possibly it can let you do things like blowing eFUSEs that'll never have been done to my board outside whatever the factory did.

                                                                                     

                                                                                    One last thing, when you change the switches, are you doing a proper power cycle ?  Or just pushing the reset button ?  I always do a hard power cycle.

                                                                                    I've not checked the docs in enough detail for i.MX6, but some devices only sample the boot config on power up, not on reset. So I do a hard power cycle to be sure..

                                                                                      • Re: How can i flash using Linux?
                                                                                        radiatortwo

                                                                                        I´m using a Full Size SD card on J6. (SanDisk Extreme Class 10 8GB)

                                                                                        I tested the switches with a multimeter. They all work properly.

                                                                                        All dip switches are on except for D2 and D5 and it boots from the card. You said when D4 is set to on it´s in eMMC mode and it then can boot from the SD card in mfg mode. That´s the case I suppose.

                                                                                         

                                                                                        I only used MFGTool in Windows to get the Debian rootfs with the older Kernel and u-boot image on the Board. Can´t tell if the eFUSEs are alright or not.

                                                                                        Then I´ve put everything on the card on the board itself. (booted from eMMC and configured the card)

                                                                                        After that I booted from the card with dip switches D2,D4,D5 and D7 switched to Off. Then I did the same thing with the eMMC as I did with the SD card.

                                                                                         

                                                                                        Also when changing dip switches I always power off the board, before switching them. No reset.

                                                                                          • Re: How can i flash using Linux?

                                                                                            Otto Römmich wrote:

                                                                                             

                                                                                            All dip switches are on except for D2 and D5 and it boots from the card. You said when D4 is set to on it´s in eMMC mode and it then can boot from the SD card in mfg mode. That´s the case I suppose.

                                                                                             

                                                                                            So if you have only D2 & D5 off, then it would seem that as long as what's at 1KB in the eMMC isn't seen as being a valid boot image then it'll try uSDHC1 which is connected to the OpenSDA and uSDHC2 which is your full size SD card.  Using this mode obviously isn't ideal as it's using 1bit rather than 4bit to access the card, so it'll be slower, but presumably u-boot will then use 4bit mode and you're fine from there.

                                                                                             

                                                                                            I wonder why you were having problems with the switches set differently then.  Forgetting about actually booting to linux for a moment, it should be simple to get the u-boot prompt on any of eMMC, SD, uSD by just writing a u-boot.imx starting at 1KB, there doesn't appear to be anything special needed other than that. Once you have u-boot loaded it's a relatively simple task to script what you need, even booting from the network.

                                                                                            • Re: How can i flash using Linux?
                                                                                              innovina

                                                                                              I've successfully installed the new u-boot boot loader on the eMMC with the MfgTool2.exe

                                                                                               

                                                                                              For this I've modified the ucl2.xml file for the configuration, replaced the u-boot-mx6solo-riot.bin, powered off the board, changed the dip switches to serial download mode, switched the board back on, chekced cfg.ini, started MfgTool2.exe and programmed the boot loader. Than poweroff the board set the dip switches back to boot from eMMC and power on.

                                                                                               

                                                                                              I've replaced the file files/u-boot-mx6solo-riot.bin and very important delete the last two parameters skip=2 conv=fsync!

                                                                                               

                                                                                              The corresponding line in ucl2.xml should look like this:

                                                                                              <CMD state="Updater" type="push" body="$ dd if=$FILE of=/dev/mmcblk0 bs=512 seek=2">write u-boot.bin to sd card</CMD>

                                                                • Re: How can i flash using Linux?
                                                                  roose

                                                                  Hi,

                                                                   

                                                                  to get back to topic ...

                                                                   

                                                                  At the end i used an old windows notebook for uploading open source to open hardware.

                                                                  The result is nothing i would safely call open any more.

                                                                   

                                                                  Still looking for a linux solution. Of course linux as sd-card image would be perfect ;-)

                                                                   

                                                                  I had a look on imx_usb_loader, but i didn't got how to use it with the riotboard.

                                                                    • Re: How can i flash using Linux?

                                                                      Steffen Reinecke wrote:

                                                                       

                                                                      I had a look on imx_usb_loader, but i didn't got how to use it with the riotboard.

                                                                      imx_usb_loader essentially allows you to download some code to the board via a usb connection, in much the same way as the mfg tools.

                                                                      Normally you'd use it to download a version of U-Boot which can then subsequently boot linux, android or whatever you choose from any device the version of U-Boot you load supports