Is it a bad idea to enlarge the startup area in mk20dx256.ld?

Status
Not open for further replies.

christoph

Well-known member
Currently we have the following lines in the linker script:
Code:
SECTIONS
{
	.text : {
		. = 0;
		KEEP(*(.vectors))
		*(.startup*)
		/* TODO: does linker detect startup overflow onto flashconfig? */
		. = 0x400;
I'd like to enlarge the startup are a bit because I want to try to run code compiled with -O0, and in that case the linker complains that the location pointer can't be moved backwards. I'd need
Code:
SECTIONS
{
	.text : {
		. = 0;
		KEEP(*(.vectors))
		*(.startup*)
		/* TODO: does linker detect startup overflow onto flashconfig? */
		. = 0x430;
Is that OK or does it interfere with some other magic I don't know about? At least the linker doesn't complain any more.

Regards

Christoph
 
Is that OK or does it interfere with some other magic I don't know about?

It is absolutely NOT ok. Locations 0x400 to 0x40F are special config bytes. You must not put arbitrary data there.

Teensy Loader will disregard whatever you try to put into location 0x40C, to prevent you from using a config that would brick your Teensy. If you try to program ordinary code there, it will get changed during loading.
 
Indeed ugfx only compiles with -O0, and I compile all my code in one go and with the same settings for all files, so relocating the reset handler was necessary in this case. I have to consider a more fine-grained build process...
 
Status
Not open for further replies.
Back
Top