Forum Discussion
Altera_Forum
Honored Contributor
21 years agoThe problem concerning uClinux uploading to UP3
Hello everyone!I need your help now...
The problem is concerning uClinux uploading to UP3 board. Here is my developing enviornment: target board: UP3 Education Kit Cyclone EP1C6Q240 TC58FVT160 Flash Memory 2MB(1M*16b) 1S42S16400B SDRAM 8MB 128KB(64K*16b) SRAM Software: Quartus 4.2 + NIOS IDE1.0 Nios2linux1_3 Since there is no ptf file from linux_example support for UP3,i have no idea. I try to use NiosII_lab_up3 ptf. According to the Linux Quick Start Guide,creat Linux Kernel Project,Configure Kernel,then Build Project,waiting... the final error are as follows: --- 2.6.x/drivers/char/altera_pio_button.c:112: error: `na_button_pio_irq' undeclared (first use in this function) /cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/char/altera_pio_button.c:112: error: (Each undeclared identifier is reported only once /cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/char/altera_pio_button.c:112: error: for each function it appears in.) /cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drivers/char/altera_pio_button.c: In function `button_release': /cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x/drmake: Leaving directory `/cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/linux-2.6.x' ivers/char/altera_pio_button.c:156: error: `na_button_pio_irq' undeclared (first use in this function) make[3]: *** [drivers/char/altera_pio_button.o] Error 1 make[2]: *** [drivers/char] Error 2 make[1]: *** [drivers] Error 2 make: *** [_all] Error 2 ----- And what's the matter,need to modify the UP3 ptf file? and how to?I'm a newer in this developing what i should complete,is Web Server using in Industry data gathering,based on Nios-uClinux board system.(UP3) Thank you for everyone here, it's my first title here,and english is not good. Maybe should description more details.http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif11 Replies
- Altera_Forum
Honored Contributor
Hi Justin,
> The first problem is that i can't find the up3-flash datasheet(TC58FVT160), http://www.toshiba.com/taec/components/dat...60aft_axb_e.pdf (http://www.toshiba.com/taec/components/datasheet/tc58fvtb160aft_axb_e.pdf) You might want to search the u-boot sources at sourceforge to find a board that supports this flash device and just copy it into your board-specific tree. > So the second problem is where can I find some details using for this u-boot work,such as, > CFG_Nios_CONSOLE,CF G_GBL_DATA_OFFSET,CFG_Nios_TMRBASE,CFG_Nios_TMRIRQ and so on, > because the UP3 munual reference doesn't have this data. Yes, u-boot configuration isn't the easiest task. A nice document for Nios-II would be great ... maybe I'll take a stab at it once I have some spare time ;-) That being said, let me try to help with the following minimum configuration: 1. top-level configuration All of the following are configured via SOPC builder and are in your ptf file with the tag shown in (braces): CONFIG_SYS_CLK_FREQ -the Nios-II clock frequency in hertz (clock_freq) CFG_RESET_ADDR -the Nios-II reset address (reset_offset + the device base) CFG_EXCEPTION_ADDR - The Nios-II Exception address (exc_offset) CFG_ICACHE_SIZE - Size of the icache in bytes or zero (nasys_icache_size) CFG_ICACHELINE_SIZE - Size of icache line in bytes (nasys_icache_line_size) CFG_DCACHE_SIZE - Size of the dcache in bytes or zero (nasys_dcache_size) CFG_DCACHELINE_SIZE - Size of the dcache line in bytes (nasys_dcache_line_size) 2. memory base addresses Define all of these ... set size to zero if not applicable. These should be available in your SOPC builder memory map. CFG_FLASH_BASE - base address of flash CFG_FLASH_SIZE - size in bytes of flash CFG_SDRAM_BASE - base address of SDRAM CFG_SDRAM_SIZE - size in bytes of SDRAM CFG_SRAM_BASE - base address of SRAM CFG_SRAM_SIZE - size in bytes of SRAM 3. memory organization CFG_MONITOR_LEN - the size in bytes reserved for u-boot CFG_GBL_DATA_SIZE - the size in bytes reserved for u-boot's global data (128 will do) CFG_MALLOC_LEN - the size in bytes of the u-boot heap These can be quite confusing, but they let you fine-tune your configuration. Normally, they're all defined relative to the u-boot text base. See the PK1C20.h file for example. CFG_MONITOR_BASE - u-boot text base address (same as the .cfg file) CFG_MALLOC_BASE - base address of heap CFG_GBL_DATA_OFFSET - base address of u-boot's global data CFG_INIT_SP - initial stack pointer 4. required component configuration u-boot needs a uart and a timer. Here's the configuration macros you should use: CFG_NIOS_TMRBASE - base address of the timer used by u-boot CFG_NIOS_TMRIRQ - the interrupt request number used by the timer CFG_NIOS_TMRMS - the timer interval in milliseconds If the timer provides period registers AND the default count is not acceptable to you, you can configure CFG_NIOS_TMRCNT. CFG_NIOS_TMRCNT - value used to load the period registers of the u-boot timer. CFG_HZ - number of hertz per timer tick. This is used by networking code and is dependent on the timer macros above. CFG_NIOS_CONSOLE - Base address of the uart or jtag uart component. CONFIG_CONSOLE_JTAG - Define this when using the jtag uart CFG_NIOS_FIXEDBAUD - Define this when uart is fixed baudrate or with jtag uart CONFIG_BAUDRATE - the initial baudrate (or the fixed baudrate) in bps CFG_BAUDRATE_TABLE - a table of allowed baudrates. This has one entry for fixed rate uart/jtag E.g.: # define CFG_BAUDRATE_TABLE {115200} /* It's fixed */ or# define CFG_BAUDRATE_TABLE {9600, 19200, 115200} /* Allows selection of rate via cli */ I hope this is useful ... configuring u-boot via a gui would be great ... but, good or bad, if you want a very high level of control, editing a configuration file will force you to really know your code. If you have any questions or need additional information, just post or shoot me some email. Best Regards, --Scott