33 Commits

Author SHA1 Message Date
Johny Mattsson
526d21dab4 Major cleanup - c_whatever is finally history. (#2838)
The PR removed the bulk of non-newlib headers from the NodeMCU source base.  
app/libc has now been cut down to the bare minimum overrides to shadow the 
corresponding functions in the SDK's libc. The old c_xyz.h headerfiles have been 
nuked in favour of the standard <xyz.h> headers, with a few exceptions over in 
sdk-overrides. Again, shipping a libc.a without headers is a terrible thing to do. We're 
still living on a prayer that libc was configured the same was as a default-configured
xtensa gcc toolchain assumes it is. That part I cannot do anything about, unfortunately, 
but it's no worse than it has been before.

This enables our source files to compile successfully using the standard header files, 
and use the typical malloc()/calloc()/realloc()/free(), the strwhatever()s and 
memwhatever()s. These end up, through macro and linker magic, mapped to the 
appropriate SDK or ROM functions.
2019-07-22 00:58:21 +03:00
Terry Ellison
9a47107920
SDK 3.0 release (#2692)
* Rebaseline firmware to non-OS SDK version 3.0
* Note that SDK version 3.0 introduces the concept of a Flash Partition Table(PT).  This is located at Flash offset 0x10000 in our firmware build.
* The firmware is now PT aware with both LFS and SPIFFS taking their partition size and location from the PT
* A new tool `tools/nodemcu-partition.py` is now used to initialise these data and can also download LFS and SPIFFS images to these partitions.
2019-04-05 16:01:45 +01:00
TerryE
4f21224d56 LFS patch updates following review II and testing 2018-06-22 22:29:16 +01:00
Arnim Läuger
4e4dfc1d88 Align 8 MB & 16 MB flash sizes with SDK 2.1.0. (#1968)
* align 8MB and 16MB auto flash support with sdk 2.1.0
* remove SAFE_API
* fix flash size mismatch detection logic
2017-05-16 16:50:36 +02:00
Arnim Läuger
c57af8972f Rework support for >4MB modules: place SPIFFS after SDK data (#1646) 2016-12-26 14:17:57 +01:00
moononournation
4aad34158b add 64m and 128m flash support (#1367)
* update esptool.py to v1.2-dev

* add 64 Mbit and 128 Mbit support
2016-06-26 14:16:39 +02:00
Johny Mattsson
30d354c290 Rework ADC mode setting approach (#1285)
- Stop fighting against the SDK in terms of owning/writing the init_data block.
  NodeMCU included a default init_data block because originally the SDK did
  not, but by now it's not needed.

- Expose a way to reconfigure the ADC mode from Lua land. With most people
  using the cloud builder and not able to change the #define for byte 107
  this has been a pain point.

- Less confusion about which init_data has been used. Lua code can now simply
  state what mode it wants the ADC to be in, and not worry about the rest of
  the init_data complexities such as the init_data changing location due to
  flashing with wrong flash_size setting, or doing/not doing a chip-erase
  before loading new NodeMCU firmware.
2016-05-18 21:45:15 +02:00
dnc40085
9a8edd8ae8 Fix inconsistency between flash_init_data in flash_api.c and
esp_init_data_default.bin in SDK 1.51
2016-02-23 01:22:41 -08:00
devsaurus
0c3fc6cc78 enable -std=gnu11 for platform dir 2016-01-22 23:21:34 +01:00
Huang Rui
f2e6c9366b Sync flash_api.c with flash_api.h 2015-12-30 09:49:01 +08:00
Johny Mattsson
c4e8b04fbf Cleaned up all uses of INTERNAL_FLASH_START_ADDRESS.
There was only one genuine use of this macro, all other places were
using it only as a necessary compensation. While this was fine as long as
it was the first meg of flash which was mapped, it became incorrect and
quite dangerous whenever this assumption did not hold (such as when
running from the second slot in an OTA scenario).

The flash API now uses actual addresses, not translated/mapped
addresses, and the users of this API have been adjusted accordingly.
This makes the flash API work correctly regardless of what flash mapping
is in use.

The old macro is still available under the new name
INTERNAL_FLASH_MAPPED_ADDRESS, and this is used to detect flash writes
where the source is mapped flash (and thus has to be bounced), and to
adjust the _flash_used_end linker symbol when used with
flassh_find_sector() by the filesystem code. The latter usage is not
OTA-proof, but in an OTA scenario the filesystem needs a fixed location
anyway and thus would not use this code path.
2015-12-12 13:20:22 +11:00
Johny Mattsson
1e3c231630 Fix esp_init_data_default inconsistencies.
Make ADC vs readvdd33 option user_config.h configurable for the init data,
and made readvdd33 the default.
2015-11-12 12:57:07 +11:00
Vowstar
749e71d9cb Fixed strange SPI flash API error. Added word_of_aligned_array. 2015-05-05 23:59:30 +08:00
funshine
e1f8b604a0 fix init_data detect flash api 2015-03-24 23:21:40 +08:00
funshine
52ca40b8ea add init.lua examples 2015-03-22 21:09:37 +08:00
HuangRui
5c84359b5c ROM flash size can changed with detected size, fixed #283. 2015-03-16 05:40:43 +08:00
HuangRui
dfce182622 Paste new version, make it can get correct flash size. 2015-03-16 00:51:47 +08:00
HuangRui
ed87cbd96f Try to fix flash auto detection bug. 2015-03-16 00:48:28 +08:00
HuangRui
0232c13b83 Emergency update, fix flash size auto detection bug.
64Mbit and 128Mbit supported by hardware, but not supported by this SDK 0.9.5. Waiting SDK update.
2015-02-15 02:13:58 +08:00
HuangRui
f6b1d3a399 Test what caused flash AUTO_SIZE bug. 2015-02-15 00:02:53 +08:00
HuangRui
5d9caf23b6 Support 64Mbit and 128Mbit flash size auto detection. 2015-02-11 21:16:48 +08:00
funshine
acd9d0dc97 deep optimizing ram usage 2015-01-07 01:15:38 +08:00
HuangRui
3c6ebea059 Use safe flash options. 2015-01-06 19:32:17 +08:00
funshine
7e51c5d67e replace SPIWrite with flash_write 2015-01-05 23:57:07 +08:00
funshine
ff6e5e9924 build pre-build bin, auto save flash init data 2015-01-05 21:56:55 +08:00
HuangRui
cb4a49e0db Changed Makefile to support Windows xcc. 2015-01-05 13:15:59 +08:00
HuangRui
c04f2578ec Updated SDK to v0.9.5 and optimized memory. 2015-01-05 10:09:51 +08:00
HuangRui
0420b6d72f Add definition of NODE_STORE_TYPEDEF_ATTR and NODE_STORE_ATTR. 2015-01-02 17:56:34 +08:00
funshine
b0ec34567c align flash read/write addr 2014-12-31 20:20:38 +08:00
funshine
1105b95175 add newline to flash_api.c for win vm 2014-12-31 16:54:44 +08:00
HuangRui
a93e62c444 Add node.flashid() and node.flashsize(). 2014-12-31 08:08:31 +08:00
HuangRui
956455e8f2 Add new line to flash_api.c for tool chain on windows vm. 2014-12-31 02:51:36 +08:00
HuangRui
715ff5b7aa NodeMCU firmware can auto detect flash size now. 2014-12-31 02:47:44 +08:00