Forum Discussion
Altera_Forum
Honored Contributor
19 years agoUgh, I think I just figured it out. Looking over my replies above, I noticed something really strange about the elfobj dump. Note that for the first couple of sections in the program load header, the thing called vaddr matches the thing called paddr. However, the last two sections don't match. Below again are the relevant sections, clipped this time.
LOAD off 0x000000b4 vaddr 0x00010000 paddr 0x00010000
LOAD off 0x00001a34 vaddr 0x00011980 paddr 0x00011980
LOAD off 0x00001f84 vaddr 0x00020000 paddr 0x00011fe4
LOAD off 0x00001fcc vaddr 0x00040000 paddr 0x0001202c What's happening here is that the linker is merely jamming all the code together into the first block, even the stuff that belongs in the second and third blocks. What causes this to happen? Look at this bs from "generated.x" (you might have to maximize your browser to make sense of it) .onchip_memory_int_code : AT (LOADADDR (.onchip_memory_main) + SIZEOF (.onchip_memory_main))
{
PROVIDE (_alt_partition_onchip_memory_int_code_start = ABSOLUTE(.));
*(.onchip_memory_int_code .onchip_memory_int_code.*)
. = ALIGN(32 / 8);
PROVIDE (_alt_partition_onchip_memory_int_code_end = ABSOLUTE(.));
} > onchip_memory_int_code
PROVIDE (_alt_partition_onchip_memory_int_code_load_addr = LOADADDR(.onchip_memory_int_code));
.onchip_memory_int_data : AT (LOADADDR (.onchip_memory_int_code) + SIZEOF (.onchip_memory_int_code))
{
PROVIDE (_alt_partition_onchip_memory_int_data_start = ABSOLUTE(.));
*(.onchip_memory_int_data .onchip_memory_int_data.*)
. = ALIGN(32 / 8);
PROVIDE (_alt_partition_onchip_memory_int_data_end = ABSOLUTE(.));
} > onchip_memory_int_data
PROVIDE (_alt_partition_onchip_memory_int_data_load_addr = LOADADDR(.onchip_memory_int_data)); You can see from the first line of each of these sections that the linker is merely tacking the code intended for these next two RAM blocks onto the main RAM block. My suspicion here is that it is set up for storage into a Flash EPROM. So short of writing my own make file, where is the magic switch that tells the system builder and compiler not to cram all my stuff together? Bonus question - why does the debugger not notice the vaddr stuff and load my code into RAM properly for debugging?