- Thu Aug 20, 2015 7:46 am
#26561
Hey Richard,
OK...this explains why I'm having trouble accessing the right SPIFFS after I OTA Update...I just got that working yesterday and it seemed like it took two updates to see the updated web pages. I was gonna dig into that today, but your explanation of using SPI access instead of memory mapped makes sense.
The compiler does so of pass the location...it uses a constant that the Sming developers set in the linker:
Which is set in this block of code:
Code: Select all .irom0.text : ALIGN(4)
{
_irom0_text_start = ABSOLUTE(.);
*(.irom0.literal .irom.literal .irom.text.literal .irom0.text .irom.text)
out/build/app_app.a:*(.literal .text .literal.* .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
*libsming.a:*(.literal .text .literal.* .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
_irom0_text_end = ABSOLUTE(.);
/* _flash_code_end = ABSOLUTE(.); */
_flash_code_end = ABSOLUTE(0x44000);
} >irom0_0_seg :irom0_0_phdr
You can see that In the above code, I commented out the standard line and set it to a fixed position so that I could move it around and not just put it at the end of my code + Offset.
_flash_code_end is used in "Sming/system/flashmem.c" in the routine "flashmem_get_first_free_block_address".
The above code is used in "spiffs_get_storage_config()" which is called from "spiffs_mount()" both in "Sming/Services/SpifFS/spiffs.c".
I have an open feature request to Sming which everyone thinks is a good idea to allow override of the default location check for the SPIFFs. My thought is that we could leave the original method of calculating the offset/location there, but check for the existence of some variable, either passed in from the makefile or defined in user code. If that is there, then on mount it would use it instead of going off and calculating it. This would allow us to put a check for the ROM slot and set the SPIFFs location based on that.
Anyways...hope this makes sense.
Glad to have another couple of sets of eyes on this...I've been making slow but steady progress for several weeks.