1

FreeRTOS を備えたザイリンクス 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

これを修正する方法が不明です。他の誰かがこれに遭遇しました。

どんな助けでも大歓迎です。前もって感謝します。

4

1 に答える 1