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

application can't read bootloader code space

Hi all,

I have an interesting problem where I want to read my bootloaders version (based on the DFU), which I have located at 0x3C100, from my application.

I confirmed that my version word (uint32_t) is making its way to code space at the correct address, but when I try to read it from the main application I always get 0xFFFF.

I have the same code working to read the apps version from 0x16100.

It seems to me that the CPU can't read from bootloader space because some sort of memory protection is in force? But I think the CPU should always be able to read valid code space? Is the SD setting something up that is preventing this?

I'm using SD110 7.1 and Keil.

BR Simon

Parents Reply Children
  • you cannot directly write to the flash. The NVMC->CONFIG register needs to be changed to enable write operation. After finishing writing to flash it has to be changed back to read mode.

    If you are writing from CPU without changing the NVMC to write mode then it wont be stopped but nothing will be changed on the flash. If you read this in debugger, the debugger might not be showing the right value if you set a breakpoint because it knew that the CPU just wrote to that memory. If you step one more instruction, then the debugger is forced to read the memory and then it will find out that operation did not succeed.

Related