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




Loading

FreeRTOS on a ZYNQ board

Posted by monica on May 1, 2013
Hi

I am working with an AMP configuration on a Zynq ZC702 board, based on the FreeRTOS-Linux AMP demo provided by Xilinx (http://www.xilinx.com/support/documentation/sw_manuals/petalinux2012_12/ug978-petalinux-zynq-amp.pdf).

I customized the demo, in order to work with the FPGA fabric. I already use a couple of switches and leds, and the idea now is to configure the axi_timer IP on XPS, which already works, but i haven\'t been successful on the configuration on SDK for my FreeRTOS application (Because the interrupt is never acknowledged)

The timer is configured in FreeRTOS, and if I check the registers associated to the timer, I see that the interrupt is generated (a bit sets to 1), but somehow FreeRTOS doesnt recognize the interrupt...

I will post the code parts related to this topic.. maybe any of you find what am I missing. Thank you in advance.


/* -------------------------------------------------------------------------- */

AXI Timer Configuration:

void prvSetAXITimer( void )
{
/* Initialize the AXI GPIO driver.*/
/*AXI GPIO configuration*/
xStatus = XTmrCtr_Initialize(&TimerInstancePtr,XPAR_AXI_TIMER_0_DEVICE_ID);
if(XST_SUCCESS != xStatus)
xputs(\"TIMER INIT FAILED \\n\\r\");

XTmrCtr_SetHandler(&TimerInstancePtr,axi_timer_handler,&TimerInstancePtr);
XTmrCtr_SetResetValue(&TimerInstancePtr,0,0x10000000);
XTmrCtr_SetOptions(&TimerInstancePtr,XPAR_AXI_TIMER_0_DEVICE_ID,
(XTC_INT_MODE_OPTION|XTC_DOWN_COUNT_OPTION));
}
/* -------------------------------------------------------------------------- */

Interrupt Handler

void axi_timer_handler(void *data)
{
XTmrCtr_Stop(data,0);
XTmrCtr_Reset(data,0);
InterruptFlag = 1;
}

/* -------------------------------------------------------------------------- */

Setup IRQs by using the following function:

setupIRQhandler(91, &axi_timer_handler, NULL);

/* -------------------------------------------------------------------------- */

The function setupIRQhandler in the port.c file is:

#define XScuGic_ClearPending(DistBaseAddress, Int_Id) \\
XScuGic_WriteReg((DistBaseAddress), \\
XSCUGIC_PENDING_CLR_OFFSET + ((Int_Id / 32) * 4), \\
(1 << (Int_Id % 32)))


void setupIRQhandler(int int_no, void *fce, void *param)
{
int Status;

clearIRQhandler(int_no);

Status = XScuGic_Connect(&InterruptController, int_no,
(Xil_ExceptionHandler)fce, param);
if (Status != XST_SUCCESS) {
return;
}
XScuGic_ClearPending(&InterruptController, int_no);
XScuGic_Enable(&InterruptController, int_no);
}




RE: FreeRTOS on a ZYNQ board

Posted by Richard on May 1, 2013
Although this may change shortly, currently the Zynq port is provided by a third party and I don't have access to Zynq hardware so I'm afraid I cannot provide any suggestions.

Regards.


[ 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