|
|
|
@ -195,3 +195,43 @@ getFlashSize() { |
|
|
|
|
return 0; |
|
|
|
|
return 1 << size_id; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const uint32_t getUserPageSectionStart() |
|
|
|
|
{ |
|
|
|
|
enum flash_size_map map = system_get_flash_size_map(); |
|
|
|
|
switch(map) |
|
|
|
|
{ |
|
|
|
|
case FLASH_SIZE_4M_MAP_256_256: |
|
|
|
|
return FLASH_SECT + FIRMWARE_SIZE - 3*FLASH_SECT;// bootloader + firmware - 12KB (highly risky...)
|
|
|
|
|
case FLASH_SIZE_8M_MAP_512_512: |
|
|
|
|
return FLASH_SECT + FIRMWARE_SIZE; |
|
|
|
|
case FLASH_SIZE_16M_MAP_512_512: |
|
|
|
|
case FLASH_SIZE_16M_MAP_1024_1024: |
|
|
|
|
case FLASH_SIZE_32M_MAP_512_512: |
|
|
|
|
case FLASH_SIZE_32M_MAP_1024_1024: |
|
|
|
|
return 0x0FC000; |
|
|
|
|
default: |
|
|
|
|
return 0xFFFFFFFF; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const uint32_t getUserPageSectionEnd() |
|
|
|
|
{ |
|
|
|
|
enum flash_size_map map = system_get_flash_size_map(); |
|
|
|
|
switch(map) |
|
|
|
|
{ |
|
|
|
|
case FLASH_SIZE_4M_MAP_256_256: |
|
|
|
|
return FLASH_SECT + FIRMWARE_SIZE - 2*FLASH_SECT; |
|
|
|
|
case FLASH_SIZE_8M_MAP_512_512: |
|
|
|
|
return FLASH_SECT + FIRMWARE_SIZE + 2*FLASH_SECT; |
|
|
|
|
case FLASH_SIZE_16M_MAP_512_512: |
|
|
|
|
case FLASH_SIZE_16M_MAP_1024_1024: |
|
|
|
|
return 0x1FC000; |
|
|
|
|
case FLASH_SIZE_32M_MAP_512_512: |
|
|
|
|
case FLASH_SIZE_32M_MAP_1024_1024: |
|
|
|
|
return 0x3FC000; |
|
|
|
|
default: |
|
|
|
|
return 0xFFFFFFFF; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|