CPU : K60FN1M0M15
KDS compiler & Debugger GNU
Linker file.ld add MEM_ExternalRam to MEMORY.
MEMORY
{
MEM_vectorrom (RX) : ORIGIN = 0x00000000, LENGTH = 0x00000400
MEM_cfmprotrom (R) : ORIGIN = 0x00000400, LENGTH = 0x00000020
MEM_Versionrom (RX) : ORIGIN = 0x00000420, LENGTH = 0x00000030
MEM_rom (RX) : ORIGIN = 0x00000480, LENGTH = 0x000FFBF0
MEM_crcrom (RX) : ORIGIN = 0x0007EFF8, LENGTH = 0x00000008
MEM_bootswaprom (RX) : ORIGIN = 0x0007F000, LENGTH = 0x00001000
MEM_ram (RW) : ORIGIN = 0x1FFF0000, LENGTH = 0x00020000 /* SRAM - RW data */
/* kernel space starts after RAM variables (Location of MQX Kernel data + MQX heap) */
MEM_end_of_kd (RW) : ORIGIN = 0x2000FFF0, LENGTH = 0x00000000
/* Boot stack reused by MQX Kernel data */
MEM_bstack (RW) : ORIGIN = 0x2000FA00, LENGTH = 0x00000200 /* Boot stack */
MEM_end_bstack (RW) : ORIGIN = 0x2000FC00, LENGTH = 0x00000000 /* Boot stack end address requires 4B alignment */
MEM_ExternalRam (RXW) : ORIGIN = 0xA0000000, LENGTH = 0x00020000 /* External Ram =RW data 128 K */
}
Added Section :
.ExternalRam :
{ . = ALIGN (0x4);
__ExternalRam_Start = .;
KEEP(*(.ExternalRamSection))
. = ALIGN (0x4);
__ExternalRam_End = .;
} > MEM_ExternalRam
Code file Addded :
__attribute__((section(".ExternalRamSection"))) struct Diagnostics_Queue_Struct External_Diagnostics_Queue;
MAP File :
.ExternalRam 0xa0000000 0x401c
0xa0000000 . = ALIGN (0x4)
0xa0000000 __ExternalRam_Start = .
*(.ExternalRamSection)
.ExternalRamSection
0xa0000000 0x401c ./Source/Run/Diagnostics.o
0xa0000000 External_Diagnostics_Queue
0xa000401c . = ALIGN (0x4)
0xa000401c __ExternalRam_End = .
OUTPUT(BlackBox.elf elf32-littlearm)
This will compile and like OK but when I start the debugger to download my code into the target board I get.
Connection from "127.0.0.1" via 127.0.0.1
Disconnected from "127.0.0.1" via 127.0.0.1
Target Disconnected.
Target Disconnected.
If I remove :
__attribute__((section(".ExternalRamSection"))) struct Diagnostics_Queue_Struct External_Diagnostics_Queue;
Recompile and start the debugger it will work OK.
Jim Burton