esp8266/modesp: flash_user_start: Use value from linker script.
Make esp8266_common.ld export size reserved to all code segments, and use that in esp.flash_user_start() implementation.
This commit is contained in:
parent
0987ad5e30
commit
3e05df7fd1
@ -19,6 +19,8 @@ EXTERN(_KernelExceptionVector)
|
|||||||
EXTERN(_NMIExceptionVector)
|
EXTERN(_NMIExceptionVector)
|
||||||
EXTERN(_UserExceptionVector)
|
EXTERN(_UserExceptionVector)
|
||||||
|
|
||||||
|
_firmware_size = ORIGIN(irom0_0_seg) + LENGTH(irom0_0_seg) - 0x40200000;
|
||||||
|
|
||||||
PROVIDE(_memmap_vecbase_reset = 0x40000000);
|
PROVIDE(_memmap_vecbase_reset = 0x40000000);
|
||||||
|
|
||||||
/* Various memory-map dependent cache attribute settings: */
|
/* Various memory-map dependent cache attribute settings: */
|
||||||
|
@ -159,12 +159,10 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_0(esp_flash_size_obj, esp_flash_size);
|
|||||||
// we assume there's a yaota8266 bootloader.
|
// we assume there's a yaota8266 bootloader.
|
||||||
#define IS_OTA_FIRMWARE() ((*(uint32_t*)0x40200000 & 0xff00) == 0x100)
|
#define IS_OTA_FIRMWARE() ((*(uint32_t*)0x40200000 & 0xff00) == 0x100)
|
||||||
|
|
||||||
|
extern byte _firmware_size[];
|
||||||
|
|
||||||
STATIC mp_obj_t esp_flash_user_start(void) {
|
STATIC mp_obj_t esp_flash_user_start(void) {
|
||||||
if (IS_OTA_FIRMWARE()) {
|
return MP_OBJ_NEW_SMALL_INT((uint32_t)_firmware_size);
|
||||||
return MP_OBJ_NEW_SMALL_INT(0x3c000 + 0x90000);
|
|
||||||
} else {
|
|
||||||
return MP_OBJ_NEW_SMALL_INT(0x90000);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
STATIC MP_DEFINE_CONST_FUN_OBJ_0(esp_flash_user_start_obj, esp_flash_user_start);
|
STATIC MP_DEFINE_CONST_FUN_OBJ_0(esp_flash_user_start_obj, esp_flash_user_start);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user