Transplantation of UCOS on NIOS II

Source: Internet
Author: User

Tool: Quartus II

Device: EP4CE15F17C8

1.file->new Project Wizard:


2. Click on two next to enter Family&device Settings, select device


3.Finish, set up the project finished, click Tools->sopc Builder, enter the name, OK


4. Modify Clk_0 to 100MHz


5.component Library Search Nios, double-click Nios II processer


6.Finish


7. Search EPCs, double-click EPCs Serial ... Finish


8. Search SDRAM, double-click SDRAM controller, configured as follows, SDRAM chip for H57V2562GTR


9. Search Sysid, double-click System id,finish


10. Search for JTAG, double-click Jtag uart,finish. Search for a timer, double-click Interval timer,finish.


11. Modify EPCs and SDRAM base addresses: 0x0000000,0x04000000


12. Double-click Cpu_0 to configure the reset vector and exception vector.


13. Modify the base address of each module,



14. Click Generate


15.Generate success.


16.file-new


17.save as NIOS.BDF, double-click in the blank, add Mynios kernel,ok


18. Double-click the blank: Megawizard plug-in Manager


19. Set the clock:





20.Finish, at this time NIOS.BDF


21. Right-click Module, select Generate Pins ... The PIN name is renamed separately.



22.assignments->import Assignments, import Mynios.csv, which is the PIN configuration information that was previously prepared:

: http://download.csdn.net/detail/wu20093346/8205265

Compile-time discovery problem, NIOS II module and engineering name caused the conflict, open Tools->sopc Builder, open the previous SOPC file, Save as Kernel.sopc,generate. Replace Mynios with Kernel (NIOS.BDF renamed to MYNIOS.BDF, consistent with project name)


23.assignments->device, select Device and Pins options,dual-purpose are all set to regular IO:


24. Compile the entire project and generate the Mynios.sof file. Tools->nios II software Build Tools for Eclipse,new->nios II application and BSP from Template. Select Sopc information file, and give the project a name, template select Hello UCOS II to start the UCOS project establishment:


25.finish. Compile the entire project, Run as-> NIOS II Hardware. Among them HELLO_UCOSII.C:

/************************************************************************** Copyright (c) 2004 Altera Corporation,      San Jose, California, USA. * * All rights reserved. All use of this software and documentation are * * Subject to the License agreement located at the end of this file Belo                                                           w.**************************************************************************** Description: * * The following is a simple Hello World program running MICROC/OS-II. The * * Purpose of the design is to being a very simple application it just * * demonstrates microc/os-ii running on NIO S Ii.. The design doesn ' t account** for issues such as checking system call return codes.             etc.                                                          * * * * Requirements:                       * *-supported Example Hardware Platforms * * Standard                                    * * Full Featured * * Low C                                        OST * *-supported Development Boards * * Nios II Development Board, Stratix II Edition * Nios development Board, STR aTiX Professional Edition * * Nios development Board, Stratix Edition * * N                                             iOS development Board, Cyclone Edition * *-system Library Settings                                              * * RTOS type-microc/os-ii * * Periodic System Timer     * *-know Issues * *                                             If This design was run on the ISS, terminal output would take several** minutes per iteration. **/#include <stdio.h> #include "    Includes.h "/* Definition of Task Stacks */#define TASK_STACKSIZE 2048OS_STK TASK1_STK[TASK_STACKSIZE];OS_STK  task2_stk[task_stacksize];/* Definition of TASK priorities */#define Task1_priority 1#define task2_priority 2/* Prints "Hello World" and sleeps for three seconds */void Task1 (void* pdata) {while (1) {printf ("Hello from task1\n    ");  OSTIMEDLYHMSM (0, 0, 3, 0); }}/* Prints "Hello World" and sleeps for three seconds */void Task2 (void* pdata) {while (1) {printf ("Hello from Tas    K2\n ");  OSTIMEDLYHMSM (0, 0, 3, 0);                  }}/* The main function creates both task and starts multi-tasking */int main (void) {Ostaskcreateext (Task1, NULL, (void *) &task1_stk[task_stacksize-1], task1_priority, TAS             K1_priority, TASK1_STK, Task_stacksize,     NULL, 0);                  Ostaskcreateext (Task2, NULL, (void *) &task2_stk[task_stacksize-1],                  Task2_priority, Task2_priority, TASK2_STK, Task_stacksize,  NULL, 0);  Osstart (); return 0;}                                                                             /*******************************************************************************                                                                             * * License Agreement * *  * * Copyright (c) 2004 Altera Corporation, San Jose,           California, USA.                                                        * * All rights reserved. * * * Permission is hereby granted, free of CH Arge, to any person obtaining a * * copyof this software and associated documentation files (the "software"), * * to deal in the software without restriction, Inc. luding without limitation * * The rights to use, copy, modify, merge, publish, distribute, sublicense, * * and/or Sell Copies of the software, and to permit persons to whom the * * software are furnished to does so, subject to the Followin  G Conditions: * * * * * the above Copyright                         Notice and this permission notice shall is included in * * all copies or substantial portions of the software. * * * * The SOFTWARE is provided ' As is ', without WARRANTY of any KIND, EXPRESS OR * * implied, including but not LIMITED to the warranties of Merchantabil ity, * * FITNESS for A particular PURPOSE and noninfringement. In NO EVENT shall the * * AUTHORS OR COPYRIGHT holders be liable for any CLAIM, DAMAGES or other * * liability, WHETHER in an ACTION of contract, TORT OR OTHERWISE, arising * * from, out of or in CO                                                   Nnection with the software or the use or other * * dealings in the software. * * * * This Agreement shall is Gov              Erned in all respects by the laws of the state * * of California and by the laws of the States. * * Altera does not recommend, suggest or require the This reference design * * file is used in conjunction or CO          Mbination with any other product. *******************************************************************************/
26. Print out the multi-task parallel statement in the Nios II console.


27. Above is Ucos on the Nios processor transplant, side operation side record, if have improper also please advise.

Transplantation of UCOS on NIOS II

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.