使用freeRTOS的Microblaze中断示例给出_interrupt_handler的多个定义

时间:2016-10-07 06:16:52

标签: c microblaze

我已经使用具有FreeRTOS的Xilinx SDK创建了一个简单的示例程序,我遇到了一个看似非常意外的问题。我想解雇一个软件中断,所以我用这种方式设置了代码。

void software_test( void ) __attribute__((interrupt_handler));

void software_test( void )
{
   // clear the interrupt
   *((volatile uint32_t *) 0x4120000C) = 0x80;
   interrupt_occurred++;
}

当我尝试编译它时抱怨:

\interrupt_example_bsp\microblaze_0\libsrc\freertos823_xilinx_v1_1\src/portasm.S:288: multiple definition of `_interrupt_handler'
./src/freertos_hello_world.o:\Debug/../src/freertos_hello_world.c:130: first defined here

我检查了portasm.S并且其中包含以下代码:

.global _interrupt_handler

... bunch more unreleated code here

.text
.align  4
_interrupt_handler:

portSAVE_CONTEXT

/* Stack the return address. */
swi r14, r1, portR14_OFFSET

/* Switch to the ISR stack. */
lwi r1, r0, pulISRStack

/* The parameter to the interrupt handler. */
ori r5, r0, configINTERRUPT_CONTROLLER_TO_USE

/* Execute any pending interrupts. */
bralid r15, XIntc_DeviceInterruptHandler
or r0, r0, r0

/* See if a new task should be selected to execute. */
lwi r18, r0, ulTaskSwitchRequested
or r18, r18, r0

/* If ulTaskSwitchRequested is already zero, then jump straight to
restoring the task that is already in the Running state. */
beqi r18, task_switch_not_requested

/* Set ulTaskSwitchRequested back to zero as a task switch is about to be
performed. */
swi r0, r0, ulTaskSwitchRequested

/* ulTaskSwitchRequested was not 0 when tested.  Select the next task to
execute. */
bralid r15, vTaskSwitchContext
or r0, r0, r0

... bunch more code here

我不清楚如何解决这个问题,还有其他人遇到过这个。

非常感谢任何帮助。提前谢谢。

1 个答案:

答案 0 :(得分:0)

以下是使用FreeRTOS实施Microblaze ISR的一些信息:http://www.freertos.org/RTOS-Xilinx-Microblaze-KC705.html#implementing_an_ISR