4 Replies Latest reply on Apr 29, 2015 9:04 AM by Phenitia

    Intel Galileo gen1 - unable to run a sketch from the sd card

    Phenitia

      Hello!

       

      I am having an issue with my Galileo board:

      When I boot from the sd card, I can't run any sketch. There is no problem with the upload, and I can see the sketch in /sketch, but when I reboot the Galileo nothing happens.

      I tried it with the Blink example: it works only when I am not booting from the sd card.

      The firmware of my board is 1.0.4 and I am using the 1.0.4 image of Linux.

      I have no idea of where the problem comes from, so I am looking for someone able to help me.

       

      I thank you in advance~~

        • 1. Re: Intel Galileo gen1 - unable to run a sketch from the sd card
          mhahn

          - are you sure you boot from SD card at all? if not the sketch is by default only in memory - or did you say that you find the sketch in /sketch also after rebooting?

          - which SD card image are you using?

          • 2. Re: Intel Galileo gen1 - unable to run a sketch from the sd card
            Phenitia

            I am sure I'm booting from the SD card since I have the folder /media/mmcblk0p1, and the sketch is still there after rebooting.

            I am using the image at this link: Intel® Download Center (SDCard.1.0.4.tar.bz2).

             

            After messing around, I succeeded in manually running the sketch with the command /sketch/sketch.elf /dev/ttyS0 /dev/ttyS0, so I don't understand why it doesn't start automatically...

            • 3. Re: Intel Galileo gen1 - unable to run a sketch from the sd card
              Phenitia

              Well, i have tried with other firmwares and images, but I still have the same problem. I can run the sketches with the command /sketch/sketch.elf /dev/ttyS0 /dev/ttyS0 but they won't run at startup or when I send them with the Arduino IDE.

              • 4. Re: Intel Galileo gen1 - unable to run a sketch from the sd card
                Phenitia

                I finally solved my problem, but I still don't know why it seems like I was the only one having it...

                 

                To start a sketch, the command "/sketch/sketch.elf /dev/ttyGS0 /dev/ttyGS0" was working, but not "/sketch/sketch.elf /dev/ptx/0" that is apparently used by clloader.

                So I thought of editing this program to change the command starting the sketch.

                I found the sources here: clloader/bootloaders/izmir at galileo · 01org/clloader · GitHub

                 

                The thing is, after looking a bit at the code and trying to see how it works, I understood that /dev/ptx/0 was actually a sort of virtual serial port, mapped to /dev/ttyGS0.

                So, the command "/sketch/sketch.elf /dev/ptx/0" seemed wrong: shouldn't there be two arguments? A port for input, another one for output?


                I then went to line 2634 in the file clloader.c, and changed

                 

                slave_args[0] = CLANTON_SKETCHPROGRAM;

                slave_args[1] = slavename;          //slavename = the name of the virtual serial port

                slave_args[2] = NULL;

                 

                to

                 

                slave_args[0] = CLANTON_SKETCHPROGRAM;

                slave_args[1] = slavename;

                slave_args[2] = slavename;

                slave_args[3] = NULL;

                 

                I compiled the new binary and placed it instead of the old one, and now everything works just fine.

                 

                Still, if someone could explain why this seemed to happen only to me, or why the program clloader was written this way, I wouldn't mind some enlightenment ^^'