主题总结了我的苦恼,但我会试着扩大一下。并解释为什么PIC24的替代中断向量表如此有用。基本上在PIC24FJ上,我有一个Bootloader,它使用USB来装载新的固件。我的设备只是接通
电源,然后检查是一个USB设备,连接着新代码,如果是这样,就把新固件编程到闪存中。引导加载程序使用中断向量表(IVT),但是作为新固件编程的一部分,它将把固件的中断向量写到备选中断向量表(AIVT)。G使用AIVT并跳转到固件。如果在上电时没有USB连接,因此没有新的固件,那么只需设置AIVT并跳转到已经安装的固件。这意味着Bootloader可以使用中断,固件也可以使用中断,但是它们映射到不同的向量。我对此有不好的感觉。必须睡在这上面。似乎只给定一个中断向量表,引导加载程序就不能使用中断,但我假设USB依赖于它们。
以上来自于百度翻译
以下为原文
Subject sort of sums up my woes, but I'll try and expand on them a little. And explain why the PIC24's Alterna
tive Interrupt Vector Table was so so useful. Basically on the PIC24FJ I have a Bootloader which uses USB to load up new Firmware. My device simply powered up and checked was a USB device connected with new code and if so read the new firmware programming it into the flash. The Bootloader used the Interrupt Vector Table (IVT) but as part of its programming of new firmware it would write the firmware's Interrupt vectors to the Alternative Interrupt Vector Table (AIVT).
Once the Bootloader had finished programming the new firmware it would set the micro-controllers config to use the AIVT and jump to the firmware. If on powerup there was no USB connected, hence no new firmware it would simple set the AIVT and jump to the already installed Firmware. This all means that the Bootloader could use Interrupts and the Firmware could also use Interrupts but they mapped to different vectors.
Like the subject says I'm migrating to a dsPIC33EP256MU806 which shock horror has no AIVT. I have a bad feeling about this. Have to sleep on this one. Seems like given only one Interrupt Vector Table the bootloader can't use Interrupts, but USB I'm assuming depends on them.