7 Replies Latest reply on Nov 4, 2016 2:14 PM by AlexT_Intel

    FreeRTOS and mraa

    Blasi

      Hi,

       

      I have an Intel Galileo Gen 2 board where I have succesfully built and run a FreeRTOS instance. I am using Eclipse Neon for C as a development environment and to this point everything works ok. I am now trying to make use of the input and output features. I am no expert so I am trying to find how to do this. As I have understood, I need to include MRAA. I have downloaded iotdk-ide-win, where I have found the include folder that suposedly contains this libraries. I have referenced this folder in the Project properties / C/C++ Build / Settings / Cross GCC compiler / Includes. When I include it and try to run some basic function call, as  found in the examples:

       

           #include "mraa/gpio.h"

           ....

          mraa_platform_t platform = mraa_get_platform_type();

       

      I get the following error:

       

           undefined reference to `mraa_get_platform_type'

       

      What I am missing?

       

      Thanks.

        • 1. Re: FreeRTOS and mraa
          FGT

          Are you sure mraa can be used in FreeRTOS?

           

          AFAIK, iotdk-ide-win is not intended to be used with other than Intel Galileo Yocto...

           

          Fernando.

          • 2. Re: FreeRTOS and mraa
            Blasi

            I am not really sure about many things at the moment.

             

            When requested in the FreeRTOS forum how to access the IO pins in the Galileo Board I was redirected to Intel documentation and forums. MRAA is what I found, but any other reference would be greatly apreciated.

             

            Just to get one step back, my question is, once I have a function in C run in the board, how can I light a led or read a sensor.

             

            Thanks

            • 3. Re: FreeRTOS and mraa
              FGT

              When requested in the FreeRTOS forum how to access the IO pins in the Galileo Board I was redirected to Intel documentation and forums. MRAA is what I found, but any other reference would be greatly apreciated.

              Interesting... technically speaking  you are using a FreeRTOS Galileo/x86 port... where/how did you get it?

               

              Just to get one step back, my question is, once I have a function in C run in the board, how can I light a led or read a sensor.

               

              It depends on the OS & libraries available in that OS. In yocto (the official Intel Galileo OS, supported by Intel AFAIK) you can use a number of ways, I think. Unfortunately, I mostly develop in the Arduino IDE, where handling LEDs and some (not all in Galileo) sensors are trivial tasks (the Blink example, actually), but I think it's too far from you are right now.

               

              Fernando.

              • 4. Re: FreeRTOS and mraa
                Blasi

                FreeRTOS for Galileo Gen 2 is an official port, so there is no great challenge on that :). You can get it from the official site:

                 

                FreeRTOS - Quick start guide

                 

                In short, you create the boot SD card as explained in this site (normal system setup, as I understand) and then compile and reference in grub the FreeRTOS port. I used for this Eclipse and the project contained in the IA32_flat_GCC_Galileo_Gen_2 folder.

                 

                After that comes the problem. SO and libraries are quite minimalist, as supposed to be on this kind of RTOS and constrained devices, so anything must come writen from scratch or obtained. That is the search where I find myself now.

                • 5. Re: FreeRTOS and mraa
                  FGT

                  Thanks for the info, I did not know about it.

                   

                  Maybe you are almost alone, now... i.e. you use an OS which only provides a task runtime without knowledge to use available hardware, and hardware I/O... also an OS which is not supported (AFAIK, at least) by the hardware vendor (Intel, in this case). Bottom line: I'm of no help here, sorry.

                   

                  Fernando.

                  • 6. Re: FreeRTOS and mraa
                    Intel Corporation
                    This message was posted on behalf of Intel Corporation

                    Hi Blasi,

                     

                    We understand that you are running the FreeRTOS in the Intel Galileo Gen 2, and trying to access the I/O pins, also that they redirected you to our forum, however, it is out of our support scope. In case you used Yocto, you can find in the following link how to manipulate digital GPIOs using Linux: Galileo Gen2 : GPIO control using Linux | Anand Vetcha

                    Regards,
                    -Yermi  

                    • 7. Re: FreeRTOS and mraa
                      AlexT_Intel

                      A very simple answer to that is that mraa port to FreeRTOS does not exist. Originally mraa worked on Linux only, these days there is a way to make it work in a mock mode (i.e. with a simulated board, so it won't toggle any real GPIOs for example, but you would be able to write and compile programs in familiar Windows environment) on Windows and MacOS, there's even a port of the API (but only the API, so that you can preserve or at least only minimally modify your code, which worked with Linux) to Zephyr, but there's nothing for FreeRTOS.