2 Replies Latest reply on Mar 14, 2014 6:13 PM by MarcIII

    How to mount the SPI-Flash ?

    Smile5

      Hello

       

      I just received my galileo board.

      I want to use the board on linux only (no Arduino). I know how to build kernel image and rootfs for bootins SD-card. But my application is very small, and i think it can fit in the 8Mb SPI Flash.

      So I want to know, if is it possible to mount it ( perharps with dd, and loopback device ), in RW mode, an to put in it an executable ?

       

      Thank for replies

        • 1. Re: How to mount the SPI-Flash ?
          AlexT_Intel

          Hi @Smile5,

           

          Theoretically that should be possible. The "bitbake image-spi" (or image-spi-galileo in 0.9.0 BSP) produces yocto_build/tmp/deploy/images/image-spi-clanton.cpio.lzma file, which is a filesystem image. You can probably unpack it, put your application in and then pack again. That would be brute-force :-)

           

          Nicer and IMHO easier approach would be to use the Yocto capabilities and create a layer with a recipe (or just a recipe in one of the existing layers, but that's again akin to brute-force) for your application. That would cross-compile it for you as well as pack it into the image automatically. Yocto manual has all the info you need, but it may be a little intimidating if you see it for the first time. You can use the layer I've created as an example - just throw all the subfolders away, leave one, put your recipe in and start tinkering.

          • 2. Re: How to mount the SPI-Flash ?
            MarcIII

            Smile5,

             

            For incremental development it's very easy to unpack a cpio.lzma image, modify it and pack it again. You can even find some a sample (and unsupported) script automating this operation in the small file spi-flash-tools/ramfs.mk. Make sure you get familiar with the BSP build guide before looking at the ramfs.mk