Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training


NIOS II FreeRTOS not run

Posted by lomielectronics on June 12, 2017

Hi everyone, I'm trying to run FreeRTOS on a Nios 2 processor without success. I'm using Quartus Prime v16.1, and my hardware layer is composed by: 1 Nios 2 gen 2 CPU; 1 JTAG 1 UART 1 timer interval (named sys_clk) 1 onchip memory module 1 parallel led interface I generate the .sopcinfo thorugh QSYS and Quartus, then I create e new bsp from eclipse by using the altera HAL type. After that, I change ENHANCED interrupt with LEGACY one. Finally a new blank project was created on the previous generated bsp. Now the FreeRTOS release is copied inside the Eclipse project, all files are linked and compiled. I try to run a simple task by driving two leds, but the FreeRTOS is not running. All leds are fixed and the system seems freezed. Have you tryied to run FreeRTOS on Nios processor? Thank you.


include "uart.h"
include "alteraavalonpio_regs.h"

/* FreeRTOS */

include "FreeRTOS.h"
include "task.h"
include "queue.h"

bool UARTrxFLAG; char UARTrx; unsigned int delay; static unsigned int LEDctrl;

/* definizione funzioni */ static void prvSetupHardware( void ); static void prvLEDtask( void *pvParameters );

static void prvSetupHardware( void ) { LEDctrl = 0x01; }


xTaskCreate(prvLEDtask, "LEDtask", 100, (void*) NULL, tskIDLE_PRIORITY + 1, NULL);

/* start scheduler */
/* infinite loop */
for( ;; );


static void prvLEDtask( void *pvParameters ) { for( ;; ) { LEDctrl ^= 0x03; IOWRALTERAAVALONPIODATA(PIOLEDBASE, LEDctrl); vTaskDelay(500 / portTICKPERIODMS); } }

/-----------------------------------------------------------/ void vApplicationStackOverflowHook( void ) { /* Look at pxCurrentTCB to see which task overflowed its stack. */ for( ;; ) { asm( "break" ); } }

/-----------------------------------------------------------/ void generalexception_handler( unsigned long ulCause, unsigned long ulStatus ) { /* This overrides the definition provided by the kernel. Other exceptions should be handled here. / for( ;; ) { asm( "break" ); } } /-----------------------------------------------------------*/ [/code]

NIOS II FreeRTOS not run

Posted by rtel on June 15, 2017

Sorry for the delay in replying -

Does the scheduler start? If you step through vPortStartScheduler() in the NIOS port layer, where do you end up.

Alternatively set the interrupt priorities such that you know which task will start first - which will be the highest priority task in the system (be careful configTIMERTASKPRIORITY is not set so the timer task has the highest priority). Then set a breakpoint on entry to the task that has the highest pririty. Does it ever get hit?

[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]

Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.

Free TCP/IP and file system demos for the RTOS

Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists