- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
I am trying to switch over to eCos from MicroC/OS-II. I have succesfully installed eCos for NIOS 5.0. I have built and run the eCos hello example.
I am now trying to modify the hello example to write to the LCD of my dev kit. Altera Cyclone II standard 2C35. The code will build with my reference to the /dev/lcd_display put I get no output to the LCD. I have tried running in debug but this seems to misbehave when I get to my lCD code. Anyone run across this ? Thanks.Link copiado
11 Respostas
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Hi jkealty,
Make sure the Compact Flash card is not plugged into it's socket. Due to a hardware constraint on the Nios evaluation boards, you cannot have the LCD and Compact Flash plugged in simultaneously.- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Hi,
Thanks for the suggestion, but I do not have the compact flash inserted. I did some debuging of this and I am finding that the /dev/lcd_display is not being recognised by the system. I am checking the return value from cyg_io_lookup and it indicates that the lcd_display does not exist. I am wondering if any devices are being defined since I get the same results for the LED's. The stange thing is, in the <cyg/hal> directory I found a devices.h file that was created from the std_2C35.ptf file when I generated the eCos library. I also know that my dev kit is fully functional because I can use all devices when I run code under MicroC/OS-II. I am missing something, but do not know what it is. Thanks,- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
To use the LCD you need to have the "hardware serial device drivers" option enabled. This is located under the "Serial device drivers" folder in configtool.
This is a little unintuitive - but unfortuanely it's the eCos way of dealing with these devices...- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Hi,
Thanks for your prompt response. I enabled the Hardware Serial Devices in ConfigTool. I have also added the extra compiler CFLAGS options to my makefile: -I'$(SOPC_KIT_NIOS2)'/components/altera_avalon_lcd_16207/inc -I$(PREFIX)/include/cyg/hal I rebuilt the library and the LCD is now working for me. Thanks! P.S. I added -I'$(SOPC_KIT_NIOS2)'/components/altera_avalon_pio/inc -I$(PREFIX)/include/cyg/hal so I could use any of the PIO devices in my hardware. However, I get an undefined reference to IOWR_ALTERA_AVALON_PIO_DATA when I tried to use it like shown below: IOWR_ALTERA_AVALON_PIO_DATA(LED_PIO_BASE, 1); // turn on LED# 1 I am curious if the PIO devices have an enable/disable feature in the configtool too?- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
There's no eCos component for the PIO. You need to make direct register accesses (as you described).
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
monkeyboy,
Thanks for your assistance. I can now access all of my PIO interfaced devices. FYI for anyone coming from MicroC/OS: You need to include the following header file. # include <cyg/hal/io.h> /* Additional HAL device IO support.*/ You will also need to replace all ALTERA AVALON PIO reads and writes Such as: IOWR_ALTERA_AVALON_PIO_DATA and IORD_ALTERA_AVALON_PIO_DATA With: IOWR_16DIRECT(BASE, OFFSET, DATA) and IORD_16DIRECT(BASE, OFFSET) You will need to use the appropriate size function i.e. 8,16,32 bits too. http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/cool.gif- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
An easier way to do this is to just include altera_avalon_pio.h, and add the compiler flags:
-I'$(SOPC_KIT_NIOS2)'/components/altera_avalon_pio/inc -I$(PREFIX)/include/cyg/hal. That way you can continue to use the same macros you would have used in the Altera HAL or MicroC/OS-II. I thought that's what you had previously said you were doing. Also, I just noticed that you were adding: -I'$(SOPC_KIT_NIOS2)'/components/altera_avalon_lcd_16207/inc -I$(PREFIX)/include/cyg/hal to get the LCD working. This should not be necessary.- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Dear monkeyboy.
I'm tring to include "altera_avalon_pio.h", as you wrote. (1) Adding this line to my c-file.# include "altera_avalon_pio.h" (2) Modifying CFLAG in makefile. CFLAGS = -I$(INSTALL_DIR)/include -I'$(SOPC_KIT_NIOS2)'/components/altera_avalon_pio/inc -I$(PREFIX)/include/cyg/hal But when I built the project, this error message appeared.make INSTALL_DIR=/cygdrive/c/temp/ecos_install all
nios2-elf-gcc -c -o hello.o -I/cygdrive/c/temp/ecos_install/include -I'c:/altera/kits/nios2'/components/altera_avalon_pio/inc -I/include/cyg/hal -g -O3 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -DSYSTEM_BUS_WIDTH=32 -mhw-mul -mhw-mulx -mno-hw-div hello.c
cc1: warning: command line option "-fno-rtti" is valid for C++/ObjC++ but not for C
cc1: warning: command line option "-fvtable-gc" is valid for C++/ObjC++ but not for C
hello.c:3:31: altera_avalon_pio.h: No such file or directory
make: *** Error 1
What is wrong? Please tell me why. Thank you. Best regards.
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
My mistake. The file you wanted was altera_avalon_pio_regs.h, not altera_avalon_pio.h.
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Thank you, monkeyboy.
But I got this error message.c:/altera/kits/nios2/components/altera_avalon_pio/inc/altera_avalon_pio_regs.h:34:16: io.h: No such file or directory
How can I solve it? There are so many "io.h". Which "io.h" must I include? Thank you.
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Dear monkeyboy.
It' OK now. CFLAGS = -I$(INSTALL_DIR)/include -I'$(SOPC_KIT_NIOS2)'/components/altera_avalon_pio/inc -I$(PREFIX)/include/cyg/hal In my PC, $(PREFIX) was not defined. So, I changed "PREFIX" to "INSTALL_DIR", then, it works OK. Thank you.
Responder
Opções do tópico
- Subscrever fonte RSS
- Marcar tópico como novo
- Marcar tópico como lido
- Flutuar este Tópico para o utilizador atual
- Marcador
- Subscrever
- Página amigável para impressora