Nios2 problems when building tests

Roger Dahlkvist ruppe at kth.se
Fri Mar 27 13:32:01 UTC 2009


Instead of using the simulator I just created a simple system with the same contents as the nios2_iss bsp, except for an external sdram since the FPGA I'm currently using can't have enough onchip memory. I replaced linkcmd and made the required changes to bsp.h

So far it runs just perfectly on hardware. Currently it's only a single task counting numbers though.
I just had a brief look in the debugger and as far as I can tell, it looks ok.

//Roger
 


Joel Sherrill wrote:
> Morten Kristiansen wrote:
>
>> As a shortcut, could you send me the binary image you have, please?
>>
>>
>>
> Grrr.. now it isn't linking for me. Maybe I didn't get as far as I
> remembered
> or I have deleted the RTEMS tree. It looks close so i will work on it.
>
> Maybe in the morning you will have something if my build finishes.
>
>
My changes that should be committed now are.  Attached
is a patch for the Makefile's so we don't use a file list and
work with the old ar command.

The starting stack is CLEARLY at the end of RAM in the
start/start.S and startup/linkcmds.  This is used as
work area so getting clobbered early.

Attached in a private email is my hello if you want to look at
it but we know the stack is broken.
> --joel
>
>
>> /MK
>>
>> 2009/3/25 Roger Dahlkvist <ruppe at kth.se>:
>>
>>
>>> Hi,
>>>
>>> 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
>>>
>>> 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.
>>>
>>> _-joel
>>>
>>>
>>>> Looking forward to your inputs.
>>>>
>>>> //Roger
>>>>
>>>>
>>>> ________________________________________
>>>> 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.
>>>>
>>>> /MK
>>>>
>>>>
>>>>
>>> --
>>> 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
>>>
>>>
>>>
>>>
>>>
>
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.com
> http://rtems.rtems.org/mailman/listinfo/rtems-users
>




More information about the users mailing list