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++

using ecos on UP3 kit

Altera_Forum
Honored Contributor II
2,013 Views

hello all : 

I have got a UP3 kit from Altera , which is a NiosII kit , including EPC1C6Q240 (Cyclone family ) .Now I want to transplant the embeded system ecos to the NiosII cpu based on the UP3 kit , but I found the ecos's depository doesn't include the UP3 kits or the Flash and the Sram too, So Can I add the UP3 and its flash and sram to the depository ? and how can I do it ? 

Thanks in advance 

aihuazou@163.com
0 Kudos
9 Replies
Altera_Forum
Honored Contributor II
974 Views

Hi aihuazou, 

 

> Can I add the UP3 and its flash and sram to the depository ? 

 

You can always add a new target to ecos.db with the packages 

you require. 

 

Regards, 

--Scott
0 Kudos
Altera_Forum
Honored Contributor II
974 Views

hello smcnutt: 

I will try following you ,thanks in advance.
0 Kudos
Altera_Forum
Honored Contributor II
974 Views

hi all : 

I try following you ,I can add the UP3 to the ecos's depository and the UP3 and the Flash chip can found , the adding steps are below: 

1) open the ecos.db and copy the content of the "NiosII target " ,and modify the package as : 

 

package CYGPKG_HAL_UP3 { 

alias { "Nios II common HAL"} 

directory hal/UP3/arch/ 

script hal_UP3.cdl 

hardware 

description " 

The Nios II architecture HAL package provides generic support 

for this processor architecture. It is also necessary to 

select a specific target platform HAL package." 

 

 

target UP3_dev_board { 

alias { "UP3 Development Board (Altera)" } 

packages { CYGPKG_HAL_NIOS2 

CYGPKG_HAL_SOPC 

CYGPKG_ALTERA_AVALON_UART_COMM 

CYGPKG_ALTERA_AVALON_JTAG_UART_COMM 

CYGPKG_ALTERA_AVALON_UART 

CYGPKG_ALTERA_AVALON_JTAG_UART 

CYGPKG_ALTERA_AVALON_TIMER 

CYGPKG_DEVS_ETH_SMSC_LAN91CXX 

CYGPKG_ALTERA_AVALON_LAN91C111 

CYGPKG_ALTERA_AVALON_LCD_16207 

CYGPKG_ALTERA_AVALON_CF 

CYGPKG_ALTERA_AVALON_AM29LV065D_FLASH 

CYGPKG_DEVS_FLASH_AMD_AM29XXXXX 

description " 

This target provides the packages needed to run 

eCos on a Nios II. In addition, components are included 

which support the flash devices found on the Altera 

Nios II development boards." 

 

2) design a directory named "UP3" under the directoy "hal" ,and copy all of the content of the "nios2" 

to the directory "UP3" , but I only rename the "hal_nios2.cdl " to the "hal_UP3.cdl" , the other files don't change at all. 

 

So could I ask the ways are right or not? 

meanwhile , I think the UP3 is a new template based on Niosii , so the UP3 is a new platform which has similar CPU---niosII as and the different periphal from the "Niosii dev board " offered by the "ecos " system HW, as a result the UP3 is a variant of the "Niosii dev board " , so I can move the new folder "UP3" designing as front to the \...\packages \hal\nios2 \ , If this, it is right or not?  

 

 

then I have another question to consult you : what is the difference between the package "sopc" and "nios2" ?
0 Kudos
Altera_Forum
Honored Contributor II
974 Views

Hi aihuazou, 

 

All you should need is a target. Here's what I added for example: 

target PCI5441 {        alias  { "Psyent PCI-5441" }     packages        { CYGPKG_HAL_NIOS2                          CYGPKG_SOPC                          CYGPKG_ALTERA_AVALON_UART                          CYGPKG_ALTERA_AVALON_JTAG_UART                          CYGPKG_ALTERA_AVALON_TIMER                          CYGPKG_ALTERA_AVALON_AM29LV065D_FLASH                          CYGPKG_DEVS_FLASH_AMD_AM29XXXXX        }        description "            This target provides the packages needed to run            eCos on the Psyent PCI-5441 Media Processor board." } 

 

The "Nios II Generic" was a nice start -- although it really isn't very generic since 

it assumes too much hardware ;-) 

 

If you need to add new device drivers or other such components, then you can 

monkey with cdl. Otherwise, you might be making extra work for yourself. 

 

> what is the difference between the package "sopc" and "nios2" ? 

 

"sopc" is a "package" controlled by a cdl. "nios2" is a target. The target includes 

specific packages. 

 

 

Regards, 

--Scott
0 Kudos
Altera_Forum
Honored Contributor II
974 Views

You should be able to taget almost any Nios II system using the "Nios II Generic" target. It does include a number of potentially unused driver packages, however these packages will only build if a device of the appropriate class apears in your SOPC builder system. 

 

For example, even though the generic target includes the CYGPKG_ALTERA_AVALON_LCD_16207 package, this won't be built for your system if it does not contain the apropriate LCD hardware - so there's no harm in having it on the package list. 

 

There should be no problem using the generic target with the UP3 board (although I haven't personally tried that). The only reason you would need to create a new target is if you need to extend the generic package list, for example if you want to add your own flash drivers. 

 

If you have found problems using the generic target, please post them to this forum.
0 Kudos
Altera_Forum
Honored Contributor II
974 Views

Hi monkeyboy, 

 

> You should be able to taget almost any Nios II system using the "Nios II Generic" target. 

 

Agreed. 

 

> however these packages will only build if a device of the appropriate class apears in 

> your SOPC builder system. 

 

Agreed. 

 

>so there's no harm in having it on the package list. 

 

Agreed. 

 

> If you have found problems using the generic target, please post them to this forum.  

 

None found -- my apologies if I offended -- I appreciate your contributions to the 

ecos port and the Nios community. 

 

Regards, 

--Scott
0 Kudos
Altera_Forum
Honored Contributor II
974 Views

Hi monkey and smcnutt: 

Thanks ! 

From today ,I will transplant ecos to the UP3 kits. Yes ,I should add the new flash driver to the target. So I created a new target ----UP3, which include following packages :  

CYGPKG_HAL_NIOS2 

CYGPKG_SOPC 

CYGPKG_ALTERA_AVALON_UART 

CYGPKG_ALTERA_AVALON_JTAG_UART 

CYGPKG_ALTERA_AVALON_TIMER 

CYGPKG_ALTERA_AVALON_LH28F160S3T-L13A _FLASH 

 

then I edit the package CYGPKG_ALTERA_AVALON_LH28F160S3T-L13A _FLASH in accord with the package CYGPKG_ALTERA_AVALON_AM29LV065D_FLASH offered by ecos system. Now I have two questions: 

1) I found the "HAL" functions are different between in the ecos system and in the nios system. If I add the ecos system to my sopc system,which include a niosII cpu , a flash , a sram and a jagt--uart, and now I want to use the flash , which functions can be used , from ecos or from nios. ? 

2)In the sopc system ,I should set the flash's base address, and during the configuration of the ecos , I set the type of the "startup " is "Rom" , so I want to know the relation between the base address onthe sopc and the "startup" address on the nios, and how to set the base address of the flash on the nios is right?
0 Kudos
Altera_Forum
Honored Contributor II
974 Views

hello monkey : 

can you help me about the question above.
0 Kudos
Altera_Forum
Honored Contributor II
974 Views

1. There is a potential for confusion here, in that there are two bodies of code available for Nios II which are both called the HAL. One is the Altera HAL provided with the Nios II development kit, and the other is the eCos HAL provided with the eCos port. They both perform similar functions in that they provided simple C runtime environments upon which operating systems can be built. However the API's are different for these two bodies of code. 

 

In the case of eCos you should refer to the eCos documentation for the available API. From Redboot you can use the flash image system (FIS) API, or from an eCos application you could use either the romfs or jffs2 file systems. These file systems can be accessed using the standard file API's (e.g. mount(), read(), write() etc.). See the eCos reference manual for details. 

 

2. If you set the startup type to "ROM" then you should also ensure that in SOPC builder you set the reset vector to point to the flash device you want to boot from. You may also want to point the exception address to point to this device as well. The location of the remaining code sections is defined using the drop down menus in configtool (eCos HAL->Nios2 architecture->text region etc.).
0 Kudos
Reply