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


FreeRTOS "Hello, World." Not working with Xilinx SDK Repository

Posted by razed11 on September 29, 2015

Please disregard this thread. The issue is related to building with -DUSE_AMP=1. I will start another thread. This can be deleted.

I noticed that asking a task to delay is not working in my application with the Xilinx SDK Repository that I recently installed. So I created the FreeRTOS "Hello" program and it's not working there either. If I comment out the delay the task queues work just fine so I think the interrupt table is not being installed and the system tick is not happening.

In the example application I didn't see a call to setup hardware and install the vector table as with the standalone example (that does not make use of the repository)--it just creates the tasks and starts the scheduler.

What else must be called?

FreeRTOS "Hello, World." Not working with Xilinx SDK Repository

Posted by razed11 on September 30, 2015

In portZynq7000.c the routine below statically defines an XScuGic. Per the comment this routine expects XScuGic_CfgInitialize() to be called by the application but that routine requires an address to the XScuGic data structure. Is this an issue? Now there will be two instances of that data structure hanging around.

~~~~ void FreeRTOSSetupTickInterrupt( void ) { static XScuGic xInterruptController; /* Interrupt controller instance */ BaseTypet xStatus; extern void FreeRTOSTickHandler( void ); XScuTimerConfig *pxTimerConfig; XScuGicConfig *pxGICConfig; const uint8_t ucRisingEdge = 3;

/* This function is called with the IRQ interrupt disabled, and the IRQ
interrupt should be left disabled.  It is enabled automatically when the
scheduler is started. */

/* Ensure XScuGic_CfgInitialize() has been called.  In this demo it has
already been called from prvSetupHardware() in main(). */
pxGICConfig = XScuGic_LookupConfig( XPAR_SCUGIC_SINGLE_DEVICE_ID );
xStatus = XScuGic_CfgInitialize( &xInterruptController, pxGICConfig, pxGICConfig->CpuBaseAddress );
configASSERT( xStatus == XST_SUCCESS );
( void ) xStatus; /* Remove compiler warning if configASSERT() is not defined. */

/* The priority must be the lowest possible. */
XScuGic_SetPriorityTriggerType( &xInterruptController, XPAR_SCUTIMER_INTR, portLOWEST_USABLE_INTERRUPT_PRIORITY << portPRIORITY_SHIFT, ucRisingEdge );

/* Install the FreeRTOS tick handler. */
xStatus = XScuGic_Connect( &xInterruptController, XPAR_SCUTIMER_INTR, (Xil_ExceptionHandler) FreeRTOS_Tick_Handler, ( void * ) &xTimer );
configASSERT( xStatus == XST_SUCCESS );
( void ) xStatus; /* Remove compiler warning if configASSERT() is not defined. */

/* Initialise the timer. */
pxTimerConfig = XScuTimer_LookupConfig( XPAR_SCUTIMER_DEVICE_ID );
xStatus = XScuTimer_CfgInitialize( &xTimer, pxTimerConfig, pxTimerConfig->BaseAddr );
configASSERT( xStatus == XST_SUCCESS );
( void ) xStatus; /* Remove compiler warning if configASSERT() is not defined. */

/* Enable Auto reload mode. */
XScuTimer_EnableAutoReload( &xTimer );

/* Ensure there is no prescale. */
XScuTimer_SetPrescaler( &xTimer, 0 );

/* Load the timer counter register. */
XScuTimer_LoadTimer( &xTimer, XSCUTIMER_CLOCK_HZ / configTICK_RATE_HZ );

/* Start the timer counter and then wait for it to timeout a number of
times. */
XScuTimer_Start( &xTimer );

/* Enable the interrupt for the xTimer in the interrupt controller. */
XScuGic_Enable( &xInterruptController, XPAR_SCUTIMER_INTR );

/* Enable the interrupt in the xTimer itself. */
XScuTimer_EnableInterrupt( &xTimer );

} ~~~~

FreeRTOS "Hello, World." Not working with Xilinx SDK Repository

Posted by razed11 on September 30, 2015

The tick handler is still not being called. I added the routine below to initialize the GIC configuration and as I mentioned above I have referencing a different copy of the XScuGic structure.

The scheduler appears to call FreeRTOS_SetupTickInterrupt() so that is taken care of.

~~~~ void zynqinitialize(void) { BaseTypet status;

XScuGic_Config *configuration;

// Ensure no interrupts execute while the scheduler is in an inconsistent state. Interrupts are
// automatically enabled when the scheduler is started.

// Obtain the configuration of the GIC.
configuration = XScuGic_LookupConfig(XPAR_SCUGIC_SINGLE_DEVICE_ID);

// Sanity check the FreeRTOSConfig.h settings are correct for the hardware.

configASSERT(configuration->CpuBaseAddress == CPU_BASE_ADDRESS);

configASSERT(configuration->DistBaseAddress == GIC_BASE_ADDRESS);

// Install a default handler for each GIC interrupt.
status = XScuGic_CfgInitialize(&_gic, configuration, configuration->CpuBaseAddress);

configASSERT(status == XST_SUCCESS);

(void) status;

// Switch to use the FreeRTOS vector table defined in port_asm_vectors.S in the RTOS library
// source.


} ~~~~

[ 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