From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: at91_enthus <nwromania@domain.hid>
Cc: xenomai-help <xenomai@xenomai.org>
Subject: Re: [Xenomai-help] Segmentation Fault when writing in registers (AT91SAM - ARM9)
Date: Tue, 25 Jan 2011 07:51:31 +0100 [thread overview]
Message-ID: <4D3E72F3.6040400@domain.hid> (raw)
In-Reply-To: <AANLkTimcpzTWvYyEfdVVqEqO_-hb-jb1p7kLLDaVrzrV@mail.gmail.com>
at91_enthus wrote:
> On Tue, Jan 25, 2011 at 12:20 AM, Gilles Chanteperdrix <
> gilles.chanteperdrix@xenomai.org> wrote:
>
>> at91_enthus wrote:
>>>>> Oh. I assumed without mlockall (it wasn't part of my original code).
>>>>> Now, I placed mlockall in my original code (right before
>>>> open_controller())
>>>>> and the pin gets toggled according to my scope.
>>>> Ok. Show me the Makefile then.
>>> And the code which works.
>>>
>>>
>>> see attachment
>>>
>>>
>>>> Including the
>>>> value of the defines please (not all of them, only those the program
>>>> uses for open_controller).
>>>>
>>>>
>>>>
>>> #define AT91C_BASE_AIC 0xFFFFF000 // (AIC) Base Address
>>> #define AT91C_BASE_PIOB 0xFFFFF600 // (PIOB) Base Address
>>> #define PIO_PER 0x00000000 // (PIO_PER) PIO Enable Register
>>> #define PIO_PDR 0x00000004 // (PIO_PDR) PIO Disable Register
>>> #define PIO_PSR 0x00000008 // (PIO_PSR) PIO Status Register
>>> #define PIO_OER 0x00000010 // (PIO_OER) Output Enable
>> Register
>>> #define PIO_SODR 0x00000030 // (PIO_SODR) Set Output Data
>> Register
>>> #define PIO_CODR 0x00000034 // (PIO_CODR) Clear Output Data
>>> Register
>>> #define PIO_PPUDR 0x00000060 // (PIO_PPUDR) Pull-up Disable
>> Register
>>> #define PIO_MDDR 0x00000054 // (PIO_MDDR) Multi-driver Disable
>>> Register
>>>
>>>
>> I am unable to reproduce your issue. That said, I am using standard
>> Makefiles, that is:
>>
>> XENO_CONFIG = DESTDIR="$(staging)" $(staging)/bin/xeno-config
>>
>> XENO_NATIVE_CPPFLAGS = $(shell $(XENO_CONFIG) --skin=native --cflags)
>> XENO_NATIVE_LIBS = $(shell $(XENO_CONFIG) --skin=native --ldflags)
>>
>> Where staging would be "/" in your case.
>>
>> If I want static libraries, I prepend -static to XENO_NATIVE_LIBS, I do
>> not try to link both with static and dynamic libraries. I suspect this
>> is the cause of your problem, either that or the fact that you have some
>> ulimit.
>>
>> Note that my toolchain does not even allow mixing static and dynamic
>> libraries. I get this warning when linking:
>>
>> /usr/local/arm-2010q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/../../../../arm-none-linux-gnueabi/bin/ld:
>>
>> /usr/local/arm-2010q1/bin/../arm-none-linux-gnueabi/libc/armv4t/usr/lib/libc.a(dl-tsd.o)(.text+0x18):
>> R_ARM_TLS_LE32 relocation not permitted in shared object
>>
>> And a segmentation fault when running (though I do not even access the
>> mmapped area).
>>
>> --
>> Gilles.
>>
>
>
> I'll try to fix this issue later today. Thanks a lot for taking the time to
> help me.
Yes, note that I wasted a lot of time: I knew from the beginning that
the Makefile was broken, and this should have been the first thing I
verified.
Anyway, the "first-hand" examples we provide are those documented here:
http://www.xenomai.org/index.php/Examples
They come with working Makefiles, which you are encouraged to re-use.
Also, xeno-config lacks support for getting the RTDM skin flags, but I
am going to add it to 2.5.6.
--
Gilles.
next prev parent reply other threads:[~2011-01-25 6:51 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-25 2:33 [Xenomai-help] Segmentation Fault when writing in registers (AT91SAM - ARM9) at91_enthus
2011-01-25 2:36 ` Gilles Chanteperdrix
2011-01-25 2:41 ` Gilles Chanteperdrix
2011-01-25 3:13 ` at91_enthus
2011-01-25 3:25 ` Gilles Chanteperdrix
2011-01-25 4:14 ` at91_enthus
2011-01-25 4:16 ` Gilles Chanteperdrix
2011-01-25 4:23 ` at91_enthus
2011-01-25 4:28 ` Gilles Chanteperdrix
2011-01-25 4:44 ` at91_enthus
2011-01-25 4:49 ` Gilles Chanteperdrix
2011-01-25 4:54 ` Gilles Chanteperdrix
2011-01-25 5:00 ` at91_enthus
2011-01-25 5:02 ` Gilles Chanteperdrix
2011-01-25 5:08 ` at91_enthus
2011-01-25 5:12 ` Gilles Chanteperdrix
2011-01-25 5:32 ` at91_enthus
2011-01-25 6:20 ` Gilles Chanteperdrix
2011-01-25 6:45 ` at91_enthus
2011-01-25 6:51 ` Gilles Chanteperdrix [this message]
2011-01-25 9:38 ` at91_enthus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D3E72F3.6040400@domain.hid \
--to=gilles.chanteperdrix@xenomai.org \
--cc=nwromania@domain.hid \
--cc=xenomai@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.