-
• #2
0x080002800 is a typo - it should be 0x08002800 as it suggests on the line above.
Yes, the new binary is much smaller. I accidentally left the optimisation switched to size when compiling 1v67 - but it shouldn't be a big problem. The binary in the zip contains the bootloader (which is 10240 bytes) - which explains your discrepancy.
It turns out that test is broken :( Since the switch to 32 bit, 0xFFFFFFFF is interpreted as a signed int, so it's now -1. Try this and you'll have more success:
function isPageSafe(addr) { for (var i=addr;i<addr+2048;i+=4) if (peek32(i)!=-1) return false; return true; }
I'll update the docs.
-
• #3
Thanks for quick response.
Works fine now.
I tried to get a better understanding of flash memory on Espruino board.
First check was done to find safe memory using isPageSafe from http://www.espruino.com/STM32F1Flash.
Bad success on whatever adress I used (process.memory().flash_binary_end+2047)&~2047 and 0x0803E000
Next tried to figure out size of binary using
process.memory().flash_binary_end - 0x08002800
This returns 162052 bytes. Last binary size(1v67, 1r3.bin) in download is 172516.
Even this is much smaller than 1v66, is it reduced from 215K to 168K ?
BTW, as far as I understand, there is a typo in notes where 0x080002800 to process.memory().flash_binary_end should be 0x08002800 to ...
To avoid destroying something, could somebody give me some help ?