Skip to content

Re-add deprecated _SPIFFS_xxx linker symbols #6543

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 3 commits into from
Sep 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions cores/esp8266/spiffs_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,21 @@

using namespace fs;


// Deprecated functions, to be deleted in next release
int32_t spiffs_hal_write(uint32_t addr, uint32_t size, uint8_t *src) {
return flash_hal_write(addr, size, src);
}
int32_t spiffs_hal_erase(uint32_t addr, uint32_t size) {
return flash_hal_erase(addr, size);
}
int32_t spiffs_hal_read(uint32_t addr, uint32_t size, uint8_t *dst) {
return flash_hal_read(addr, size, dst);
}




namespace spiffs_impl {

FileImplPtr SPIFFSImpl::open(const char* path, OpenMode openMode, AccessMode accessMode)
Expand Down
20 changes: 20 additions & 0 deletions cores/esp8266/spiffs_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,26 @@ extern "C" {

using namespace fs;

// The following are deprecated symbols and functions, to be removed at the next major release.
// They are provided only for backwards compatibility and to give libs a chance to update.

extern "C" uint32_t _SPIFFS_start __attribute__((deprecated));
extern "C" uint32_t _SPIFFS_end __attribute__((deprecated));
extern "C" uint32_t _SPIFFS_page __attribute__((deprecated));
extern "C" uint32_t _SPIFFS_block __attribute__((deprecated));

#define SPIFFS_PHYS_ADDR ((uint32_t) (&_SPIFFS_start) - 0x40200000)
#define SPIFFS_PHYS_SIZE ((uint32_t) (&_SPIFFS_end) - (uint32_t) (&_SPIFFS_start))
#define SPIFFS_PHYS_PAGE ((uint32_t) &_SPIFFS_page)
#define SPIFFS_PHYS_BLOCK ((uint32_t) &_SPIFFS_block)

extern int32_t spiffs_hal_write(uint32_t addr, uint32_t size, uint8_t *src) __attribute__((deprecated));
extern int32_t spiffs_hal_erase(uint32_t addr, uint32_t size) __attribute__((deprecated));
extern int32_t spiffs_hal_read(uint32_t addr, uint32_t size, uint8_t *dst) __attribute__((deprecated));




namespace spiffs_impl {

int getSpiffsMode(OpenMode openMode, AccessMode accessMode);
Expand Down
6 changes: 6 additions & 0 deletions tools/boards.txt.py
Original file line number Diff line number Diff line change
Expand Up @@ -1274,6 +1274,12 @@ def flash_map (flashsize_kb, fs_kb = 0):
print("PROVIDE ( _FS_page = 0x%X );" % page)
print("PROVIDE ( _FS_block = 0x%X );" % fs_blocksize)
print("PROVIDE ( _EEPROM_start = 0x%08x );" % (0x40200000 + eeprom_start))
# Re-add deprecated symbols pointing to the same address as the new standard ones
print("/* The following symbols are DEPRECATED and will be REMOVED in a future release */")
print("PROVIDE ( _SPIFFS_start = 0x%08X );" % (0x40200000 + fs_start))
print("PROVIDE ( _SPIFFS_end = 0x%08X );" % (0x40200000 + fs_end))
print("PROVIDE ( _SPIFFS_page = 0x%X );" % page)
print("PROVIDE ( _SPIFFS_block = 0x%X );" % fs_blocksize)
print("")
print('INCLUDE "local.eagle.app.v6.common.ld"')

Expand Down
5 changes: 5 additions & 0 deletions tools/sdk/ld/eagle.flash.16m14m.ld
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,10 @@ PROVIDE ( _FS_end = 0x411FA000 );
PROVIDE ( _FS_page = 0x100 );
PROVIDE ( _FS_block = 0x2000 );
PROVIDE ( _EEPROM_start = 0x411fb000 );
/* The following symbols are DEPRECATED and will be REMOVED in a future release */
PROVIDE ( _SPIFFS_start = 0x40400000 );
PROVIDE ( _SPIFFS_end = 0x411FA000 );
PROVIDE ( _SPIFFS_page = 0x100 );
PROVIDE ( _SPIFFS_block = 0x2000 );

INCLUDE "local.eagle.app.v6.common.ld"
5 changes: 5 additions & 0 deletions tools/sdk/ld/eagle.flash.16m15m.ld
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,10 @@ PROVIDE ( _FS_end = 0x411FA000 );
PROVIDE ( _FS_page = 0x100 );
PROVIDE ( _FS_block = 0x2000 );
PROVIDE ( _EEPROM_start = 0x411fb000 );
/* The following symbols are DEPRECATED and will be REMOVED in a future release */
PROVIDE ( _SPIFFS_start = 0x40300000 );
PROVIDE ( _SPIFFS_end = 0x411FA000 );
PROVIDE ( _SPIFFS_page = 0x100 );
PROVIDE ( _SPIFFS_block = 0x2000 );

INCLUDE "local.eagle.app.v6.common.ld"
5 changes: 5 additions & 0 deletions tools/sdk/ld/eagle.flash.1m.ld
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,10 @@ PROVIDE ( _FS_end = 0x402FB000 );
PROVIDE ( _FS_page = 0x0 );
PROVIDE ( _FS_block = 0x0 );
PROVIDE ( _EEPROM_start = 0x402fb000 );
/* The following symbols are DEPRECATED and will be REMOVED in a future release */
PROVIDE ( _SPIFFS_start = 0x402FB000 );
PROVIDE ( _SPIFFS_end = 0x402FB000 );
PROVIDE ( _SPIFFS_page = 0x0 );
PROVIDE ( _SPIFFS_block = 0x0 );

INCLUDE "local.eagle.app.v6.common.ld"
5 changes: 5 additions & 0 deletions tools/sdk/ld/eagle.flash.1m128.ld
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,10 @@ PROVIDE ( _FS_end = 0x402FB000 );
PROVIDE ( _FS_page = 0x100 );
PROVIDE ( _FS_block = 0x1000 );
PROVIDE ( _EEPROM_start = 0x402fb000 );
/* The following symbols are DEPRECATED and will be REMOVED in a future release */
PROVIDE ( _SPIFFS_start = 0x402DB000 );
PROVIDE ( _SPIFFS_end = 0x402FB000 );
PROVIDE ( _SPIFFS_page = 0x100 );
PROVIDE ( _SPIFFS_block = 0x1000 );

INCLUDE "local.eagle.app.v6.common.ld"
5 changes: 5 additions & 0 deletions tools/sdk/ld/eagle.flash.1m144.ld
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,10 @@ PROVIDE ( _FS_end = 0x402FB000 );
PROVIDE ( _FS_page = 0x100 );
PROVIDE ( _FS_block = 0x1000 );
PROVIDE ( _EEPROM_start = 0x402fb000 );
/* The following symbols are DEPRECATED and will be REMOVED in a future release */
PROVIDE ( _SPIFFS_start = 0x402D7000 );
PROVIDE ( _SPIFFS_end = 0x402FB000 );
PROVIDE ( _SPIFFS_page = 0x100 );
PROVIDE ( _SPIFFS_block = 0x1000 );

INCLUDE "local.eagle.app.v6.common.ld"
5 changes: 5 additions & 0 deletions tools/sdk/ld/eagle.flash.1m160.ld
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,10 @@ PROVIDE ( _FS_end = 0x402FB000 );
PROVIDE ( _FS_page = 0x100 );
PROVIDE ( _FS_block = 0x1000 );
PROVIDE ( _EEPROM_start = 0x402fb000 );
/* The following symbols are DEPRECATED and will be REMOVED in a future release */
PROVIDE ( _SPIFFS_start = 0x402D3000 );
PROVIDE ( _SPIFFS_end = 0x402FB000 );
PROVIDE ( _SPIFFS_page = 0x100 );
PROVIDE ( _SPIFFS_block = 0x1000 );

INCLUDE "local.eagle.app.v6.common.ld"
5 changes: 5 additions & 0 deletions tools/sdk/ld/eagle.flash.1m192.ld
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,10 @@ PROVIDE ( _FS_end = 0x402FB000 );
PROVIDE ( _FS_page = 0x100 );
PROVIDE ( _FS_block = 0x1000 );
PROVIDE ( _EEPROM_start = 0x402fb000 );
/* The following symbols are DEPRECATED and will be REMOVED in a future release */
PROVIDE ( _SPIFFS_start = 0x402CB000 );
PROVIDE ( _SPIFFS_end = 0x402FB000 );
PROVIDE ( _SPIFFS_page = 0x100 );
PROVIDE ( _SPIFFS_block = 0x1000 );

INCLUDE "local.eagle.app.v6.common.ld"
5 changes: 5 additions & 0 deletions tools/sdk/ld/eagle.flash.1m256.ld
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,10 @@ PROVIDE ( _FS_end = 0x402FB000 );
PROVIDE ( _FS_page = 0x100 );
PROVIDE ( _FS_block = 0x1000 );
PROVIDE ( _EEPROM_start = 0x402fb000 );
/* The following symbols are DEPRECATED and will be REMOVED in a future release */
PROVIDE ( _SPIFFS_start = 0x402BB000 );
PROVIDE ( _SPIFFS_end = 0x402FB000 );
PROVIDE ( _SPIFFS_page = 0x100 );
PROVIDE ( _SPIFFS_block = 0x1000 );

INCLUDE "local.eagle.app.v6.common.ld"
5 changes: 5 additions & 0 deletions tools/sdk/ld/eagle.flash.1m512.ld
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,10 @@ PROVIDE ( _FS_end = 0x402FB000 );
PROVIDE ( _FS_page = 0x100 );
PROVIDE ( _FS_block = 0x2000 );
PROVIDE ( _EEPROM_start = 0x402fb000 );
/* The following symbols are DEPRECATED and will be REMOVED in a future release */
PROVIDE ( _SPIFFS_start = 0x4027B000 );
PROVIDE ( _SPIFFS_end = 0x402FB000 );
PROVIDE ( _SPIFFS_page = 0x100 );
PROVIDE ( _SPIFFS_block = 0x2000 );

INCLUDE "local.eagle.app.v6.common.ld"
5 changes: 5 additions & 0 deletions tools/sdk/ld/eagle.flash.1m64.ld
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,10 @@ PROVIDE ( _FS_end = 0x402FB000 );
PROVIDE ( _FS_page = 0x100 );
PROVIDE ( _FS_block = 0x1000 );
PROVIDE ( _EEPROM_start = 0x402fb000 );
/* The following symbols are DEPRECATED and will be REMOVED in a future release */
PROVIDE ( _SPIFFS_start = 0x402EB000 );
PROVIDE ( _SPIFFS_end = 0x402FB000 );
PROVIDE ( _SPIFFS_page = 0x100 );
PROVIDE ( _SPIFFS_block = 0x1000 );

INCLUDE "local.eagle.app.v6.common.ld"
5 changes: 5 additions & 0 deletions tools/sdk/ld/eagle.flash.2m.ld
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,10 @@ PROVIDE ( _FS_end = 0x403FB000 );
PROVIDE ( _FS_page = 0x0 );
PROVIDE ( _FS_block = 0x0 );
PROVIDE ( _EEPROM_start = 0x403fb000 );
/* The following symbols are DEPRECATED and will be REMOVED in a future release */
PROVIDE ( _SPIFFS_start = 0x403FB000 );
PROVIDE ( _SPIFFS_end = 0x403FB000 );
PROVIDE ( _SPIFFS_page = 0x0 );
PROVIDE ( _SPIFFS_block = 0x0 );

INCLUDE "local.eagle.app.v6.common.ld"
5 changes: 5 additions & 0 deletions tools/sdk/ld/eagle.flash.2m128.ld
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,10 @@ PROVIDE ( _FS_end = 0x403FB000 );
PROVIDE ( _FS_page = 0x100 );
PROVIDE ( _FS_block = 0x1000 );
PROVIDE ( _EEPROM_start = 0x403fb000 );
/* The following symbols are DEPRECATED and will be REMOVED in a future release */
PROVIDE ( _SPIFFS_start = 0x403E0000 );
PROVIDE ( _SPIFFS_end = 0x403FB000 );
PROVIDE ( _SPIFFS_page = 0x100 );
PROVIDE ( _SPIFFS_block = 0x1000 );

INCLUDE "local.eagle.app.v6.common.ld"
5 changes: 5 additions & 0 deletions tools/sdk/ld/eagle.flash.2m1m.ld
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,10 @@ PROVIDE ( _FS_end = 0x403FA000 );
PROVIDE ( _FS_page = 0x100 );
PROVIDE ( _FS_block = 0x2000 );
PROVIDE ( _EEPROM_start = 0x403fb000 );
/* The following symbols are DEPRECATED and will be REMOVED in a future release */
PROVIDE ( _SPIFFS_start = 0x40300000 );
PROVIDE ( _SPIFFS_end = 0x403FA000 );
PROVIDE ( _SPIFFS_page = 0x100 );
PROVIDE ( _SPIFFS_block = 0x2000 );

INCLUDE "local.eagle.app.v6.common.ld"
5 changes: 5 additions & 0 deletions tools/sdk/ld/eagle.flash.2m256.ld
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,10 @@ PROVIDE ( _FS_end = 0x403FB000 );
PROVIDE ( _FS_page = 0x100 );
PROVIDE ( _FS_block = 0x1000 );
PROVIDE ( _EEPROM_start = 0x403fb000 );
/* The following symbols are DEPRECATED and will be REMOVED in a future release */
PROVIDE ( _SPIFFS_start = 0x403C0000 );
PROVIDE ( _SPIFFS_end = 0x403FB000 );
PROVIDE ( _SPIFFS_page = 0x100 );
PROVIDE ( _SPIFFS_block = 0x1000 );

INCLUDE "local.eagle.app.v6.common.ld"
5 changes: 5 additions & 0 deletions tools/sdk/ld/eagle.flash.2m512.ld
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,10 @@ PROVIDE ( _FS_end = 0x403FA000 );
PROVIDE ( _FS_page = 0x100 );
PROVIDE ( _FS_block = 0x2000 );
PROVIDE ( _EEPROM_start = 0x403fb000 );
/* The following symbols are DEPRECATED and will be REMOVED in a future release */
PROVIDE ( _SPIFFS_start = 0x40380000 );
PROVIDE ( _SPIFFS_end = 0x403FA000 );
PROVIDE ( _SPIFFS_page = 0x100 );
PROVIDE ( _SPIFFS_block = 0x2000 );

INCLUDE "local.eagle.app.v6.common.ld"
5 changes: 5 additions & 0 deletions tools/sdk/ld/eagle.flash.4m.ld
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,10 @@ PROVIDE ( _FS_end = 0x405FB000 );
PROVIDE ( _FS_page = 0x0 );
PROVIDE ( _FS_block = 0x0 );
PROVIDE ( _EEPROM_start = 0x405fb000 );
/* The following symbols are DEPRECATED and will be REMOVED in a future release */
PROVIDE ( _SPIFFS_start = 0x405FB000 );
PROVIDE ( _SPIFFS_end = 0x405FB000 );
PROVIDE ( _SPIFFS_page = 0x0 );
PROVIDE ( _SPIFFS_block = 0x0 );

INCLUDE "local.eagle.app.v6.common.ld"
5 changes: 5 additions & 0 deletions tools/sdk/ld/eagle.flash.4m1m.ld
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,10 @@ PROVIDE ( _FS_end = 0x405FA000 );
PROVIDE ( _FS_page = 0x100 );
PROVIDE ( _FS_block = 0x2000 );
PROVIDE ( _EEPROM_start = 0x405fb000 );
/* The following symbols are DEPRECATED and will be REMOVED in a future release */
PROVIDE ( _SPIFFS_start = 0x40500000 );
PROVIDE ( _SPIFFS_end = 0x405FA000 );
PROVIDE ( _SPIFFS_page = 0x100 );
PROVIDE ( _SPIFFS_block = 0x2000 );

INCLUDE "local.eagle.app.v6.common.ld"
5 changes: 5 additions & 0 deletions tools/sdk/ld/eagle.flash.4m2m.ld
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,10 @@ PROVIDE ( _FS_end = 0x405FA000 );
PROVIDE ( _FS_page = 0x100 );
PROVIDE ( _FS_block = 0x2000 );
PROVIDE ( _EEPROM_start = 0x405fb000 );
/* The following symbols are DEPRECATED and will be REMOVED in a future release */
PROVIDE ( _SPIFFS_start = 0x40400000 );
PROVIDE ( _SPIFFS_end = 0x405FA000 );
PROVIDE ( _SPIFFS_page = 0x100 );
PROVIDE ( _SPIFFS_block = 0x2000 );

INCLUDE "local.eagle.app.v6.common.ld"
5 changes: 5 additions & 0 deletions tools/sdk/ld/eagle.flash.4m3m.ld
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,10 @@ PROVIDE ( _FS_end = 0x405FA000 );
PROVIDE ( _FS_page = 0x100 );
PROVIDE ( _FS_block = 0x2000 );
PROVIDE ( _EEPROM_start = 0x405fb000 );
/* The following symbols are DEPRECATED and will be REMOVED in a future release */
PROVIDE ( _SPIFFS_start = 0x40300000 );
PROVIDE ( _SPIFFS_end = 0x405FA000 );
PROVIDE ( _SPIFFS_page = 0x100 );
PROVIDE ( _SPIFFS_block = 0x2000 );

INCLUDE "local.eagle.app.v6.common.ld"
5 changes: 5 additions & 0 deletions tools/sdk/ld/eagle.flash.512k.ld
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,10 @@ PROVIDE ( _FS_end = 0x4027B000 );
PROVIDE ( _FS_page = 0x0 );
PROVIDE ( _FS_block = 0x0 );
PROVIDE ( _EEPROM_start = 0x4027b000 );
/* The following symbols are DEPRECATED and will be REMOVED in a future release */
PROVIDE ( _SPIFFS_start = 0x4027B000 );
PROVIDE ( _SPIFFS_end = 0x4027B000 );
PROVIDE ( _SPIFFS_page = 0x0 );
PROVIDE ( _SPIFFS_block = 0x0 );

INCLUDE "local.eagle.app.v6.common.ld"
5 changes: 5 additions & 0 deletions tools/sdk/ld/eagle.flash.512k128.ld
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,10 @@ PROVIDE ( _FS_end = 0x4027B000 );
PROVIDE ( _FS_page = 0x100 );
PROVIDE ( _FS_block = 0x1000 );
PROVIDE ( _EEPROM_start = 0x4027b000 );
/* The following symbols are DEPRECATED and will be REMOVED in a future release */
PROVIDE ( _SPIFFS_start = 0x4025B000 );
PROVIDE ( _SPIFFS_end = 0x4027B000 );
PROVIDE ( _SPIFFS_page = 0x100 );
PROVIDE ( _SPIFFS_block = 0x1000 );

INCLUDE "local.eagle.app.v6.common.ld"
5 changes: 5 additions & 0 deletions tools/sdk/ld/eagle.flash.512k32.ld
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,10 @@ PROVIDE ( _FS_end = 0x4027B000 );
PROVIDE ( _FS_page = 0x100 );
PROVIDE ( _FS_block = 0x1000 );
PROVIDE ( _EEPROM_start = 0x4027b000 );
/* The following symbols are DEPRECATED and will be REMOVED in a future release */
PROVIDE ( _SPIFFS_start = 0x40273000 );
PROVIDE ( _SPIFFS_end = 0x4027B000 );
PROVIDE ( _SPIFFS_page = 0x100 );
PROVIDE ( _SPIFFS_block = 0x1000 );

INCLUDE "local.eagle.app.v6.common.ld"
5 changes: 5 additions & 0 deletions tools/sdk/ld/eagle.flash.512k64.ld
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,10 @@ PROVIDE ( _FS_end = 0x4027B000 );
PROVIDE ( _FS_page = 0x100 );
PROVIDE ( _FS_block = 0x1000 );
PROVIDE ( _EEPROM_start = 0x4027b000 );
/* The following symbols are DEPRECATED and will be REMOVED in a future release */
PROVIDE ( _SPIFFS_start = 0x4026B000 );
PROVIDE ( _SPIFFS_end = 0x4027B000 );
PROVIDE ( _SPIFFS_page = 0x100 );
PROVIDE ( _SPIFFS_block = 0x1000 );

INCLUDE "local.eagle.app.v6.common.ld"
5 changes: 5 additions & 0 deletions tools/sdk/ld/eagle.flash.8m6m.ld
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,10 @@ PROVIDE ( _FS_end = 0x409FA000 );
PROVIDE ( _FS_page = 0x100 );
PROVIDE ( _FS_block = 0x2000 );
PROVIDE ( _EEPROM_start = 0x409fb000 );
/* The following symbols are DEPRECATED and will be REMOVED in a future release */
PROVIDE ( _SPIFFS_start = 0x40400000 );
PROVIDE ( _SPIFFS_end = 0x409FA000 );
PROVIDE ( _SPIFFS_page = 0x100 );
PROVIDE ( _SPIFFS_block = 0x2000 );

INCLUDE "local.eagle.app.v6.common.ld"
5 changes: 5 additions & 0 deletions tools/sdk/ld/eagle.flash.8m7m.ld
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,10 @@ PROVIDE ( _FS_end = 0x409FA000 );
PROVIDE ( _FS_page = 0x100 );
PROVIDE ( _FS_block = 0x2000 );
PROVIDE ( _EEPROM_start = 0x409fb000 );
/* The following symbols are DEPRECATED and will be REMOVED in a future release */
PROVIDE ( _SPIFFS_start = 0x40300000 );
PROVIDE ( _SPIFFS_end = 0x409FA000 );
PROVIDE ( _SPIFFS_page = 0x100 );
PROVIDE ( _SPIFFS_block = 0x2000 );

INCLUDE "local.eagle.app.v6.common.ld"