Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
New Contributor I
2,105 Views

GPIO 214 - Write Error: No Such Device

I am hoping for some help in getting the blink function to run on the Edison Arduino board. Actually, getting any GPIO 'out' direction to function.

Problem: The Blink routine will not blink either on board or connected leds.

Symptoms:

 

1. Running the blink program using onboard C program yields the following error message in the system log

ct 10 11:21:42 Edison libmraa[347]: [[1;31mgpio: Failed to write 214 to export[[0m

Oct 10 11:21:42 Edison libmraa[347]: [[1;39mlibmraa version v0.6.2 initialised by user 'root' with EUID 0[[0m.

2. Attempting to create access to '214' using the shell resulted in similar results

root@Edison:~# echo 214 > /sys/class/gpio/export

-sh: echo: write error: No such device

3. A closer look at the /sys/class/gpio directory

root@Edison:~# ls -a /sys/class/gpio

. export gpio125 gpio127 gpio129 gpio131 gpio133 gpiochip0

.. gpio124 gpio126 gpio128 gpio130 gpio132 gpio134 unexport

root@Edison:~#

Based on what I have read elsewhere in the forum I was expecting to see directories for "gpiochip200" and "gpiochip205". However they are absent.

What I have tried

1. Upgraded to the latest version of the firmware.

edison-image-ww25.5-15.zip

root@Edison:~# configure_edison --version

146

2. Upgraded to the current version of MRRA - version 0.6.2

3. Reboot and powered off the unit

4. Tried different power supplies

Any suggestions or thoughts would be appreciated.

13 Replies
Highlighted
Employee
189 Views

Hi,

First make sure you upload to the latest image. When running configure_edison –version you should see 159, not 146. I can see you are using edison-image-ww25.5-15.zip . This is the latest image but if you see 146 then it was not flashed properly. You can use the Flash Tool Lite to flash https://software.intel.com/en-us/iot/hardware/edison/downloads IoT - Intel® Edison Board Download | Intel® Developer Zone

In step 1, is that the full error log?

After updating to the latest image let me know what version of MRAA you are using, right now I'm using 0.7.2.

Sergio

0 Kudos
Highlighted
New Contributor I
189 Views

Hi Sergio:

I thought I had a good update of the firmware. Now knowing which version to look for I will refresh. I am using the Flash Tool Lite from a Mac platform. Any special techniques I should be aware of to get a successful update?

The current version of MRAA is 0.6.2. Yes, that is the complete log. I've tried setting the logging level to 7. Is that appropriate?

I am using the following to obtain and update the MRAA. Is there an alternative source?

src mraa-upm http://iotdk.intel.com/repos/1.1/intelgalactic http://iotdk.intel.com/repos/1.1/intelgalactic

Thank you,

David

Highlighted
New Contributor I
189 Views

If you're not seeing /sys/class/gpio/gpiochip200 (also gpiochip216, gpiochip232, and gpiochip248), then the pca953x GPIO expander driver isn't communicating with the four GPIO expanders on the Arduino breakout board. Have you done anything (such as changing pin muxing) that could interfere with communication with those chips on I2C-1? If there's a hardware issue with your Arduino breakout, then running dmesg | grep pca953x will show errors like pca953x 1-0020: failed reading register when the driver failed to communicate with the chips.

You are running all of this on the Arduino breakout board, not trying to develop code with an Edison plugged into a mini breakout or something before moving it to the Arduino board, right?

Highlighted
New Contributor I
189 Views

Hi Bunsen:

Yes, the dmesg does yield error messages. Please see the list below. I have not changed any jumpers from what I received out of the box and ran the dmesg command after a boot. Nor do it have anything plugged in to the board. I'm simply attempting to confirm that I can 'blink' the onboard LED.

All the development I have done is with the built in C compiler and using the nano editor. When I couldn't get the 'blink' program to work, I reverted to testing using the shell commands. That is when I found that any GPIO address greater than 200 yielded a "no such device" error.

Any suggestions of next steps would be appreciated.

Thanks

David

root@Edison:~# dmesg | grep pca953x

[ 3.765235] [] pca953x_read_regs.isra.5+0x2e/0xd0

[ 3.765291] [] pca953x_probe+0x1b2/0x4b0

[ 3.765403] [] ? pca953x_irq_handler+0x270/0x270

[ 3.768475] [] pca953x_read_regs.isra.5+0x2e/0xd0

[ 3.768502] [] pca953x_probe+0x1b2/0x4b0

[ 3.768560] [] ? pca953x_irq_handler+0x270/0x270

[ 3.786154] pca953x 1-0020: failed reading register

[ 3.786236] pca953x: probe of 1-0020 failed with error -110

[ 6.784851] [] pca953x_read_regs.isra.5+0x2e/0xd0

[ 6.784906] [] pca953x_probe+0x1b2/0x4b0

[ 6.785018] [] ? pca953x_irq_handler+0x270/0x270

[ 6.788060] [] pca953x_read_regs.isra.5+0x2e/0xd0

[ 6.788088] [] pca953x_probe+0x1b2/0x4b0

[ 6.788146] [] ? pca953x_irq_handler+0x270/0x270

[ 6.805531] pca953x 1-0021: failed reading register

[ 6.805612] pca953x: probe of 1-0021 failed with error -110

[ 9.804224] [] pca953x_read_regs.isra.5+0x2e/0xd0

[ 9.804278] [] pca953x_probe+0x1b2/0x4b0

[ 9.804390] [] ? pca953x_irq_handler+0x270/0x270

[ 9.807384] [] pca953x_read_regs.isra.5+0x2e/0xd0

[ 9.807412] [] pca953x_probe+0x1b2/0x4b0

[ 9.807470] [] ? pca953x_irq_handler+0x270/0x270

[ 9.825113] pca953x 1-0022: failed reading register

[ 9.825193] pca953x: probe of 1-0022 failed with error -110

[ 12.823808] [] pca953x_read_regs.isra.5+0x2e/0xd0

[ 12.823863] [] pca953x_probe+0x1b2/0x4b0

[ 12.823976] [] ? pca953x_irq_handler+0x270/0x270

[ 12.827030] [] pca953x_read_regs.isra.5+0x2e/0xd0

[ 12.827058] [] pca953x_probe+0x1b2/0x4b0

[ 12.827115] [] ? pca953x_irq_handler+0x270/0x270

[ 12.844712] pca953x 1-0023: failed reading register

[ 12.844792] pca953x: probe of 1-0023 failed with error -110

Highlighted
New Contributor I
189 Views

That's interesting. My Edison is running on a custom board with no I/O expanders, and I get:

root@ubilinux:~# dmesg | grep pca953x

[ 0.748103] pca953x 1-0020: failed reading register

[ 0.752941] pca953x: probe of 1-0020 failed with error -121

[ 0.753257] pca953x 1-0021: failed reading register

[ 0.753350] pca953x: probe of 1-0021 failed with error -121

[ 0.753661] pca953x 1-0022: failed reading register

[ 0.761949] pca953x: probe of 1-0022 failed with error -121

[ 0.763191] pca953x 1-0023: failed reading register

[ 0.763282] pca953x: probe of 1-0023 failed with error -121

I'm not running the same image, so maybe this is a consequence of different software configurations, but it's interesting that mine fails with error 121 ("Remote I/O error", according to http://lxr.free-electrons.com/source/include/uapi/asm-generic/errno.h?v=3.17 http://lxr.free-electrons.com/source/include/uapi/asm-generic/errno.h?v=3.17 ) and nothing else, but yours gives error 110 (Connection timed out) and a bunch of extra information that I can't make much sense of. I'm guessing that either it's a software problem, or something's messing with communication on I2C-1. It would be interesting to see the output of that command from an Edison running the same image as yours on something other than the Arduino breakout.

0 Kudos
Highlighted
Employee
189 Views

Hi,

What command are you using to compile the code, are you using the –lmraa option? Also what code are you running, I'd like to test this and see if I get a similar output.

Sergio

0 Kudos
Highlighted
New Contributor I
189 Views

Hi Sergio:

I appreciate your continued support and interest. I have now successfully upgrade to the most recent version of the firmware.

root@Edison:~# configure_edison --version

159

I will need to restore my backup from (SD Card) and rebuild the MRAA. That will take me another day to accomplish.

In the meantime, would it be possible for you to run on your system the command "dmesg | grep pca953x" and share your results?

Thank you,

David

0 Kudos
Highlighted
New Contributor I
189 Views

Hi Sergio:

I have completed the upgrade including installing MRAA 0.7.3. Here is some additional information.

The compile and running of the program:

root@Edison:~/blink# gcc -g blink.c -o blink -lmraa

root@Edison:~/blink# ./blink

Starting Blink Program on GPIO 13

MRAA Version: v0.7.3

Running on Intel Edison

Starting Blink Program

Finished Blink Program

root@Edison:~/blink#

The log file:

Oct 14 23:32:37 Edison libmraa[3378]: [[1;31mgpio: Failed to write 214 to export[[0m

Oct 14 23:32:37 Edison libmraa[3378]: [[1;39mlibmraa version v0.7.3 initialised by user 'root' with EUID 0[[0m

The application:

GNU nano 2.2.6 File: blink.c

# include

# include

# define HIGH 1

# define LOW 0

int led = 13;

int loopCount = 0;

int main () {

char* board_name;

mraa_gpio_context gpio;

mraa_result_t result;

printf ("Starting Blink Program on GPIO %d\n", led);

mraa_init ();

board_name = mraa_get_platform_name();

printf ("MRAA Version: %s \nRunning on %s\n", mraa_get_version (),

board_name);

mraa_set_log_level (7);

gpio = mraa_gpio_init (led);

result = mraa_gpio_dir (gpio, MRAA_GPIO_OUT);

if (result != MRAA_SUCCESS) {

printf ("Error in setting the direction %d\n", result);

}

printf ("Starting Blink Program\n");

result = mraa_gpio_write (gpio, HIGH);

if (result != MRAA_SUCCESS) {

printf ("Error in writing high to Pin %d/n", result);

}

sleep (10);

result = mraa_gpio_write (gpio, LOW);

if (result != MRAA_SUCCESS) {

printf ("Error in writi...

0 Kudos
Highlighted
Employee
189 Views

Hi,

I ran the code and got some unexpected results. First I updated to latest MRAA version which is 0.8.0. When running the code I didn't receive any errors but didn't see any blinking. When I received "Starting Blink Program" the LED remained ON the whole time and then it just turned OFF after the "Finished Blink Program". I ran the same command as you to compile. I also tried with the output of dmesg | grep pca953x. Every time I ran this command I received no output at all. I tried with two sessions opened, also tried running ./blink && dmesg | grep pca953x and lastly leaving the blink file running in the background but none of these methods ever produced an output in dmesg | grep pca953x.

I also took a look at the /sys/class/gpio directory. It shows more gpios available and I don't see the error you receive in the second symptom you describe in your first post.

Did you do any changes to the muxing configuration after you flashed to the latest image? Since the errors of your log file are related to libmraa I'd suggest you to reflash but don't do any changes in the muxing configuration and see if the contents of /sys/class/gpio remain the same and immediately after update MRAA to 0.8.0 with opkg install libmraa0 and try again.

I hope you find this useful.

Sergio

0 Kudos
Highlighted
New Contributor I
189 Views

Hi Sergio:

I appreciate you testing the program and getting back to me.

The program worked! Thank you for testing it. This was my first iteration and I was wanting to simply turn the onboard LED on and then off. My next iteration was to shorten the period and add an interrupt to the process.

The process that I used for the "re-build" of the board was:

1. Install the latest firmware. (Version 159)

2. Configure the Edison firmware (create root password, activate WIFI and name the board)

3. Install the nano editor

4. Install MRAA 0.7.3

5. Recover the blink.c program from backup

6. Compile the program.

I did not make any changes to the MUX configuration. Is there a way to tell what the configuration is or should be? I have not changed any physical pin configurations, however I can not rule out that it was shipped with improper pin configurations.

Finally, what is the potential for a hardware fault with the PCA953x GPIO expander? Is there anyway of testing?

Next step for me is to re-install the firmware and check the GPIO directory at each step.

Thank you,

David

0 Kudos
Highlighted
Employee
189 Views

Hi,

I found a thread that deals with a similar error . According to the answer the error appears because it is expecting Arduino expansion hardware and you are using a custom board. Have you tried, if possible, to test this in an Arduino expansion board?

Sergio

0 Kudos
Highlighted
New Contributor I
189 Views

Hi Sergio:

Simply to be clear I am using the expansion board which I believe has the PCA953x built into the board.

I did a fresh install of the firmware and before performing any configuration checked the dmesg | grep pca953x. Here are the results which are no different than before. Tests after each step in the configuration yielded the same results. I then when on to compare my board to a working expansion board. (See observations below screen capture.

root@edison:~# configure_edison --version

159

root@edison:~# dmesg | grep pca953x

[ 3.753340] [] pca953x_read_regs.isra.5+0x2f/0xd0

[ 3.753394] [] pca953x_probe+0x110/0x530

[ 3.753503] [] ? pca953x_irq_handler+0x260/0x260

[ 3.756459] [] pca953x_read_regs.isra.5+0x2f/0xd0

[ 3.756487] [] pca953x_probe+0x110/0x530

[ 3.756543] [] ? pca953x_irq_handler+0x260/0x260

[ 3.774301] pca953x 1-0020: failed reading register

[ 3.774380] pca953x: probe of 1-0020 failed with error -110

[ 6.772956] [] pca953x_read_regs.isra.5+0x2f/0xd0

[ 6.773010] [] pca953x_probe+0x110/0x530

[ 6.773119] [] ? pca953x_irq_handler+0x260/0x260

[ 6.776045] [] pca953x_read_regs.isra.5+0x2f/0xd0

[ 6.776073] [] pca953x_probe+0x110/0x530

[ 6.776128] [] ? pca953x_irq_handler+0x260/0x260

[ 6.793678] pca953x 1-0021: failed reading register

[ 6.793754] pca953x: probe of 1-0021 failed with error -110

[ 9.792376] [] pca953x_read_regs.isra.5+0x2f/0xd0

[ 9.792431] [] pca953x_probe+0x110/0x530

[ 9.792539] [] ? pca953x_irq_handler+0x260/0x260

[ 9.795432] [] pca953x_read_regs.isra.5+0x2f/0xd0

[ 9.795460] [] pca953x_probe+0x110/0x530

[ 9.795515] [] ? pca953x_irq_handler+0x260/0x260

[ 9.813265] pca953x 1-0022: failed reading register

[ 9.813341] pca953x: probe of 1-0022 failed with error -110

[ 12.811892] [] pca953x_read_regs.isra.5+0x2f/0xd0

[ 12.811947] [] pca953x_probe+0x110/0x530

[ 12.812056] [] ? pca953x_irq_handler+0x260/0x260

[ 12.814975] [] pca953x_read_regs.isra.5+0x2f/0xd0

[ 12.815003] [] pca953x_probe+0x110/0x530

[ 12.815058] [] ? pca953x_irq_handler+0x260/0x260

[ 12.832848] pca953x 1-0023: failed reading register

[ 12.832924] pca953x: probe of 1-0023 failed with error -110

root@edison:~#

 

Comparison to Working Board

 

 

I have now had a chance to see another intel edison expansion board and have a number of observations:

  • On my board, a 9V 1 A power supply generates considerable heat. So hot it can not be touched. On the 'working' expansion board it runs very cool to the touch.
  • Even with power supplied by the USB computer port my edison is warm

     

  • On boot sequence on the 'working' expansion board the LED DS2 lights during the boot sequence (for about 5 seconds approximately). On my board this has never happened from the day I got the board.
  • On there working board, there are no messages during the boot sequence for PCA953x. (dmesg | grep pca953x)

     

  • I did come across a similar thread talking about the Edison the unit getting hot. It is not identical.

     

I am wondering if I need to conclude the board has some type of hardware fault and obtain a warranty replacement. Any thoughts?

Thank you,

David

0 Kudos
Highlighted
Employee
189 Views

Hi,

The Edison should never get that hot. If it gets so hot it can't be touched then most likely the board has some sort of hardware damage.

I'd suggest you to contact the Warranty team here: http://www.intel.com/support/mailform/maker/edisonwarrantyemail.htm Intel Support .

Sergio

0 Kudos