(Solved) Simple GPIO led test not working

Hi there,

i’m a real hardware noob, but i tried to get a led (with integrated resistor) lid up at the GPIO Port 0. But it did not work. If i attach the led to between GND and 3.3V it lights up. But not wenn attached to GPIO 0 set to output and HIGH.

Is the GPIO Port 3.3V on high? Or is this a problem with the current firmware changes (FPGA addresses)? Has someone else got GPIO working the last days?

regards

It should work. I can try to replicate today. Few questions:

  • Are you testing with a MATRIX Voice or a Creator board?
  • Are you using a resistor? What value are you using (ohms)?
  • Did you try both level values (LOW and HIGH)?

Yoel

Hey yoel,

thank’s for your reply.

  • it’s a creator board.

  • led = i think it has a integrated 220 ohm resistor, but not sure

when i have my multimeter attached, i can not meassure anything on 0 the other pins not 0 have a slight amplitude of 0.1 V

my code is:

namespace hal = matrix_hal;
#define INPUT 0
#define OUTPUT 1
#define PIN_0 0

int main() {
  hal::WishboneBus bus;
  bus.SpiInit();

  hal::GPIOControl gpio;
  gpio.Setup(&bus);

  gpio.SetMode(PIN_0, OUTPUT);

  uint16_t write_data = 1; // tried also 0
  gpio.SetGPIOValue(PIN_0, write_data);

  return 0;
}

oops short update, after executing the above code, something get;s broken:

/usr/share/matrixlabs/matrixio-devices/fpga_info
IDENTIFY = ffffffff
VERSION = 0

maybe i broke something…

Trying to replicate now …

Hello @loom

Could you run the following steps:

  1. Plug Off and On your device and then:
    [Solved] Matrix-creator-hal not work

I’m looking forward to your answer.

Kevin

installed packages:

ii  libmatrixio-creator-hal:armhf         0.2.0                                armhf        Hardware Abstraction Layer for     MATRIX.
ii  libmatrixio-creator-hal-dev           0.2.0                                armhf        Hardware Abstraction Layer for MATRIX (headers)
ii  libmatrixio-malos:armhf               0.1.2                                armhf        Libraries of MATRIX abstraction layer for MOS
ii  libmatrixio-malos-dev                 0.1.2                                armhf        Libraries of MATRIX abstraction layer for MOS
ii  libmatrixio-protos:armhf              0.1.1                                armhf        Protocolbuffers for MATRIX abstraction layer
ii  libmatrixio-protos-dev                0.1.1                                armhf        Protocolbuffers headers for MATRIX abstraction layer
ii  libswresample2:armhf                  7:3.2.10-1~deb9u1+rpt1               armhf        FFmpeg library for audio resampling, rematrixing etc. - runtime files
ii  matrixio-creator-init                 0.4.1                                armhf        Install scripts that can program the MATRIX Creator FPGA and SAM3 IMU.
ii  matrixio-malos                        0.3.0                                armhf        Allows queries to MATRIX Creator hardware via ZMQ.
ii  matrixio-malos-wakeword               0.1.4                                armhf        Voice commands for MATRIX Creator hardware via ZMQ callback.
ii  matrixio-openocd                      1.0.1                                armhf        Open on-chip JTAG debug solution for ARM and MIPS systems
ii  matrixio-pocketsphinx                 0.1.0                                armhf        This is PocketSphinx, one of Carnegie Mellon University's open source large
ii  matrixio-protobuf                     3.4.0                                armhf        Protocol Buffers - Google's data interchange format. (From GRPC 3.4.0)
ii  matrixio-sphinxbase                   0.1.0                                armhf        This is PocketSphinx, one of Carnegie Mellon University's open source large
ii  matrixio-xc3sprog                     1.1.1                                armhf        Spartan3, XCF and CPLD JTAG programmer and other utilities.

fpga_info before gpio_demo in the examples:

IDENTIFY = 5c344e8
VERSION = 10005

and after the gpio_demo:

IDENTIFY = ffffffff
VERSION = 0

i just have cloned the hal repo and tried it with the current master branch:
https://github.com/matrix-io/matrix-creator-hal.git

Just by executing the code? Did you also connect the LED?

Can you share specs of the LED used (maybe just a photo) and explain how you did the connection?

Thank you

i only run the gpio_demo with nothing attached to the GPIOs, to get the behavior from my last post. i have also disabled all malos services

Hello @loom

We found the issue, so it has been fixed in our new release https://github.com/matrix-io/matrix-creator-init/releases/tag/v0.4.2

Could you run:

sudo apt update
sudo apt upgrade

Thank You,

Kevin Patino

You are the best!!! Thanks for fixing it, i’m so happy that it’s not a hardware problem with my device!