From 8969646f9955dbdd7d5457f5501c0f0d99d84a16 Mon Sep 17 00:00:00 2001 From: Peter Andersson Date: Sat, 10 Jan 2015 22:53:07 +0100 Subject: [PATCH] updated docs --- docs/INTEGRATION | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/docs/INTEGRATION b/docs/INTEGRATION index a2c52c9..20ff70d 100644 --- a/docs/INTEGRATION +++ b/docs/INTEGRATION @@ -50,7 +50,7 @@ Now, write the my_spiffs_mount function: cfg.phys_addr = 0; // start spiffs at start of spi flash cfg.phys_erase_block = 65536; // according to datasheet cfg.log_block_size = 65536; // let us not complicate things - cfg.log_block_size = LOG_PAGE_SIZE; // as we said + cfg.log_page_size = LOG_PAGE_SIZE; // as we said cfg.hal_read_f = my_spi_read; cfg.hal_write_f = my_spi_write; @@ -127,6 +127,29 @@ Compile, run, cross fingers hard, and you'll get the output: Got errors? Check spiffs.h for error definitions to get a clue what went voodoo. +* THINGS TO CHECK + +When you alter the spiffs_config values, make sure you also check the typedefs +in spiffs_config.h: + + - spiffs_block_ix + - spiffs_page_ix + - spiffs_obj_id + - spiffs_span_ix + +The sizes of these typedefs must not underflow, else spiffs might end up in +eternal loops. Each typedef is commented what check for. + +Also, if you alter the code or just want to verify your configuration, you can +run + + > make test + +in the spiffs folder. This will run all testcases using the configuration in +default/spiffs_config.h and test/params_test.h. The tests are written for linux +but should run under cygwin also. + + * INTEGRATING SPIFFS In order to integrate spiffs to your embedded target, you will basically need: