This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

invalid address (LPC3250)

Hi
I work with an LPC3250 and I realized that I can read or write into memory address which supposed to be invalid without any problem (for example 0x04000000, the user manual mentions that writing into this address has no effect).
can you give me an explanation? thanks

Parents
  • Without spending time with the documentation for that specific microcontroller, I just want to make some notes.

    1) Some memory controllers throws exceptions if you try to access specific memory regions. Some doesn't. Some does for just some memory regions.

    2) Some memory controllers don't perform a full address decode, resulting in aliasing. I.e. multiple spaces in the address range will map into the same memory region. So you could have 32kB of RAM, but potentiall have a full MB of address range where you can have a pointer pointing to a variable. And the pointer + 32kB will point to the same variable. And the pointer + 64k and +96k and +128k...

    3) Normally, you have to settle for it being "undefined" when accessing addresses outside what the manual mentions as valid addresses. Getting exceptions is just a lucky bonus, since it is a quicker way to spot errors in the code.

Reply
  • Without spending time with the documentation for that specific microcontroller, I just want to make some notes.

    1) Some memory controllers throws exceptions if you try to access specific memory regions. Some doesn't. Some does for just some memory regions.

    2) Some memory controllers don't perform a full address decode, resulting in aliasing. I.e. multiple spaces in the address range will map into the same memory region. So you could have 32kB of RAM, but potentiall have a full MB of address range where you can have a pointer pointing to a variable. And the pointer + 32kB will point to the same variable. And the pointer + 64k and +96k and +128k...

    3) Normally, you have to settle for it being "undefined" when accessing addresses outside what the manual mentions as valid addresses. Getting exceptions is just a lucky bonus, since it is a quicker way to spot errors in the code.

Children
  • thank you for the explanation.
    the problem is that when I do a DMA transfer with undefined addresses it works correctly (I did it by accident, I used the address 0x00800000 instead of 0x08000000 and the address 0x00803000 instead of 0x08003000) but the transfer fails with defined addresses (0x08000000 and 0x08003000). thank you for the help