-->
Page 1 of 2

Custom firmware user_main.c required code

PostPosted: Mon Jul 27, 2015 10:55 pm
by Ygneh
I have been through a LOT of material on the ESP8266.

What I have not been able to find is a clear description of what is required when writing custom firmware in C.

Specifically,

What includes are required in user_main? I see ets_sys.h, uart.h, and others in a lot custom code on the web, but no description of what they do, and why they are needed.

What functions are required in user_main? user_init is, and is where user code starts.

What other files are required?

I feel like the whole ESP8266 community grew so fast that the people who started with it in the beginning assume others know a lot more than they think. I have yet to find a comprehensive beginning guide, or any tutorial/example that does not skip directly to inserting code into user_init.

I can program an ESP8266 in C just fine, but I can't help but feel like I'm a cave man who learned to drive a car. Gas, brake, steering wheel. I know the result of using them, just not how they accomplish that result. (excuse the terrible analogy :| )

Does anyone know of any resources? Can anyone explain it (or some?)

Thanks, Ygneh

Re: Custom firmware user_main.c required code

PostPosted: Tue Jul 28, 2015 2:20 pm
by kenn
Well, that's part of the charm of the ESP8266 - it's a mystery to unravel. :mrgreen:

Quite honestly I don't have an answer. Like most people learning a new codebase, I got started simply by finding a working example, then hacking that into what I want. Many people have helped solve issues and the public body of knowledge on the ESP8266 is getting pretty big... but it's certainly not yet thorough. Espressif isn't MicroChip or AMD or TI...

Now, Espressif have been working hard at improving this. Their documentation has improved significantly since last fall, and there's been steady improvement in the SDKs as well. Be sure to read the latest.

Finally, there are some great frameworks for ESP8266 out there (as listed in the Platforms section of this forum) that have done alot of the heavy lifting, and they've done a good job of putting a sensible, easy to use API over top of the ESP's complexity. You don't need to have intimate knowledge of the ESP8266 SDK to use these frameworks and get good results.

Re: Custom firmware user_main.c required code

PostPosted: Tue Jul 28, 2015 3:48 pm
by tytower
My suggestion with your C programming skill is download and use the free Arduino IDE. It has a section for ESP8266 with all the examples you could wish for in easy to understand form and you can just get things going and look as deep as you feel necessary when you want to.
http://www.arduino.cc/
Its all Free

Re: Custom firmware user_main.c required code

PostPosted: Wed Jul 29, 2015 8:40 am
by Ygneh
kenn wrote:You don't need to have intimate knowledge of the ESP8266 SDK to use these frameworks and get good results.


I'm the type of guy who wants to know!

I was never satisfied when I started with Arduino. I moved on to PIC, AVR very fast. Most recently ARM. I started with assembly each time.

I know C pretty well. I was just hoping there was a resource that could get me up to speed quickly instead of me going through all the code myself.