Altera_Forum
Honored Contributor
20 years agoHow to build up such kind of JTAG_UART application
I am now using EP2C35 on my board. I have some AD and PLL chips as its peripheral. In order to have a flexible configuration of these chips, I would like to have a NIOS in the FPGA. I wish I can use the NIOS II IDE console to input some command. Then the NIOS can send the control bytes to a RAM in FPGA. Then NIOS will tell configuring Verilog modules for peripheral chips to fetch these control bytes from RAM and send out to the chips. Also I would like to have the NIOS II system as small as possible. During the implementation of the system described above, I've run into some problems:
1. How to use small C library? ==================== As a hardware engineer, I am a new comer to the NIOS world. All I can do is to build up a C/C++ application from a template. Say, hello_world_small. I don't wanna use any external SRAM. I've specify the jtag_uart_0 as my stdin and stdout. But if I use the small C library, I will have the error message as follows: make -s all Compiling hello_world_small.c... Linking hello_world_small_0.elf... obj/hello_world_small.o(.text+0x34): In function `main': ../hello_world_small.c:78: undefined reference to `scanf' collect2: ld returned 1 exit status make: *** [hello_world_small_0.elf] Error 1 Build completed I don't know why I cannot use 'scanf'. If I choose not to use small C library, the total elf seems to be huge! around 52K ~ 56K. Surely I don't want this small module take up all the memory in EP2C35. 2. A RAM in the FPGA ============== I am still not so familiar with Avalon tri-state bridge. Do I have to have one in my system if I want my NIOS to communicate with another RAM (not on-chip memory within NIOS) in the FPGA? Since this RAM is only for control byte storage. It's not necessary to be very large. I still don't know who to implement such kind of structure. I would really appreciate if someone can give me some brief idea.