Address of flash option byte, used during MK20DX256VLH7 boot.

Status
Not open for further replies.

zman97211

New member
In this post, there is discussion about a byte in flash that if overwritten could stop the Teensie from booting. The address mentioned was 0x41c.

According to this appnote from NXP (Using the Kinetis Security and Flash Protection Features) table 4, the flash option byte is at 0x40d.

Which is correct, so I don't brick my micro? It also appears that other bytes in the table might be useful/important to protect, in addition to the flash option byte.

Thanks in advance.
 
Update provided on that post ....

However, you must be careful with the byte at 0x0000040C. When the MK20 resets, the hardware reads that byte and configures the chip before coming out of the reset state.

I highly recommend you use flash command 0x44 to erase the chip. It's much safer than 0x08 or 0x09. Also, I'd highly recommend adding code to your write routine and avoid reprogramming location 0x0000040C. The Teensy 3.1 bootloader does this, so 0x0000040C can't be changed, even if your HEX file has a different byte.

If you program 0x0000040C with the wrong bits, you'll almost certainly brick your Teensy.


EDIT:
the flash config byte is at 0x0000040C, not at 0x0000041C as this message originally said.
 
Last edited:
According to the manual, the configuration is in 0x400 - 0x40C.
See Chapter 28.3.1


The best is, not to touch the first sector.
Perhaps with editing kinetis.h or the makefile ?


Edit: not makefile. linkerfile .)
 
Last edited:
Opps, that message was wrong. My mistake... sorry. I've edited it just now.

The special config byte is at 0x0000040C.
 
Status
Not open for further replies.
Back
Top