Matrix Voice ESP32: problem with Build and Make


#1

Hi,
my hardware is:
Raspberry Pi 3 B and Matrix Voice ESP32.

I followed the Hackster guide, but when I launch make flash I got these errors:

pi@raspberrypi:~/esp/hello_world $ make flash
make: xtensa-esp32-elf-gcc: comando non trovato
expr: errore di sintassi
/bin/sh: 1: xtensa-esp32-elf-gcc: not found
/bin/sh: 1: xtensa-esp32-elf-gcc: not found
Toolchain path: 
WARNING: Failed to find Xtensa toolchain, may need to alter PATH or set one in the configuration menu
GENCONFIG
make: xtensa-esp32-elf-gcc: comando non trovato
expr: errore di sintassi
make[1]: xtensa-esp32-elf-gcc: comando non trovato
expr: errore di sintassi
/bin/sh: 1: xtensa-esp32-elf-gcc: not found
/bin/sh: 1: xtensa-esp32-elf-gcc: not found
WARNING: Failed to find Xtensa toolchain, may need to alter PATH or set one in the configuration menu
make[1]: xtensa-esp32-elf-gcc: comando non trovato
expr: errore di sintassi
CC build/bootloader/bootloader_support/src/bootloader_flash.o
make[2]: xtensa-esp32-elf-gcc: comando non trovato
/home/pi/esp/esp-idf/make/component_wrapper.mk:285: set di istruzioni per l'obiettivo "src/bootloader_flash.o" non riuscito
make[2]: *** [src/bootloader_flash.o] Errore 127
/home/pi/esp/esp-idf/make/project.mk:505: set di istruzioni per l'obiettivo "component-bootloader_support-build" non riuscito
make[1]: *** [component-bootloader_support-build] Errore 2
/home/pi/esp/esp-idf/components/bootloader/Makefile.projbuild:41: set di istruzioni per l'obiettivo "/home/pi/esp/hello_world/build/bootloader/bootloader.bin" non riuscito
make: *** [/home/pi/esp/hello_world/build/bootloader/bootloader.bin] Errore 2

How can I solve?
Thanks
Regards
Salva


#2

The make stuff should be done on your PC, not the Pi

  • Step 1: Raspberry Pi
  • Step 2: Personal Computer
  • Step 3 and further ==>> PC as well

#3

Yes I did it, Matrix voice was plugged into the gpio and simultaneously connected through micro usb to my laptop: “make flash” still not working.

I really don’t know how to flash it, I followed guide step by step.

Thanks.
Regards
Salva


#4

Why? That is not in the guide? Just attach the voice to the Pi and power the Pi. Connecting to your PC is not needed.
And you should not “make flash”, but “make deploy”
Furthermore, your screenshot does NOT show that you are trying to build one of the examples.
Hello world is NOT in the guide.


#5

Yes it is in the hackster’s guide: “Setup ESP-IDF development framework”


#6

Ahhh, that is a totally incorrect guide for the Matrix Voice.

Start over, using this: https://www.hackster.io/matrix-labs/get-started-w-esp32-on-the-matrix-voice-d01e0d

or

https://matrix-io.github.io/matrix-documentation/matrix-voice/esp32/


#7

I followed the links above…but the problems remain:

  1. After configuring Raspberry “Step 1”, I have 1 raspberry and 1 matrix voice connected to raspberry’s GPIO, the guide says:
    set
    Regarding “Step 2”, I need an additional pc or I can do it through raspberry?! Using a pc I unplug Matrix voice (from Raspberry’s GPIO) and I connect it to the laptop, then I start toolchain installation. Is it correct procedure?

  2. after installing the toolchain into ~/esp/xtensa-esp32-elf/ directory, and setup path environment variable, I check the toolchain’s path by the command printenv PATH and it returns path correctly; but when I try to test xtensa-esp32-elf-gcc -v it doesn’t work.

  3. another problem is the opening of serial port, even using putty and installing drivers, no way to open. Could you suggest me a simple way?

Thanks
Regards
Salva


#8
  1. Regarding Step 2, it is like it says on the text: Personal Computer Setup.
    So, you need to do step 2 on your computer.
    But in the guide there is no direction as to disconnect the voice from the Pi and attach it to your PC, so don’t do it.
    The Voice remains attached to the PC the whole time.

To be more clear: Do step 1, and leave to Pi and Voice alone and powered on for the rest of the guide.

  1. I do not know why that test fails, but is also NOT in the guide that you should test it. The PATH looks ok.

  2. Opening what serial port? And why?

Dude, you really need to follow the guide to the letter. Nothing more, nothing less.


#9

Thanks again for your support!
I’m a linux newbie so many things, even simple for you, look a little bit complicated for me; with reference to point 3. When I lauch make menuconfig -> Serial flasher config -> Default serial port
I found ttyUSB0 but when I have previously checked port on linux, using the command: ls /dev/tty*
I haven’t found ttyUSB0 port, but other ports such as ttyS0. Following the guide I’m not able to determine the exact port and so , for instance, solve “permission issues as needed with the /dev/ttyUSB0”.

Thanks
Salva


#10

ok, but WHY do you " menuconfig -> Serial flasher config -> Default serial port"?

