[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Nios2 problems when building tests
- Date: Wed, 25 Mar 2009 18:40:54 +0100
- From: ruppe at kth.se (Roger Dahlkvist)
- Subject: Nios2 problems when building tests
Yes, I defenately think the errors are memory related. I'll look at the hints you gave.
When I for example run hello.exe in the Altera NiosII ISS I get the following errors before the program terminates.
Error! : Failed memory access in component cpu_0 - Reading data 0x0 from uninitialized memory (addr = 0x1f33c)
Error! : Simulation failed in component cpu_0 at instruction 33372 (PC=0x8eb8 instr=0x2c000017).
Roger Dahlkvist wrote:
> Thanks, any help is greatly appreciated.
> The status for me right now is that I have switched to newlib-1.17.0. I also changed both cpukit/wrapup/Makefile.am and c/src/wrapup/Makefile.am, as suggested.
> That fixed most errors, now that both librtemscpu.a and librtemsbsp.a are added correctly.
Then you are probably close to in sync with what I have
on my laptop at home.
> I've tried myself to solve the remaining issues, by including /shared/bsppretaskinghook.c to libbsp.a, and define WorkAreaBase in linkcmds.
> However the resulting tests fail in the simulator, so that might not have been the right way to go, or there are other things to consider aswell.
How do the tests fail?
Usually at this point it is memory layout.
All BSPs now use the same framework for BSP initialization
and most use exactly the same mechanism for dividing memory
between the RTEMS Workspace and C program heap.
Can you get debug IO via printk at this point on the simulator?
If so, make printk work and turn on debugging in libbsp/shared/bootcard.c.
If not, or if it is just as easy, trace through bootcard.c in the debugger
and see if things look ok.
Also (very common), the starting stack (the one the BSP start code
runs on) may NOT be properly accounted for in the linkcmds and
your work memory (workspace and C program heap) may overlap it.
Then the init is clobbering the stack out from underneath you.
> Looking forward to your inputs.
> Fr?n: millibit at gmail.com [millibit at gmail.com] för Morten Kristiansen [millibit+rtems at gmail.com]
> Skickat: den 24 mars 2009 09:30
> Till: Joel Sherrill
> Kopia: Roger Dahlkvist; rtems-users at rtems.com
> ?mne: Re: Nios2 problems when building tests
> 2009/3/20 Joel Sherrill <joel.sherrill at oarcorp.com>:
>> My full NIOS patches are at home. Morten can help you
>> get things going.
> I should think so. I'll take a look at it this evening.
>> The biggest issue you are facing is that the NIOS II binutils
>> version Altera uses is TOO old for the feature used in cpukit/wrapup.
> I fetched the relevant versions into Subversion and tried merging. It
> wasn't straightforward, but as a quick solution I can create a patch
> that allows it to read options from a file.
Joel Sherrill, Ph.D. Director of Research & Development
joel.sherrill at OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985