Software Archive
Read-only legacy content
17061 Discussions

Segmentation fault Using example 3_c_onboard_LED_blink

Mike_M_3
Beginner
4,475 Views

I opened the example "3_c_onboard_LED_blink" in eclipse, changed nothing to it. Built it and executed it.

In the console window i received the following. Not sure what a Segmentation fault is.

root@edison:~#
echo $PWD'>'
/home/root>
root@edison:~#
root@edison:~# chmod 755 /tmp/3_c_onboard_LED_blink;/tmp/3_c_onboard_LED_blink;e
xit
Welcome to libmraa
 Version: v0.5.0-12-g3898182
 Running on Some weird devboard that isn't recognised...
Segmentation fault

 

0 Kudos
33 Replies
Brendan_L_Intel
Employee
2,904 Views

Mike M. wrote:

Running on Some weird devboard that isn't recognised...

Segmentation fault

Could you share with us the version of the OS/firmware on your edison board? A seg fault is a critical error, in this case caused by your board being unrecognied because of an invalid name in the DMI tables. This will cause galileo gen1 tables to be loaded and somewhere after cause a crash. mraa_init() returning non zero is a fatal error.

What's the output of:

cat /sys/devices/virtual/dmi/id/board_name

Thanks,

Brendan

0 Kudos
Mike_M_3
Beginner
2,904 Views

<blockquote>What's the output of: cat /sys/devices/virtual/dmi/id/board_name</blockquote>

BODEGA BAY

0 Kudos
Matthias_H_Intel
Employee
2,904 Views

and the output of

cat /etc/version

in order to answer Brendans's other question on OS/firmware

0 Kudos
Mike_M_3
Beginner
2,904 Views

edison-weekly_build_68_2014-09-08_13-49-07

 

0 Kudos
Matthias_H_Intel
Employee
2,904 Views

ok, so far everything looks good. What's the host OS where you run the Eclipse IDE?

0 Kudos
Mike_M_3
Beginner
2,904 Views

Win7 64-bit.

 

0 Kudos
Matthias_H_Intel
Employee
2,904 Views

just tried on a Windows 8 x64 host. Everything working fine. So maybe you need to share some more info on how you ran it?

Compile output:

19:29:27 **** Rebuild of configuration Debug for project 3_c_onboard_LED_blink ****
Info: Internal Builder is used for build
i586-poky-linux-gcc "-IC:\\[...]\ide\\iotdk-ide-win/devkit-x86/sysroots/i586-poky-linux/usr/include" "-IC:\\[...]\\ide\\iotdk-ide-win/devkit-x86/sysroots/i586-poky-linux/usr/include/mraa" -Os -g3 -Wall "--sysroot=C:\\[...]\\ide\\iotdk-ide-win\\devkit-x86\\sysroots\\i586-poky-linux" -m32 -march=i586 -c -ffunction-sections -fdata-sections -o "src\\3_c_onboard_LED_blink.o" "..\\src\\3_c_onboard_LED_blink.c" 
i586-poky-linux-gcc "-LC:\\[...]\\ide\\iotdk-ide-win/devkit-x86/sysroots/i586-poky-linux/usr/lib" "--sysroot=C:\\[...]\\ide\\iotdk-ide-win\\devkit-x86\\sysroots\\i586-poky-linux" -lmraa -o 3_c_onboard_LED_blink "src\\3_c_onboard_LED_blink.o" 

"Run As" configurations:

eclipse.jpg

Run output:

root@edison1:~# echo $PWD'>'

/home/root>
root@edison1:~# 
root@edison1:~# chmod 755 /tmp/3_c_onboard_LED_blink;/tmp/3_c_onboard_LED_blink;
exit
Welcome to libmraa
 Version: v0.5.0-12-g3898182
 Running on Some weird devboard that isn't recognised...

 

 

0 Kudos
Mike_M_3
Beginner
2,904 Views

For what it's worth, I can compile all examples successfully with no errors.

I can run examples 1,2, 8 & 9.

When i run examples 3,4,5,6,7 is where i get the Segmentation fault

 

