Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12609 Discussions

uCLinux NIOSII LCD 16207 problem

Altera_Forum
Honored Contributor II
1,018 Views

Hi all, 

I'm very new uClinux user. I'm playing with an Altera DE2 kit, trying to make working an example 

found in the NIOSWIKI (http://www.nioswiki.com/operatingsystems/uclinux/lcd_16207). 

I had a first problem identifyng the Kconfig and Makefile in uClinux-dist/linux-2.6.x/drivers/char. 

I dont have them in my folder. What to do? 

I tried many things, first of all i tried to add them by myself and something seemed to be right compiled. 

I tried also another way, trough the make menuconfig in uClinux-dist to enable the LCD16207 support. 

It seems to me that both these methods give more or less the same result. But, what's the difference? 

Anyway, the second step is to play examples found in NIOSWIKI. Compilation succeed, uClinux boot  

perfectly, lcd16207 can be found in /dev, but examples don't work, none of them, except from "writef" 

that is only able to put some characters on the display but nothing more than the first 4 chars. 

Please, I need help to undersand the procedure to access hardware by user space. 

Thanks a lot All. 

0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
293 Views

Hi, 

 

I also have a DE2 and have been trying to get the LCD working. I followed the wiki. (I had no missing files.) The kernel compiled with the driver ok but I could not see the boot message (hello!). I tried the writef example and the lcd16207 example. Neither worked. 

 

I had to make the following modification to bypass the cache in the driver code in lcd_16207.h: 

# define ADR_LCD_COMMAND na_lcd_16207_0 + 0x80000000# define ADR_LCD_READY (na_lcd_16207_0 + 0x80000000 +4)# define ADR_LCD_DATA (na_lcd_16207_0 + 0x80000000 + 8)# define ADR_LCD_READ (na_lcd_16207_0 + 0x80000000 + 12) 

 

 

Now, after the kernel boots, I see the "hello!" message on the LCD. ( I had the driver built into the kernel, not a module) The writef example works and the lcd16207 example works. 

 

For the second example, the string to be displayed is entered on the command line (and not 1234... as I first thought) 

 

>lcd16207 abcdefg 

 

Your symptoms seem a bit different but I hope this can help anyway. 

 

Jeanne 

 

 

 

0 Kudos
Altera_Forum
Honored Contributor II
293 Views

Hello je1ro: 

I follow your advice,and it also work.Thank you very much!but I don't know why.why do you add 0x80000000 to it?what is the reason?please tell me?Thank you a lot again!
0 Kudos
Altera_Forum
Honored Contributor II
293 Views

If the address bit 31 is set, NIOS disables the cache for that access. This is necessary for I/O accesses. This only works for the non-MMU version of NIOS. 

 

OTHO AFAIK, there are arch independent macros defined in the Linux header files that can be used to define I/O addresses in a hardware-independent way. 

 

-Michael
0 Kudos
Altera_Forum
Honored Contributor II
293 Views

 

--- Quote Start ---  

If the address bit 31 is set, NIOS disables the cache for that access. This is necessary for I/O accesses. This only works for the non-MMU version of NIOS. 

 

OTHO AFAIK, there are arch independent macros defined in the Linux header files that can be used to define I/O addresses in a hardware-independent way. 

 

-Michael 

--- Quote End ---  

 

 

so it is decided by non-MMU version of NIOS II,when you set the address bit 31 to 1,there is no cache.Maybe I know it now! Thank you very much!
0 Kudos
Reply