Alright, it seems I am still having trouble modifying a k20 hid_mouse example, the k60 hid_mouse example is being read by the bootloader without error
(but i need a k20 application working with a k20 bootloader.)
I have modified the k20 hid_mouse *.lcf file to the following (The rest of the file remained the same)
I modified m_interrupts, m_cfmpromtrom, m_text..and added vectorram and its reference. Also in .interrupts the __VECTOR_RAM was changed to __VECTOR_ROM
Have I made a mistake in the *.lcf file?
------------------------------------------------------------------------------------------------------------------------------------------------
MEMORY {
m_interrupts (RX) : ORIGIN = 0x00010000, LENGTH = 0x000001BC
m_cfmprotrom (RX) : ORIGIN = 0x00010400, LENGTH = 0x00000010
m_text (RX) : ORIGIN = 0x00010810, LENGTH = 0x00040000-0x00000800
vectorram (RWX): ORIGIN = 0x1FFF0000, LENGTH = 0x00000400
m_data (RW) : ORIGIN = 0x1FFF8000, LENGTH = 0x00010000-0x00000200
m_bdt (RW) : ORIGIN = 0x20007E00, LENGTH = 0x200 #SRAM Upper
}
KEEP_SECTION { .vectortable }
KEEP_SECTION { .cfmconfig }
KEEP_SECTION { .m_bdt }
SECTIONS {
.interrupts :
{
___VECTOR_ROM = .; #changed from ___VECTOR_RAM
* (.vectortable)
. = ALIGN (0x4);
} > m_interrupts
.vectorram : #added this line
{
___VECTOR_RAM = .;
} > vectorram
corresponding changes were made to copy the vector table to ram, from line 840 in main_kinetis.c,
Why did I add this here? Because this is the only location in the project that refers to "SCB_VTOR"
| /* Point the VTOR to the new copy of the vector table */ |
#if (defined(__CWCC__) || defined(__IAR_SYSTEMS_ICC__) || defined(__CC_ARM)|| (defined __arm__))
| if(___VECTOR_RAM != ___VECTOR_ROM) //changed -RH | |
| { | |
| | for(k=0; k<400;k++) //changed -RH | |
| | { | |
| | | ___VECTOR_RAM[k] = ___VECTOR_ROM[k]; //changed -RH |
| | } | |
| } | |
| SCB_VTOR = (uint_32)___VECTOR_RAM; | |
Thanks.