GPIO example not working


I implemented the wiringPi example [], connected an LED with resistor on the physical pin 26, which corresponds to wPi pin 1, and the LED doesn’t blink. The code compiles well, with no errors, and when executed it appears on the terminal “wPi Pin 1 now is HIGH wPi Pin 1 now is LOW” correctly, but the LED doesn’t blink.
What can I do or what is wrong?

I’m using the board for robotics purposes so I must need to make work the GPIO pins.

GPIO is having lots of trouble… are you polling the pins or attaching interrupts?

I’m not using none of that, I only run the example exactly as is it on the page.

polling is the programming technique where you read the values constantly, in this case using analogRead or digitalRead. Using interrupts let’s you wait for chnages…

Anyway, you are using digitalWrite for the LED output. You need to check if that pin is being used by the OS for another function (Serial, I2S, I2C, etc). A quick test would be to change the pin to another gpio.

Another unlikely possibility: is the LED connected the right way?

For current stage, GPIOs in AO domain are not supported. So that you can’t use GPIOAO_*.

Because the DTS is configured as non AO domain. We’ll add support for AO domain GPIOs in next release.

Can you try other GPIOs, like GPIOA_*, GPIOH_*


1 Like

Ok I tried with EVERY GPIO pin and only GPIOH_* works, non GPIOA_* neither GPIOZ_*, that means that there’s only available 3 GPIO pins on the board (H4, H6 and H7).

@EmbeddedMaster GPIOA and GPIOZ works,I check it again now.

@EmbeddedMaster Hello,they have been redirected to other function pins. If you need to use these pins with wiringPi, you need to modify DTB .

How can I do that? What is DTB?

Ok could you provide the wiringPi program you used?

@EmbeddedMaster The sample demo is the same as you .If you need to use those pins. You need to clone the fenix with our github.Then edit the dtb file . Then rebuild it to get a new image.

DTB file is the configuration file of kernel

As an average buyer it is suppose that I have to know how to modify a kernel?
Ok the only thing I really need of this board is the I2C communication through wiringPi library, is that available and working? And if so, through wich pins?

I can’t use the hardware I2C. The hardware I2C is only supported by raspberry pie. I haven’t tested the software I2C, and I don’t use much of the wiring PI itself. After the migration, I have tested the basic functions.If you use the software I2C, you can use either

Then why on the board specifications is said that I2C is available trough the 40-pin header? Where are the tools for using I2C communication? If I use soft I2C I will kill most of the processing resources of the CPU, not an option.
What about UART? (for communication to another processor, not for debugging).

@EmbeddedMaster It can be used on the 40pin, but not on the wiringpi. You need to use the hardware I2C in other ways. The functions on the 40pin are all available, but not all functions are suitable for the wiringpi

Ok how can I use I2C on a C program? I need the documentation and an example program.

1 Like

@EmbeddedMaster Sorry , It doesn’t have example there. but you can find some demo on stackOverflow

Hei together,

around this theme had and has I and my team also questions yo can find some of this here under VIM3. Until today we received no professional help or answer to our for Khadas easy problems.
We have absolutely no understanding that fact, that are series boards VIM1…3 on the market, where are the simplest things do not work.
There is a pin description from Khadas for the 40 PIN GPIO + Schematic. When I read words like “is only possible with Raspberry Pi X” or “WiringPi” does not support these features, then I have to ask me,
“Do the Chinese want us buyers to represent as Stupid Sheep?”
We have a good tip, create a Function like “WiringVIM” with the functionality
that the Khadas boards GPIO pinout can be used, not that of one Raspberry devirat. The problem with the different Ubuntu variants still exists.
TS050 does not work with Ubuntu 4.9…, the latest version Ubuntu 5.3… works only conditionally. Fact is also that our own evolution, based on the
VIM3 pro boards, are currently a big disaster. If Khadas does not remedy
this professionally very soon, we have to go back to the Windows based systems like Kontron or Congatec.
We will of course be inform our distributors as DigiKey and Reichelt.

Greeting from kwklaus (Kongsberg Groups) Norway.


Completely agree with that. Is amazing how basic tasks of the board are not supported yet.
As I mentioned before, I will use the board for robotics purposes with computer vision algorithms, but with only three GPIO working, no I2C documentation for communicate with another processor, no compatible CSI cameras yet, I can do nothing with the project.
It’s a shame because the board has an amazing processing power, I’ve been testing it, and excellent hardware resourses, small size and accesible price. I chose this board instead the Odroid N2 for these reasons.
About the help provided by Khadas the same thing. See it by yourself.

Ok, stackoverflow WHERE? I opened the page, type on the search panel “VIM3 I2C”, and how many results it found? 0.
Is it too much to ask to paste the direct link?

Ok, I’ve got a PhD degree in Computer Science, I can do that with eyes closed. I’ve been working with DTB files and modifying OS kernels for years. Piece of cake. (?)

1 Like