gnu-misc-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Execution of wrong code


From: tns1
Subject: Execution of wrong code
Date: Sun, 04 Jul 2004 08:46:22 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)

I am using the Nios Gnupro tools on an embedded design. The code is compiled & linked to execute SRAM but is stored in Flash. The Flash image adds a small copy routine that copies everything to SRAM on boot and hops over.

So staring with the same srec file, I can either use GDB to download direct to SRAM and step thru the execution, or I can boot and have the same image copied from Flash (minus GDB). Either way, what is strange is that while running, every function call (or ISR) jumps from an SRAM address to a Flash address instead of remaining in SRAM.

The objdump output and nm output show only SRAM addresses for all functions. The code was linked with the -Ttext flag with the SRAM base. Aside from the short Flash copy routine (that is only part of the Flash image), the SRAM image should not even know about Flash, so how the heck is it getting there?

The best I can figure is I either need some additional linker flags, or the default libraries being linked in are forcing this redirection to Flash. I have not had time to disect the build scripts to see if that is the problem. Any other ideas?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]