AnsweredAssumed Answered

K64 - What's special about code address 0x10000

Question asked by joe hinkle on Sep 18, 2016
Latest reply on Sep 19, 2016 by Mark Butcher

I'm writing a Bootloader with the code size ending up around 45K.  I wanted to start the Application code on a 4K boundary (K64 flash sector size is 4K) so I selected address 0x10000 to be the location of my application (or so I thought).


Address 0x10000 is the 64K boundary.  I'm using a 1 Meg K64 cpu.


I want to do a simple test to see if the Application could be loaded so I test the first byte (stack size in vectors) to see if its 0xFF.


byte *p = (byte*)0x10000;


The assembler code for this results in a HardFault when performing an indirect memory read from a register (register holds 0x10000)).


My debugger (Crossworks) says "Memory Read Failure" when asked to show *p.


When the debugger is asked to dump any memory location between 0x10000 and 0x100010 (first 16 bytes of the second 64K memory block) -- it shows all blanks and reports read error.


If I change my Application's starting address to 0x11000 (64K + 4K) --- all is well.


Can someone explain what's happening at address 0x10000?


I don't want to start the application code lower than 0x10000 if I don't understand what the issue is with those 16 bytes.


Thanks in advance for any help/comments.