-
Notifications
You must be signed in to change notification settings - Fork 13.3k
flash-size agnostic builds #6690
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 67 commits
Commits
Show all changes
75 commits
Select commit
Hold shift + click to select a range
8834211
flash: mapping definition by sketch at runtime depending on flash chi…
d-a-v 41bc6bc
Merge branch 'master' into nosizeconf
d-a-v 0decdf4
fixes
d-a-v 08e3b51
ESP.getFlashChipSize() returns ESP.getFlashChipRealSize()
d-a-v 28e7d08
16MB no fs was missing
d-a-v 6104b9d
fixes
d-a-v da308ad
fixes
d-a-v 719f65a
fix
d-a-v dfb6a00
fix emulation on host
d-a-v c2747a4
Merge branch 'master' into nosizeconf
d-a-v 4e05cc8
fix emulation on host when 32bit compiler is not available
d-a-v 7063425
Merge branch 'nosizeconf' of github.com:d-a-v/Arduino into nosizeconf
d-a-v 94bb156
Merge branch 'master' into nosizeconf
d-a-v b8e4815
merge https://github.com/esp8266/Arduino/pull/6813
d-a-v 855dd34
Merge branch 'nosizeconf' of github.com:d-a-v/Arduino into nosizeconf
d-a-v 9b0164a
Merge branch 'master' into nosizeconf
d-a-v 7c9a832
Merge branch 'master' into nosizeconf
d-a-v c75e812
documentation, auto-256KBFS for 2MB chips
d-a-v 3f30bec
doc format
d-a-v 955a145
doc format
d-a-v 38942f4
rst blackhole
d-a-v b2890d8
Merge branch 'master' into nosizeconf
d-a-v 6d73c20
Merge branch 'master' into nosizeconf
d-a-v dd2d526
Merge branch 'nosizeconf' of github.com:d-a-v/Arduino into nosizeconf
d-a-v 7f3c65b
Merge branch 'master' into nosizeconf
d-a-v e4534ed
Merge branch 'master' into nosizeconf
d-a-v 8bcc134
fix emulation on host
d-a-v 3c807b0
emulation on host: fix 64 bits mode
d-a-v 98e07d7
Merge branch 'master' into nosizeconf
d-a-v 1a66a89
Merge branch 'master' into nosizeconf
d-a-v 279db40
Merge branch 'master' into nosizeconf
d-a-v c01299b
Merge branch 'nosizeconf' of github.com:d-a-v/Arduino into nosizeconf
d-a-v d55bf93
Merge branch 'master' into nosizeconf
d-a-v 8adc14a
Merge branch 'master' into nosizeconf
d-a-v 49a4d08
Merge branch 'nosizeconf' of github.com:d-a-v/Arduino into nosizeconf
d-a-v 5898eeb
Merge branch 'master' into nosizeconf
d-a-v 843a096
Merge branch 'master' into nosizeconf
d-a-v ea319e2
merge with master
d-a-v f40f8f6
remove superfluous linker line
d-a-v 665a0d9
Merge branch 'master' into nosizeconf
d-a-v c946421
missing change in httpupdateserver library
d-a-v 83f04ff
Merge branch 'nosizeconf' of github.com:d-a-v/Arduino into nosizeconf
d-a-v 7788233
Merge branch 'master' into nosizeconf
d-a-v 3347859
Merge branch 'master' into nosizeconf
d-a-v 8791401
Merge branch 'master' into nosizeconf
d-a-v 0419561
regen boards.txt
d-a-v 7907ad5
Merge branch 'nosizeconf' of github.com:d-a-v/Arduino into nosizeconf
d-a-v aa45adc
mode -DESP8266 from build.extra_flags to preprocessor flags
d-a-v 25b74b1
regen boards.txt
d-a-v 19d1f20
Merge branch 'master' into nosizeconf
d-a-v e922fea
sync with generated files
d-a-v 60e1bd9
Merge branch 'master' into nosizeconf
d-a-v 8ebc90f
Merge branch 'master' into nosizeconf
d-a-v 45d5250
nosizeconf: when enabled, using FLASH_MAP_OTA_FS by default
d-a-v 0760210
Merge branch 'nosizeconf' of github.com:d-a-v/Arduino into nosizeconf
d-a-v 6be7adf
Merge branch 'master' into nosizeconf
d-a-v 069e54d
platform.txt: remove superfluous defines
d-a-v 0b606da
improvements per mcspr's review
d-a-v 96d9bd6
Merge branch 'master' into nosizeconf
d-a-v 0b88291
restore data for fs uploader
d-a-v 585a062
Merge branch 'nosizeconf' of github.com:d-a-v/Arduino into nosizeconf
d-a-v fcf3508
Merge branch 'master' into nosizeconf
d-a-v 5c4fee9
Merge branch 'master' into nosizeconf
d-a-v 84582c3
Merge branch 'master' into nosizeconf
d-a-v 3354f4d
rename: FLASHMAPCONFIG -> FLASH_MAP_SETUP_CONFIG
d-a-v 058c201
rename: AUTOFLASHSIZE -> FLASH_MAP_SUPPORT
d-a-v 9b32e80
Merge branch 'nosizeconf' of github.com:d-a-v/Arduino into nosizeconf
d-a-v ac2f270
review suggestion
d-a-v 878d72f
review suggestion
d-a-v 6e38ba7
review suggestion
d-a-v af939b7
review suggestion
d-a-v 116a26c
review suggestion
d-a-v 3e7349e
review suggestion
d-a-v 1f4bf87
suggestion per review
d-a-v f2f7b0e
fix CI when hijacking flash_hal.h
d-a-v File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
|
||
// - do not edit - autogenerated by boards.txt.py | ||
|
||
#ifndef __FLASH_MAP_H | ||
#define __FLASH_MAP_H | ||
|
||
#include <stdint.h> | ||
#include <stddef.h> | ||
|
||
typedef struct | ||
{ | ||
uint32_t eeprom_start; | ||
uint32_t fs_start; | ||
uint32_t fs_end; | ||
uint32_t fs_block_size; | ||
uint32_t fs_page_size; | ||
uint32_t flash_size_kb; | ||
} flash_map_s; | ||
|
||
/* | ||
Following definitions map the above structure, one per line. | ||
FLASH_MAP_* is a user choice in sketch: | ||
`FLASH_MAP_SETUP_CONFIG(FLASH_MAP_OTA_FS)` | ||
Configuration is made at boot with detected flash chip size (last argument 512..16384) | ||
Other values are defined from `tools/boards.txt.py`. | ||
*/ | ||
|
||
#define FLASH_MAP_OTA_FS \ | ||
{ \ | ||
{ .eeprom_start = 0x402fb000, .fs_start = 0x402eb000, .fs_end = 0x402fb000, .fs_block_size = 0x1000, .fs_page_size = 0x100, .flash_size_kb = 1024 }, \ | ||
{ .eeprom_start = 0x403fb000, .fs_start = 0x403c0000, .fs_end = 0x403fb000, .fs_block_size = 0x1000, .fs_page_size = 0x100, .flash_size_kb = 2048 }, \ | ||
{ .eeprom_start = 0x405fb000, .fs_start = 0x40400000, .fs_end = 0x405fa000, .fs_block_size = 0x2000, .fs_page_size = 0x100, .flash_size_kb = 4096 }, \ | ||
{ .eeprom_start = 0x409fb000, .fs_start = 0x40400000, .fs_end = 0x409fa000, .fs_block_size = 0x2000, .fs_page_size = 0x100, .flash_size_kb = 8192 }, \ | ||
{ .eeprom_start = 0x411fb000, .fs_start = 0x40400000, .fs_end = 0x411fa000, .fs_block_size = 0x2000, .fs_page_size = 0x100, .flash_size_kb = 16384 }, \ | ||
{ .eeprom_start = 0x4027b000, .fs_start = 0x40273000, .fs_end = 0x4027b000, .fs_block_size = 0x1000, .fs_page_size = 0x100, .flash_size_kb = 512 }, \ | ||
} | ||
|
||
#define FLASH_MAP_MAX_FS \ | ||
{ \ | ||
{ .eeprom_start = 0x402fb000, .fs_start = 0x4027b000, .fs_end = 0x402fb000, .fs_block_size = 0x2000, .fs_page_size = 0x100, .flash_size_kb = 1024 }, \ | ||
{ .eeprom_start = 0x403fb000, .fs_start = 0x40300000, .fs_end = 0x403fa000, .fs_block_size = 0x2000, .fs_page_size = 0x100, .flash_size_kb = 2048 }, \ | ||
{ .eeprom_start = 0x405fb000, .fs_start = 0x40300000, .fs_end = 0x405fa000, .fs_block_size = 0x2000, .fs_page_size = 0x100, .flash_size_kb = 4096 }, \ | ||
{ .eeprom_start = 0x409fb000, .fs_start = 0x40300000, .fs_end = 0x409fa000, .fs_block_size = 0x2000, .fs_page_size = 0x100, .flash_size_kb = 8192 }, \ | ||
{ .eeprom_start = 0x411fb000, .fs_start = 0x40300000, .fs_end = 0x411fa000, .fs_block_size = 0x2000, .fs_page_size = 0x100, .flash_size_kb = 16384 }, \ | ||
{ .eeprom_start = 0x4027b000, .fs_start = 0x4025b000, .fs_end = 0x4027b000, .fs_block_size = 0x1000, .fs_page_size = 0x100, .flash_size_kb = 512 }, \ | ||
} | ||
d-a-v marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
#define FLASH_MAP_NO_FS \ | ||
{ \ | ||
{ .eeprom_start = 0x402fb000, .fs_start = 0x402fb000, .fs_end = 0x402fb000, .fs_block_size = 0x0, .fs_page_size = 0x0, .flash_size_kb = 1024 }, \ | ||
{ .eeprom_start = 0x403fb000, .fs_start = 0x403fb000, .fs_end = 0x403fb000, .fs_block_size = 0x0, .fs_page_size = 0x0, .flash_size_kb = 2048 }, \ | ||
{ .eeprom_start = 0x405fb000, .fs_start = 0x405fb000, .fs_end = 0x405fb000, .fs_block_size = 0x0, .fs_page_size = 0x0, .flash_size_kb = 4096 }, \ | ||
{ .eeprom_start = 0x409fb000, .fs_start = 0x409fb000, .fs_end = 0x409fb000, .fs_block_size = 0x0, .fs_page_size = 0x0, .flash_size_kb = 8192 }, \ | ||
{ .eeprom_start = 0x411fb000, .fs_start = 0x411fb000, .fs_end = 0x411fb000, .fs_block_size = 0x0, .fs_page_size = 0x0, .flash_size_kb = 16384 }, \ | ||
{ .eeprom_start = 0x4027b000, .fs_start = 0x4027b000, .fs_end = 0x4027b000, .fs_block_size = 0x0, .fs_page_size = 0x0, .flash_size_kb = 512 }, \ | ||
} | ||
|
||
#endif // __FLASH_MAP_H | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -24,8 +24,7 @@ extern "C" { | |||||
#include "user_interface.h" | ||||||
} | ||||||
|
||||||
extern "C" uint32_t _FS_start; | ||||||
extern "C" uint32_t _FS_end; | ||||||
#include <flash_hal.h> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one has been reverted because
This is only needed in sources files
|
||||||
|
||||||
UpdaterClass::UpdaterClass() | ||||||
{ | ||||||
|
@@ -118,7 +117,7 @@ bool UpdaterClass::begin(size_t size, int command, int ledPin, uint8_t ledOn) { | |||||
|
||||||
if (command == U_FLASH) { | ||||||
//address of the end of the space available for sketch and update | ||||||
uintptr_t updateEndAddress = (uintptr_t)&_FS_start - 0x40200000; | ||||||
uintptr_t updateEndAddress = FS_start - 0x40200000; | ||||||
|
||||||
updateStartAddress = (updateEndAddress > roundedSize)? (updateEndAddress - roundedSize) : 0; | ||||||
|
||||||
|
@@ -135,14 +134,14 @@ bool UpdaterClass::begin(size_t size, int command, int ledPin, uint8_t ledOn) { | |||||
} | ||||||
} | ||||||
else if (command == U_FS) { | ||||||
if((uintptr_t)&_FS_start + roundedSize > (uintptr_t)&_FS_end) { | ||||||
if(FS_start + roundedSize > FS_end) { | ||||||
_setError(UPDATE_ERROR_SPACE); | ||||||
return false; | ||||||
} | ||||||
|
||||||
#ifdef ATOMIC_FS_UPDATE | ||||||
//address of the end of the space available for update | ||||||
uintptr_t updateEndAddress = (uintptr_t)&_FS_start - 0x40200000; | ||||||
uintptr_t updateEndAddress = FS_start - 0x40200000; | ||||||
|
||||||
updateStartAddress = (updateEndAddress > roundedSize)? (updateEndAddress - roundedSize) : 0; | ||||||
|
||||||
|
@@ -151,7 +150,7 @@ bool UpdaterClass::begin(size_t size, int command, int ledPin, uint8_t ledOn) { | |||||
return false; | ||||||
} | ||||||
#else | ||||||
updateStartAddress = (uintptr_t)&_FS_start - 0x40200000; | ||||||
updateStartAddress = FS_start - 0x40200000; | ||||||
#endif | ||||||
} | ||||||
else { | ||||||
|
@@ -314,7 +313,7 @@ bool UpdaterClass::end(bool evenIfRemaining){ | |||||
eboot_command ebcmd; | ||||||
ebcmd.action = ACTION_COPY_RAW; | ||||||
ebcmd.args[0] = _startAddress; | ||||||
ebcmd.args[1] = (uintptr_t)&_FS_start - 0x40200000; | ||||||
ebcmd.args[1] = FS_start - 0x40200000; | ||||||
ebcmd.args[2] = _size; | ||||||
eboot_command_write(&ebcmd); | ||||||
#endif | ||||||
|
@@ -460,6 +459,9 @@ bool UpdaterClass::_verifyEnd() { | |||||
return false; | ||||||
} | ||||||
|
||||||
// it makes no sense to check flash size in auto flash mode | ||||||
// (sketch size would have to be set in bin header, instead of flash size) | ||||||
#if !FLASH_MAP_SUPPORT | ||||||
uint32_t bin_flash_size = ESP.magicFlashChipSize((buf[3] & 0xf0) >> 4); | ||||||
|
||||||
// check if new bin fits to SPI flash | ||||||
|
@@ -468,6 +470,7 @@ bool UpdaterClass::_verifyEnd() { | |||||
_setError(UPDATE_ERROR_NEW_FLASH_CONFIG); | ||||||
return false; | ||||||
} | ||||||
#endif | ||||||
|
||||||
return true; | ||||||
} else if(_command == U_FS) { | ||||||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.