This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

randomly happened flash corruption after power cycling only with bootloader flashed (S132 SoftDevice v2.0.0 SDK11.0.0)

Hi, I see an interesting situation.

I got flash corruption with values 0xff after random power cycling and it's happened only if I have flashed the bootloader

  • Hi,

    This looks like a continuation of the last posts on this case. As that was idle for a long time so I suggest we continue here.

    There is no a lot of information about this issue. However, writing to flash can only change '1' to '0'. So if you see unexpected 0xff ('1's), that means that the flash page must have been erased. If this only happens when a bootloader is in place, I suspect the bootloader is responsible for this.

    Some questions:

    • Which page(s) are unexpectedly erased?
    • Do you see this only during/after a DFU update, or is it enough that a bootloader is present?
    • Have you modified the SDK bootloader much? If so, what changes have you made?
  • Hi,
    sorry for the long time reply, it's so difficult to reproduce. Btw I'll send you a corrupted memory dump when it's finally happened

    1. unexpectedly erased pages are placed in between Bootloader and Application (marked with red User Data)

    2. seems it's enough to present Bootloader but it's happened only after power cycle and not so often

    3.  not to much here is Bootloader addresses 

    #define BOOTLOADER_REGION_START 0x0007A000
    #define BOOTLOADER_SETTINGS_ADDRESS 0x0007F000 
    #define BOOTLOADER_MBR_PARAMS_PAGE_ADDRESS 0x0007E000 
    #define CODE_PAGE_SIZE 0x1000
    #define DFU_REGION_TOTAL_SIZE (BOOTLOADER_REGION_START - CODE_REGION_1_START)
    #define DFU_APP_DATA_RESERVED CODE_PAGE_SIZE * 8 
    #define DFU_IMAGE_MAX_SIZE_FULL (DFU_REGION_TOTAL_SIZE - DFU_APP_DATA_RESERVED) 
    #define DFU_IMAGE_MAX_SIZE_BANKED (((DFU_IMAGE_MAX_SIZE_FULL) - (DFU_IMAGE_MAX_SIZE_FULL % (2 * CODE_PAGE_SIZE)))/2)
    #define DFU_BL_IMAGE_MAX_SIZE (BOOTLOADER_SETTINGS_ADDRESS - BOOTLOADER_REGION_START) 
    #define DFU_BANK_0_REGION_START CODE_REGION_1_START /**< Bank 0 region start. */
    #define DFU_BANK_1_REGION_START (DFU_BANK_0_REGION_START + DFU_IMAGE_MAX_SIZE_BANKED)

     

  • Hi,

    ivnn said:
    unexpectedly erased pages are placed in between Bootloader and Application (marked with red User Data)

    I see in this case it is a page in the middle of the user data section. Is the data before and after the erased pages intact, or is that corrupted somehow (either just written to, or erased and written to)?

    ivnn said:
    seems it's enough to present Bootloader but it's happened only after power cycle and not so often

    I see. The bootloader should never write to the flash unless there is a DFU update, or unless the bootloader settings page is corrupt (but that is only for resent SDK versions, and in that case it should only write to the bootloader settings page, which is not the case here).

    Seeing the defines from your last post is relevant, but I must admit I am stuck and do not see any sensible explanation for this, so I would very much like to see your complete bootloader code (full project). Is that possible? Also, which SDK version do you use?

    Can we be confident that this is caused by the bootloader, or could it be that your application only misbehaves in the tests when you have a bootloader? What if you make a test application where you remove all code that writes to or erases flash. Are you able to reproduce the issue then? Can you share your application code as well?

Related