electrical noise during tuning ETB causes full tune reset #775

this fix did not seem to work :(
This commit is contained in:
rusefi 2019-04-25 00:10:39 -04:00
parent 0b0ef9e094
commit 8e6aa49aa7
2 changed files with 7 additions and 4 deletions

View File

@ -22,7 +22,8 @@
MEMORY MEMORY
{ {
bl : org = 0x08000000, len = 16k /* bootloader section */ bl : org = 0x08000000, len = 16k /* bootloader section */
flash0 : org = DEFINED(BOOTLOADER) ? 0x08008000 : 0x08000000, len = DEFINED(BOOTLOADER) ? 992k : 1024k /* 1M minus 128k for first copy of tune minus another 128k since another sector for another copy of tune */
flash0 : org = DEFINED(BOOTLOADER) ? 0x08008000 : 0x08000000, len = DEFINED(BOOTLOADER) ? 736k : 768k
flash1 : org = 0x00000000, len = 0 flash1 : org = 0x00000000, len = 0
flash2 : org = 0x00000000, len = 0 flash2 : org = 0x00000000, len = 0
flash3 : org = 0x00000000, len = 0 flash3 : org = 0x00000000, len = 0

View File

@ -47,10 +47,12 @@ extern engine_configuration_s *engineConfiguration;
/** /**
* https://sourceforge.net/p/rusefi/tickets/335/ * https://sourceforge.net/p/rusefi/tickets/335/
* *
* Address of second config copy, rounded to 4K. 4K is the page size is it? * In order to preserve at least one copy of the tune in case of electrical issues address of second configuration copy
* * should be in a different sector of flash since complete flash sectors are erased on write.
*/ */
#define FLASH_ADDR_SECOND_COPY (FLASH_ADDR + ((PERSISTENT_SIZE + 4095) & 0xFFFFF000)) #ifndef FLASH_ADDR_SECOND_COPY
#define FLASH_ADDR_SECOND_COPY 0x080C0000
#endif
crc_t flashStateCrc(persistent_config_container_s *state) { crc_t flashStateCrc(persistent_config_container_s *state) {
return calc_crc((const crc_t*) &state->persistentConfiguration, sizeof(persistent_config_s)); return calc_crc((const crc_t*) &state->persistentConfiguration, sizeof(persistent_config_s));