@@ -823,4 +823,53 @@ so that should be OK, I'm writing at 0x1... tho this program uses 42kb, but inde
I don't know what is real anymore, the libraries failed me, the datasheet is opaque AF, I am writing somewhere I shouldn't, etc. Might be time to bring out the atmel studio guns.
Or the small guns: I'm going to try to get a minimum viable something up with this library.
\ No newline at end of file
Or the small guns: I'm going to try to get a minimum viable something up with this library.
Works like this:
```cpp
FlashStorage(flash_store,float);
voidflash_write_init(void){
}
voidflash_write_value(floatval){
flash_store.write(val);
}
voidStep_CL::print_table(void){
for(uint16_te=0;e<4;e++){
floatra=flash_store.read();
sysError("e: "+String(e)+" ra: "+String(ra,4));
delay(5);
}
}
```
So I can try doing batches of these... Seems like a full 'page' works, I wonder if anything > 512 bytes does as well, or crashes... breaks at 256 floats, but not at 129...
So it seems that it should work, if I can get into the lower levels of this thing and increment pointers around. I'll try to do that first with just the 128 bytes that I know can work, and I'm pretty sure that's inside of one page.
OK, trips at the erase. Takes *forever* to reload code once I cripple it like this.
Oy, seems like I wrote it... then it dissappears after a reset, wth? That was to do with a volatile flag.
I think this has to do with erase block / instead of erase page. I should learn more about that in the data sheet.
Blocks are 16 pages: erase granularity is per block, write granularity is per page. One guess is that if the block / page are not aligned to a block, the EB command fails. Altho from 25.6.6.6 (fitting), it notes that any address within the block is valid for an erase block command.
OK, trying to unlock the block beforehand.
SO! Definitely hung on trying to erase a block. However, have had some evidence that this worked previously.
It's 1230 - I'll think about this tomorrow. Maybe try taking the above single-float working example apart, see if you can code it up yourself, to understand what's up.
## 2020 10 14
OK, today will bring this library into the local build and see about figuring what the heck it does, build the minimum example from scratch, and then see if I can scale that up to multiple blocks / tables.
- pages are 512 bytes
- blocks are 16 pages
This means a block is 8192, makes sense this is where flashstorage aligns itself. I need 8 blocks total for the full LUT.