You can chat about native SDK questions and issues here.

User avatar
By Agentsmithers
#67959
davydnorris wrote:This is my Makefile (modified version based heavily on work by CHERTS) for NonOS projects. You can use this as the basis of your own compile.

Up top you can see options for setting the size of your flash, and how to compile - for area 1 or area 2 in a FOTA build, or 0 for a non FOTA. Your current blinky is being built for a non FOTA build

Hope this helps


DavydNorris,
If this works.... I love you...

Edit:
[osboxes@osboxes blinky]$ make clean
Makefile:19: *** Recursive variable `SDK_BASE' references itself (eventually). Stop.

Are you getting this as well?

Edit2:
I updated the following in the makefile to try to get it to fly and I got this
Code: Select all#############################################################
#
# Root Level Makefile
#
# Version 2.3
#
# Based heavily on the Makefile by CHERTS <sleuthhound@gmail.com>
# and included in his Espressif Development Kit
#
#############################################################

BUILD_BASE   = build
FW_BASE     = firmware

XTOOLS_HOME  ?= /home/osboxes/esp-open-sdk/xtensa-lx106-elf

# Base directory for the compiler
XTENSA_TOOLS_ROOT ?= ${XTOOLS_HOME}/bin

# base directory of the ESP8266 SDK package, absolute
SDK_BASE  ?= /home/osboxes/esp-open-sdk


[osboxes@osboxes blinky]$ make all
AR build/app_app.a
LD build/app.out
/home/osboxes/esp-open-sdk/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.5/../../../../xtensa-lx106-elf/bin/ld: cannot open linker script file /home/osboxes/esp-open-sdk/ld/eagle.app.v6.new.2048.ld: No such file or directory
collect2: error: ld returned 1 exit status
make: *** [build/app.out] Error 1
[osboxes@osboxes blinky]$
User avatar
By davydnorris
#67971 OK,

First of all, thank you and I am flattered but I am a married man :-D

Secondly, I use this Makefile inside Eclipse and inside a cygwin environment, so it may not work first go for you but there are a couple of assumptions that all environments make:

- you have a compiler tool chain installed (I use esp_open_sdk) and XTOOLS_HOME is pointing to the top of it. If I go to ${XTOOLS_HOME}/bin I find my compiler "xtensa-lx106-elf-cpp"
- you have the ESP NonOS SDK of your choice (I'm using NONOS 2.1.0) installed and SDK_BASE is pointing to the top of it. If I go to ${SDK_BASE}/ld I find the linker script eagle.app.v6.ld
- you have the extra libraries installed with either the toolchain or the SDK and USR_BASE is pointing to the top. If I go to ${USR_BASE}/lib I find libcirom, liblwip_open, libmbedtls etc.

The only other thing you may need to change is the location of esptool. I have mine in ${XTOOLS_HOME}/bin

Hope that gets you further
User avatar
By Agentsmithers
#67999
davydnorris wrote:OK,

First of all, thank you and I am flattered but I am a married man :-D

Secondly, I use this Makefile inside Eclipse and inside a cygwin environment, so it may not work first go for you but there are a couple of assumptions that all environments make:

- you have a compiler tool chain installed (I use esp_open_sdk) and XTOOLS_HOME is pointing to the top of it. If I go to ${XTOOLS_HOME}/bin I find my compiler "xtensa-lx106-elf-cpp"
- you have the ESP NonOS SDK of your choice (I'm using NONOS 2.1.0) installed and SDK_BASE is pointing to the top of it. If I go to ${SDK_BASE}/ld I find the linker script eagle.app.v6.ld
- you have the extra libraries installed with either the toolchain or the SDK and USR_BASE is pointing to the top. If I go to ${USR_BASE}/lib I find libcirom, liblwip_open, libmbedtls etc.

The only other thing you may need to change is the location of esptool. I have mine in ${XTOOLS_HOME}/bin

Hope that gets you further


You being married doesn't bother me, I've broken up a marriage before..... Shout out to Mom and Dad :(

Anywho, I'll give it a shot later today. *Fingers crossed* Thank you sir.

[osboxes@osboxes blinky]$ make
LD build/app.out
/home/osboxes/esp-open-sdk/ESP8266_NONOS_SDK-2.1.0/lib/libmain.a(app_main.o): In function `flash_data_check':
(.irom0.text+0x7bc): undefined reference to `user_rf_cal_sector_set'
/home/osboxes/esp-open-sdk/ESP8266_NONOS_SDK-2.1.0/lib/libmain.a(app_main.o): In function `flash_data_check':
(.irom0.text+0x7cc): undefined reference to `user_init'
/home/osboxes/esp-open-sdk/ESP8266_NONOS_SDK-2.1.0/lib/libmain.a(app_main.o): In function `flash_data_check':
(.irom0.text+0x973): undefined reference to `user_rf_cal_sector_set'
/home/osboxes/esp-open-sdk/ESP8266_NONOS_SDK-2.1.0/lib/libmain.a(app_main.o): In function `flash_data_check':
(.irom0.text+0xbee): undefined reference to `user_init'
collect2: error: ld returned 1 exit status
make: *** [build/app.out] Error 1
[osboxes@osboxes blinky]$


After modifying some of the variables I am now getting this. I am getting warmer but after researching it says to edit my main.c but I don't have a main.c I just have a Blinky.c?

With your open-esp-sdk do you have a blinky,c in your example, Are you able to compile it correctly?
Thanks again for your chime in.

It sounds like I may need to just ditch linux and setup Cygwin.
User avatar
By davydnorris
#68010 No no you are really close!

Can you show your full build log? Is the actual blinky code being compiled and included in the link step?

The Makefile assumes a standard layout for your code, which most projects out there do use but maybe your blinky is not quite set up that way (the blinky in esp_open_sdk isn't). The project structure is as follows:

/
/user <--- your user provided code for your custom solution
/include <--- your user provided include files at top level here
/driver <--- any ESP driver code for things like UART, SPI, I2C, I2S etc
/include/driver <--- include files for the above

other library modules may also be included in their own directories as you see fit.

The Makefile as I posted it is looking for your user code in the /user dir, so move the blinky.c in there, and the user_config.h file into the /include dir, then try to make. You can also change the Makefile to suit your structure.

This is the pitfall of just hitting the big red button without knowing what's happening - worth going through the make file and looking at what it is doing!

See if that helps