Discuss here different C compiler set ups, and compiling executables for the ESP8266

User avatar
By Tucson Tom
#37195 Wow, three replies, on Christmas day. Like gifts, thanks! :D

Basic is out for me. I am an old hand at C and Makefiles. The Arduino route is out for similar reasons. I have spent the better part of a day beating a Makefile into a shape that I like (mostly ripping out extra fluff) and getting familiar with esptool (the python version), and am happy to report I just got my hello world program to run, but I get output that looks like this:

Hello, world!
mode : softAP(1a:fe:34:d4:xx:xx)
add if1
dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
bcn 100
chg_A3:-180
chg_A3:0
chg_A3:-180
chg_A3:0
chg_A3:-180
....

This is definitely progress. Apparently all the chg_A3 messages have something to do with the ESP8266 is adjusting its frequency offset, but it would be nice to make this go away until I actually want to use the wireless. I am now looking into something called: ESP8266_NONOS_SDK_V1.5.0_15_11_27.

As for Lua, it actually seemed well behaved, and I got a demo using the bmp180 i2c sensor to work, but had to do some tricks to get it to fit into what little memory NodeMCU left for user scripts. It seems to me that the bulk of the chip resources are being used to run NodeMCU, which would be fine if that was all the world was about, but having nothing left over for applications is kind of lame. My hope is that by writing C code myself, I will have all the code space being used by NodeMCU and Lua (which I understand is thousands of lines of C) for my own use.
User avatar
By kenn
#37200 It never made sense to me to use an interpreted script language on a microcontroller with limited resources (my bias; many are getting good results with the interpreted languages), and I'm used to C on PIC, so I started out with Espressif's C SDK. But I'm not hardcore with C, so I found it a tough slog. I tried amd liked the Sming framework - it's C++, leverages the many tested Arduino libraries, and I found it alot easier to get stuff working with it. It still compiles down to a fairly efficient size.
User avatar
By Tucson Tom
#37203 Thanks Kenn,

I certainly agree about using an interpreted language on a limited platform. On the other hand, I can frankly get the first 3 projects I have in mind to work fine with under 100 lines of Lua, so it isn't a show stopper for me yet in actuality, but just seeing the edge of the world looming so close makes me nervous. I spent some time fiddling with my Makefile and getting the 1.50 SDK to replace 1.4.0. Haven't gotten rid of the chg_A3 messages yet though. My notes are at:
http://cholla.mmto.org/esp8266/sdk/open.html
User avatar
By dkinzer
#37327
Tucson Tom wrote:Apparently all the chg_A3 messages have something to do with the ESP8266 is adjusting its frequency offset, but it would be nice to make this go away until I actually want to use the wireless.
You might try invoking os_install_putc1() with a pointer to a do-nothing function early in your app. Doing so may suppress the OS messages.