embOS with NIOS II

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • embOS with NIOS II

    Hello all,

    Is anybody using embOS with the Altera NIOS II cpu? We're just about to start a development with this cpu and would be interested in any experiences or advice you may have regarding toolchains, the OS itself, and the ancilliaries like emFile, embOS/IP and emUSB.

    Thanks in advance.
  • Hello,

    we have some customers using embOS for NIOS II, I hope one of them will have a look here and answer your questions.

    Maybe you want also to download an embOS trial version for NIOS II, so you can evaluate on your own if you feel comfortable with embOS for NIOS II.

    If you have any further question please do not hesitate to contact our support directly.

    Best regards,
  • Hi.

    I'm trying to use embOS with Nios II,but it doesn´t run...

    I'm following the embOS installation guide steps from "embOS_NIOS2.pdf" file wich is delivered with the embOS files in the same .zip file.

    I can build the proyect and it seems that Run it on Nios II hardware correctly, but it do nothing.

    The kit wich I am using is Altera DE2.

    The software wich I am using are "Quartus II 9.1 sp2" and "Software Build Tools 9.1 sp2"

    The hardware configuration has been proved with other software proyects, and works correctly. It has the peripheral listed bellow:

    -Nios II fast:
    Reset Vector in flash memory
    Exception vector in SDRAM memory
    -Avalon tri strate bridge (connected to the flash memory)
    - CFI flash
    -SDRAM controller
    -timer (sys_clk_timer) (period: ms)
    -timer (high_res:timer) (period: us)
    -pll (in_clk is 50MHz, out_clk is 100MHZ)

    All peripheral (except pll wich is connected to 50MHZ ext_clk)are connected to 100MHz out_clk.

    About software proyect:

    The steps I have followed are at secction 2 in "embOS_NIOS2.pdf".

    -In 2.2.1:
    I created a new "hello world" project from a template(without uC/OSII)

    I copied file by file from "Hello_Project" and "Hello_BSP" to my "hello world" proyect directories, keeping all files in their respective sub directories, and overwrited the original "hello world" files.

    I deleted the "hello_world.c" file in my "hello world" project folder.

    -IN 2.2.2:
    I modified the "Makefile" of my hello world proyect:

    ALT_LIBRARY_DIRS := ../my_hello_world_bsp/drivers/segger_embOS/embosLibs



    I modified "main.c" as it is shown bellow:

    #include //Included by MANOEL BARROS MARIN
    #include "RTOS.h"

    OS_STACKPTR int Stack0[512], Stack1[512]; /* Task stacks */
    OS_TASK TCB0, TCB1; /* Task-control-blocks */

    static void Task0(void) {
    while (1) {
    printf("Hello from Task I (embOS)!\n"); //Included by MANOEL BARROS MARIN
    OS_Delay (1000); //Modified by MANOEL BARROS MARIN

    static void Task1(void) {

    while (1) {
    printf("Hello from Task II (embOS)!\n"); //Included by MANOEL BARROS MARIN
    OS_Delay (1000); //Modified by MANOEL BARROS MARIN


    int main(void) {

    OS_InitHW(); /* initialize Hardware for OS */

    /* You need to create at least one task before calling OS_Start() */

    OS_CREATETASK(&TCB0, "HP Task", Task0, 100, Stack0);
    OS_CREATETASK(&TCB1, "LP Task", Task1, 50, Stack1);
    OS_Start(); /* Start multitasking */

    return 0;

    I refreshed the project

    I built the project.

    I ran the proyect, but it doesn´t work.

    I need your help.

    Could you explain how I should do?

    If you could send a software project wich uses embOS on Nios II to me, It would be great.

    My email is takumi_kite@hotmail.com

    Thank You.

    The post was edited 1 time, last by TaKuMiKiTe ().

  • Hello,
    we analyzed the problem and found, that the description and the OS_Config.h file delivered with the embOS trial version and shipment do not work when used with the latest NIOS software build tools when used as described in the embOS manual.
    The DEBUG definition in the makefile of the application does not affect the compilation of the BSP.
    In combination with the OS_Config.h file delivered with embOS, this results in inconsistent embOS library modes for the BSP and application. This error produces wrong interrupt entry functions which causes the application to crash.
    When you set a breakpoint at OS_Error() you should arrive there.
    To get the project running, replace the OS_Config.h file delivered with embOS by the version listed here:
    /* -------------------------------------------------------------------
    File : OS_Config.h
    Purpose : Configuration settings for the OS build and OS_VIEW
    -------- END-OF-HEADER ---------------------------------------------

    #ifndef OS_CONFIG_H /* Avoid multiple inclusion */
    #define OS_CONFIG_H

    * Default configuration

    #ifndef DEBUG // May be overwritten by project settings
    #define DEBUG (0) // in debug builds

    * Configuration for RTOS build and UART
    * One of the following builds needs to be selected for both DEBUG and Release builds:
    * OS_LIBMODE_XR Extremely small release build without Round robin
    * OS_LIBMODE_R Release build
    * OS_LIBMODE_S Release build with stack check
    * OS_LIBMODE_SP Release build with stack check and profiling
    * OS_LIBMODE_D Debug build
    * OS_LIBMODE_DP Debug build with profiling
    * OS_LIBMODE_DT Debug build with trace

    #define OS_LIBMODE_DP

    #if (DEBUG == 0)
    #define OS_VIEW_ENABLE 0


    #endif /* Avoid multiple inclusion */

    /*************************** End of file ****************************/

    This version sets the OS_LIBMODE regardless the setting of DEBUG.
    We will update our trial version and documentation.