Forum Discussion
Altera_Forum
Honored Contributor
15 years agoThis evening I build a design with MMU and tried it on my de2 board.
When I compile uclinux for my hardware platform i encounter different problems. First I make a board definition for my de2. In folder: nios2-linux\linux-2.6\arch\nios2\boards\my_de2 See http://www.nioswiki.com/linux/creating_a_nios_ii_design_with_an_mmu for more information. I had to change /nios2-linux/linux-2.6/arch/nios2/boards/my_nios2/include/asm/nios.h I added:# elif defined(CONFIG_MY_DE2_FPGA)# include <asm/my_nios2_fpga.h>
# define CONFIG_ALTERA_DE2# define DDR2_TOP_BASE SDRAM_BASE# define DDR2_TOP_SPAN SDRAM_SPAN# define TIMER_1MS_FREQ SYS_CLK_TIMER_FREQ# define TIMER_1MS_BASE SYS_CLK_TIMER_BASE# define TIMER_1MS_SPAN SYS_CLK_TIMER_SPAN# define TIMER_1MS_IRQ SYS_CLK_TIMER_IRQ# define EXT_FLASH_BASE CFI_FLASH_BASE# define EXT_FLASH_SPAN CFI_FLASH_SPAN
For example SDRAM_BASE is found in <asm/my_nios2_fpga.h>. The my_nios2_fpga.h is generated with "sopc-create-header-files --single my_nios2_fpga.h" This basic design with the basic kernel is compiling but when I want to add the lcd_16207 support I get probably the same error.
/data/share/uclinux/nios2-linux/linux-2.6/drivers/char/lcd_16207.c: In function 'lcd16207_module_init':
/data/share/uclinux/nios2-linux/linux-2.6/drivers/char/lcd_16207.c:319: error: 'na_lcd_16207_0' undeclared (first use in this function)
/data/share/uclinux/nios2-linux/linux-2.6/drivers/char/lcd_16207.c:319: error: (Each undeclared identifier is reported only once
/data/share/uclinux/nios2-linux/linux-2.6/drivers/char/lcd_16207.c:319: error: for each function it appears in.)
/data/share/uclinux/nios2-linux/linux-2.6/drivers/char/lcd_16207.c: In function 'LcdWriteLines':
/data/share/uclinux/nios2-linux/linux-2.6/drivers/char/lcd_16207.c:395: error: 'na_lcd_16207_0' undeclared (first use in this function)
/data/share/uclinux/nios2-linux/linux-2.6/drivers/char/lcd_16207.c: In function 'LcdReadLines':
/data/share/uclinux/nios2-linux/linux-2.6/drivers/char/lcd_16207.c:417: error: 'na_lcd_16207_0' undeclared (first use in this function)
make: *** Error 1
make: *** Error 2
make: *** Waiting for unfinished jobs....
And then I had the idea of adding "#define na_lcd_16207_0 LCD_16207_0_BASE" to "/nios2-linux/linux-2.6/arch/nios2/boards/my_nios2/include/asm/nios.h" # elif defined(CONFIG_MY_DE2_FPGA)# include <asm/my_nios2_fpga.h>
# define CONFIG_ALTERA_DE2# define DDR2_TOP_BASE SDRAM_BASE# define DDR2_TOP_SPAN SDRAM_SPAN# define TIMER_1MS_FREQ SYS_CLK_TIMER_FREQ# define TIMER_1MS_BASE SYS_CLK_TIMER_BASE# define TIMER_1MS_SPAN SYS_CLK_TIMER_SPAN# define TIMER_1MS_IRQ SYS_CLK_TIMER_IRQ# define EXT_FLASH_BASE CFI_FLASH_BASE# define EXT_FLASH_SPAN CFI_FLASH_SPAN
#define na_lcd_16207_0 LCD_16207_0_BASE
And the kernel compiled. But when I download the zImage and start the nios2-terminal no response of the nios. Hopefully you have better luck! I'm curious if you get it up and running! :)