Quality RTOS & Embedded Software

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




Loading

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. */
FreeRTOS_ClearTickInterrupt();
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.
portDISABLE_INTERRUPTS();

// 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);

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.

vPortInstallFreeRTOSVectorTable();

} ~~~~


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




Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

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

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

OpenRTOS and SafeRTOS