That is not in the guide, that just says “make menuconfig”, after that you can just exit via euh well, the EXIT button


#11

Ok let’s step back.
At the moment I’m following this https://docs.espressif.com/projects/esp-idf/en/latest/get-started/establish-serial-connection.html, because I need to establish serial connection with ESP32, everything is ok for points 1,2,3
1.make ( your cp210x driver )
2. cp cp210x.ko to /lib/modules/<kernel-version>/kernel/drivers/usb/serial
3. insmod /lib/modules/<kernel-version/kernel/drivers/usb/serial/usbserial.ko

  1. insmod cp210x.ko -->here I have had a problem after I have typed the command. This is the error:
    insmod: ERROR: could not insert module cp210x.ko: Invalid module format.

Do you know why?

P.s. I’m reading a lot of threads about thettyUSB0 port opening, and it seems that hundreds of users have the same probIem. I tried to check the serial port of my Matrix Voice; as suggested in the guide I typed ls /dev/tty* with matrix voice connected and I typed ls /dev/tty* without matrix voice connection: but I didn’t find ttyUSB0 port, nothing happens, plugging or unplugging device; don’t appear or disappear a serial port.

thanks


#12

Ok, let me restate this: You cannot use the ESP32 of the Voice is the same way as a NodeMCU.
You cannot establish a serial connection to it by connecting it to a PC.

In short, what you try WILL NOT WORK

Followup question, what do you want to use the Matrix Voice for?


#13

I’m going to use Matrix Voice as a microphone that detects sounds and music and through a c++ code turn them to spectrum colors.

p.s. I’m trying to establish serial connection with ESP32 using a PC with linux OS


#14

Establishing a serial connection with the ESP32 chip on the Matrix Voice via a PC will NOT work.

You have to program the ESP32 in another way, you have two options:

  1. Follow this guide: https://matrix-io.github.io/matrix-documentation/matrix-voice/esp32/ and start with the mic_energy or another example to learn how to use and flash the Matrix Voice
  2. Dive into my code here: https://github.com/Romkabouter/Matrix-Voice-ESP32-MQTT-Audio-Streamer and learn how you can flash the Matrix Voice via the Arduino IDE

Since you say you want to code c++, I suggest option 1.


#15

Hi,
I’m Cloning MATRIX Voice ESP32 repository, I’m doing Step 3: Build and Deploy; IDF (one time setup) configuration is ok, unfortunately aftermake deploy command, I get the following error:

**************************************************************
Programming the ESP32 in MATRIX Voice through the Raspberry PI
**************************************************************
pi@192.168.111.38's password:
-----------------------------------
esptool.py wrapper for MATRIX Voice
-----------------------------------
usage: esptool write_flash [-h] [--flash_freq {keep,40m,26m,20m,80m}]
                           [--flash_mode {keep,qio,qout,dio,dout}]
                           [--flash_size FLASH_SIZE]
                           [--spi-connection SPI_CONNECTION] [--no-progress]
                           [--verify] [--compress | --no-compress]
                           <address> <filename> [<address> <filename> ...]
esptool write_flash: error: argument <address> <filename>: Address "/tmp/build/ota_data_initial.bin" must be a number
oem@salsa123:~/matrixio_hal_esp32/examples/everloop_demo$ make menuconfig
Toolchain path: /home/oem/esp/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc
Toolchain version: crosstool-ng-1.22.0-80-g6c4433a
Compiler version: 5.2.0
MENUCONFIG


*** End of the configuration.
*** Execute 'make' to start the build or try 'make help'.

oem@salsa123:~/matrixio_hal_esp32/examples/everloop_demo$

#16

I see you got a little further, nice :slight_smile:

What is the result when you do make after manke menuconfig?


#17
  1. after digit make menuconfig:

    oem@salsa123:~/matrixio_hal_esp32/examples/everloop_demo$ make menuconfig
    Toolchain path: /home/oem/esp/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc
    Toolchain version: crosstool-ng-1.22.0-80-g6c4433a
    Compiler version: 5.2.0
    MENUCONFIG

    *** End of the configuration.
    *** Execute ‘make’ to start the build or try ‘make help’.

  2. after digit make deploy:
    Programming the ESP32 in MATRIX Voice through the Raspberry PI


    voice_esptool --chip esp32 --port /dev/ttyS0 --baud 115200 --before default_reset --after hard_reset write_flash -u --flash_mode dio --flash_freq 40m --flash_size detect 0
    pi@192.168.111.38’s password:

    esptool.py wrapper for MATRIX Voice

    usage: esptool write_flash [-h] [–flash_freq {keep,40m,26m,20m,80m}]
    [–flash_mode {keep,qio,qout,dio,dout}]
    [–flash_size FLASH_SIZE]
    [–spi-connection SPI_CONNECTION] [–no-progress]
    [–verify] [–compress | --no-compress]
    [ …]
    esptool write_flash: error: argument : Must be pairs of an address and the binary filename to write there


#18

yeah ok, but what about just make? Does is compile? SO, without the deploy


#19

yes it does but it doesn’t deploy , maybe an error on Matrix Voice code, the bash code inside deploy.mk file maybe not correct.


#20

Here is a topic about a similar error: