I have an stm32 (arm-cortexm3) firmware running in qemu and want to emulate a hw interrupt, say uart rx interrupt. How can I make qemu to make a jump to the isr implemented in my firmware?
I have placed the isr at correct place in the vector table. I have set the irq number in my emulated uart. But when I call qemu_set_irq() and then cpu_interrupt(&env, CPU_INTERRUPT_HARD), qemu interrupts but aborts with "hwerror, interrupt but no vector".
Something is missing. Does anyone know about this?
EDIT: Using qemu-stable-2.10
nvic = armv7m_init(system_memory, flash_size, NUM_IRQ_LINES, kernel_filename, cpu_model);
qemu_irq uart_irq = qdev_get_gpio_in(nvic, 1);
uart = sysbus_create_simple(TYPE_VCPU_UART, 0x40020000, uart_irq);
If I later do:
qemu_set_irq(uart_irq ,1);
I would expect a jump to the uart isr, but it does not occur.
Is this correct hook up of nvic/irq, or is something more missing?
EDIT2 I realized that I had not enabled the interrupts in the firmware code! Oops! After setting proper bits in NVIC Set Enable register it works!