cnlohr / colorchord

Chromatic Sound to Light Conversion System

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem building from source

sanchosk opened this issue · comments

I am trying to build the firmware on my ubuntu box for Wemos D1 mini.
I cloned the project, build the toolchain and included it into path.
When trying to build it using make all in the embedded8266 folder, I first received an error about missing libc.a.
I copied it manually from the SDK folder (xtensa-lx106-elf/xtensa-lx106-elf/sysroot/lib/libc.a) to esp-open-sdk/esp_iot_sdk_v1.5.2/lib/ folder.
That seemed to help a bit, I've got a little further in the compilation.
However, it went down again with error
make: *** [esp82xx/main.mf:129: image.elf] Error 1
I've checked the make file, but I have no clue what is going on to be honest.
This is the full build log:
gist

Any hints on what am I doing wrong? I have no clue how to continue. Myself, I program esp8266 using Arduino, so this is completely new :(

It looks like you're using a really wrong version of stuff... So I can't really help you from where you are now... but... Make sure to get a clean build downloaded, i.e. delete and re-checkout, then type 'make' and give me the gist of the entire operation.

All tools/SDKs/etc. should be automatically downloaded beyond the instructions on esp82xx.

I did the following:

  • Brand new ubuntu install
  • Installed git and build-essential.
  • cd to home directory
  • git clone --recursive https://github.com/pfalcon/esp-open-sdk.git
  • cd to esp-open-sdk
  • install all the dependencies: make unrar-free autoconf automake libtool gcc g++ gperf
    flex bison texinfo gawk ncurses-dev libexpat-dev python-dev python python-serial
    sed git unzip bash help2man wget bzip2 libtool-bin
  • make
  • updated .profile to include the path, also included export ESP_ROOT=/home/username/esp-open-sdk
  • reboot to apply the path and variable
  • cd ~; git clone --recursive https://github.com/cnlohr/colorchord.git
  • cd colorchord/embedded8266
  • make all
    This time it worked like a charm, no problem.
    So I'll investigate what is my issue at home PC.
    Thanks, closing issue.

Let me know the issue, since I think most people don't want to reinstall their system just to build colorchord :-p

Seems like the mail problem is missing definition of partition_item_t.
When building from the clean repo, I only have warnings like
user/ws2812_i2s.c:462:2: warning: large integer implicitly truncated to unsigned type [-Woverflow]
~0b1100110010001000, ~0b1100110010001100, ~0b1100111011001000, ~0b1100110011001100,
^

But when building from the "modfied" one (only updated configuration to work with 24 leds, not 541, I have a lot of errors like
esp82xx/fwsrc/esp82xxutil.c:322:1: error: unknown type name 'partition_item_t'
static const partition_item_t partition_table_opt2[] =
^
Filtering for errors, I got
esp82xx/fwsrc/esp82xxutil.c:322:1: error: unknown type name 'partition_item_t'
esp82xx/fwsrc/esp82xxutil.c:319:46: error: 'SYSTEM_PARTITION_CUSTOMER_BEGIN' undeclared here (not in a function)
esp82xx/fwsrc/esp82xxutil.c:326:7: error: 'SYSTEM_PARTITION_RF_CAL' undeclared here (not in a function)
esp82xx/fwsrc/esp82xxutil.c:327:7: error: 'SYSTEM_PARTITION_PHY_DATA' undeclared here (not in a function)
esp82xx/fwsrc/esp82xxutil.c:328:7: error: 'SYSTEM_PARTITION_SYSTEM_PARAMETER' undeclared here (not in a function)
esp82xx/fwsrc/esp82xxutil.c:331:1: error: unknown type name 'partition_item_t'
esp82xx/fwsrc/esp82xxutil.c:333:5: error: initializer element is not constant
esp82xx/fwsrc/esp82xxutil.c:333:5: error: (near initialization for 'partition_table_opt3[0]')
esp82xx/fwsrc/esp82xxutil.c:334:5: error: initializer element is not constant
esp82xx/fwsrc/esp82xxutil.c:334:5: error: (near initialization for 'partition_table_opt3[1]')
esp82xx/fwsrc/esp82xxutil.c:335:5: error: initializer element is not constant

To me it looks like I am using some different ESP libraries because it does not recognize the variable type partition_item_t.

After 45 minutes of fiddling I found out the problem was in user.cfg - I manually pointed it out to my folder with ESP IOT, but this one was not working as expected. Commenting out those 2 lines (SDK_DEFAULT and SDK) made it compile.
So, as always, the problem was in-between the chair and the keyboard. Now I need to find out why do the SDKs differ.

Ooohhh ok. That makes sense. I am glad you have this here. It will likely help someone else out :)

So I still have a problem.
I can build the source with four_sample enabled with no error, but the LEDs do not work on my Wemos D1 mini.
I tried to follow the advice in my other issue and change it to three_sample.
As soon as I did, I received error message
user/ws2812_i2s.c:531:42: error: 'WS_BLOCKSIZE' undeclared (first use in this function) while( bufferpl < &((uint8_t*)i2sBlock)[WS_BLOCKSIZE] ) *(bufferpl++) = 0; ^ user/ws2812_i2s.c:531:42: note: each undeclared identifier is reported only once for each function it appears in make: *** [esp82xx/main.mf:129: image.elf] Error 1
I had to edit the user/ws2812_i2s.h and at the WS_BLOCKSIZE0-2 add a new line with
#define WS_BLOCKSIZE 4000

Now it builds no problem.