Forum Discussion
Altera_Forum
Honored Contributor
15 years ago --- Quote Start --- Have you checked what the elf program headers say? (objdump -p) --- Quote End --- This is what objdump says
Program Header:
LOAD off 0x000000b4 vaddr 0x02000000 paddr 0x02000000 align 2**0
filesz 0x000189f0 memsz 0x000189f0 flags r-x
LOAD off 0x00018aa4 vaddr 0x020189f0 paddr 0x020189f0 align 2**0
filesz 0x00001ec4 memsz 0x0000c378 flags rw-
LOAD off 0x0001a968 vaddr 0x03008000 paddr 0x02024d68 align 2**0
filesz 0x00000160 memsz 0x00000160 flags r-x
LOAD off 0x0001aac8 vaddr 0x0300a000 paddr 0x02024ec8 align 2**0
filesz 0x00000020 memsz 0x00000020 flags rw-tc_code section address is 0x03008000 tc_data section address is 0x0300a000 They are present here --- Quote Start --- I've had the JTAG loader correctly loading code to multiple memory areas. But I did have to hack at the linker script to get the code linked into the correct places. --- Quote End --- In my case it is the JTAG loader which doesn't correctly load code. Linking seems to be ok. Latest test: I inserted again these in the beginning of main() 1. ALT_LOAD_SECTION_BY_NAME(tc_data); 2. ALT_LOAD_SECTION_BY_NAME(tc_code); Now the variable in tc_data is initialized correctly after line 1 is executed, while I find tc_code still empty after execution of line 2. <<Update>> I discovered that I can't write tc_code memory. No error on write but it always reads 0xFF. Why?!? In sopc is defined ram 32bits and it is exactly like tc_data. Same clock; the only difference is that tc_code is connected to Nios tc instruction port and tc_data to Nios tc data port. <<end Update>>