0 Kudos
Mike_M_3
Beginner
2,904 Views

I have the same., yet my output is

root@edison:~#
echo $PWD'>'
/home/root>
root@edison:~#
root@edison:~# chmod 755 /tmp/3_c_onboard_LED_blink;/tmp/3_c_onboard_LED_blink;e
xit
Welcome to libmraa
 Version: v0.5.0-12-g3898182
 Running on Some weird devboard that isn't recognised...
Segmentation fault

2014-10-02_12-41-08.jpg

0 Kudos
Mike_M_3
Beginner
2,904 Views

I think a better question is, since this DK is for the Edison, why aren't the examples made for it?

Why would they not include the edison ?

typedef enum {
    MRAA_INTEL_GALILEO_GEN1 = 0, /**< The Generation 1 Galileo platform (RevD) */
    MRAA_INTEL_GALILEO_GEN2 = 1, /**< The Generation 2 Galileo platform (RevG/H) */

    MRAA_UNKNOWN_PLATFORM = 99 /**< An unknown platform type, typically will load INTEL_GALILEO_GEN1 */
} mraa_platform_t;

 

0 Kudos
Mike_M_3
Beginner
2,904 Views

Another Tid bit, and then i will stop flooding this thread.

I headed over to github to try a example there, this is the one i tried.

https://github.com/intel-iot-devkit/mraa/blob/master/examples/mmap-io2.c

I get the same results.

 

 


 

0 Kudos
Brendan_L_Intel
Employee
2,904 Views

Mike M. wrote:

Another Tid bit, and then i will stop flooding this thread.

I headed over to github to try a example there, this is the one i tried.

https://github.com/intel-iot-devkit/mraa/blob/master/examples/mmap-io2.c

I get the same results.

Hi Mike,

mraa_init() will get called either way, and the message you are getting is from that call which is failing. I'm not entirely sure why, whilst the libs in the eclipse build don't match whats on your board, for mraa_init() we're typically able to 'get away with it'. We're investigating further.

0 Kudos
Matthias_H_Intel
Employee
2,904 Views

if you copy over the generated binary - does this run on Edison?

0 Kudos
Mike_M_3
Beginner
2,904 Views

Just so i am clear on what your asking.

The first thing i did was open a terminal and delete the files in the /tmp just to make sure...

In Project Explorer I clicked on the project then opened the debug folder, right clicked on the file 3_c_onboard_LED_blink and clicked copy. Then I clicked on remote system explorer. drilled down to the /tmp folder and pasted it there.

I then went back to the terminal tried to run it, permission denied. did a chmod +x 3_c_onboard_LED_blink, then tried it again and it ran but gave the same results.

 

0 Kudos
Brendan_L_Intel
Employee
2,904 Views

Can you clarify what baseboard you have plugged into the edison? Note we only support the arduino breakout board at this point.

0 Kudos
Mike_M_3
Beginner
2,904 Views

I have the Intel Edison Breakout Board Kit Model EDI1BB.AL.K

I dont see how that has anything to do with it other than the fact that the output pin is wrong to flash a led.

0 Kudos
Mike_M_3
Beginner
2,904 Views

I have received an answer to this. Maybe helpful to others who are using the edison mini breakout board like me.

mraa only supports the arduino breakout board, you cannot use it with the edison mini breakout board.

So for now we just sit and wait....

 

 

0 Kudos
David_B_7
Beginner
2,904 Views

Thanks for posting this.  Do the C/C++ libraries work, or are we totally dead in the water regarding GPIO access without the Arduino board?

0 Kudos
Mike_M_3
Beginner
2,904 Views

If your not using the Arduino board, And try to access the GPIO using libmraa It will compile just fine, but when you try to run it you will get a "Segmentation fault" in the terminal window and it just stops. So for now we have to wait until they fix it.

 

 

 

0 Kudos
Tage_B_
Beginner
2,757 Views

I am also getting the Segmentation Fault when I am trying to run a simple Python program that toggles an output pin. I am using the small breakout board (Edison).

0 Kudos
Reply