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

Does the MBR decide not to copy a new bootloader if it's identical to the old one?

I want to confirm with Nordic staff that the MBR compares the new bootloader with the one it will replace when executing SD_MBR_COMMAND_COPY_BL. It seems that after a comparison, the MBR will only erase and copy if the two are different. Is this correct?

Parents
  • Complete answer EDIT

    Hi,

    The SD_MBR_COMMAND_COPY_BL, does compare the old image with the new image. This is required because of the internals of how this copy is done.

    The SD_MBR_COMMAND_COPY_SD, command does NOT compare the old image with the new image.

  • Are you positive? The behavior I'm seeing is the opposite --the Nordic MBR (SD 7.1.0) only copies the new BSL if it differs from the old one.

    The reason I ask is because I use the last 1k flash page of my BSL like this:

    --------------------------------- <-- End of page
    |Settings that should be erased |
    |    when the BSL is updated    |
    ---------------------------------
    |     Last part of BSL code     |
    |                               |
    |                               |
    --------------------------------- <- Start of page
    

    But those settings atop the BSL code don't seem to change when the "new" BSL is identical to the resident BSL. However, in an experiment, I've found that changing a few of the new BSL's bytes (in a different flash page than the one above) caused the settings to get erased as I would expect.

Reply
  • Are you positive? The behavior I'm seeing is the opposite --the Nordic MBR (SD 7.1.0) only copies the new BSL if it differs from the old one.

    The reason I ask is because I use the last 1k flash page of my BSL like this:

    --------------------------------- <-- End of page
    |Settings that should be erased |
    |    when the BSL is updated    |
    ---------------------------------
    |     Last part of BSL code     |
    |                               |
    |                               |
    --------------------------------- <- Start of page
    

    But those settings atop the BSL code don't seem to change when the "new" BSL is identical to the resident BSL. However, in an experiment, I've found that changing a few of the new BSL's bytes (in a different flash page than the one above) caused the settings to get erased as I would expect.

Children
No Data
Related