- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have upload the kernal and filesystem to flash,and the kernal runs very well.Then i build the example 'hello world',it runs very well too.
Now i want to handle the PIO in uclinux,like 'hello led' in nios IDE,i make an application project ,but i can't use the API that ALTERA have provided, like IOWR_ALTERA_AVALON_PIO_DATA(LED_BASE, led).How can i do with it. On the other hand,can any one tell me where can i download the nios-elf-tools(cross compile tool)in the linux. Thanks.Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
you can best use the inl outl or inb outb macro's in linux for accessing the GPIO.
for the crosscompiler you can look for marc's one but I believe hissite is down at the moment http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/sad.gif- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- originally posted by wgoossens@Dec 14 2005, 06:41 PM you can best use the inl outl or inb outb macro's in linux for accessing the gpio.
for the crosscompiler you can look for marc's one but i believe hissite is down at the moment http://forum.niosforum.com/work2/style_emoticons/<#emo_dir#>/sad.gif
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=11537)
--- quote end ---
--- Quote End --- Thanks! Can you tell me more about inl outl .....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
try:# man inl
or# man outl .... it basicaly reads a long (inl) or a byte (inb) from the port you pass as an argument or writes a long (outl) or a byte (outb). for example:outb(inb(GPIO1),GPIO2);
where GPIO1 and GPIO2 are defined as base-addresses of your GPIO components. reads a byte from the base address of one GPIO and outputs this no a second GPIO.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In the header file...../bin/eclipse/plugins/com.microtronix.nios2linux.kernel_1.4.0/linux-2.6.x/include/asm-nios2nommu/io.h
There are # define writew(b,addr) ({ __asm__ __volatile__( "sthio %0, 0(%1)" : : "r"(http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/cool.gif , "r" (addr)); }) and other application like this.But in my Application Project,when i use writew or other application that has defined in the io.h,there are error undefined reference to `writew',I have include the header file like this# <asm/io.h>.Can anyone tell me why. Thanks. http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/sad.gif- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
> there are error undefined reference to `writew',I have include the header file like
> this# <asm/io.h>.Can anyone tell me why. __KERNEL__ must be defined. If you define this for an application, you'll likely pull in other definitions that will cause compile-time problems. I recommend you copy the macros you need into a header file in your application source tree. It'll probably save you some headaches. Regards, --Scott
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page