Microchip
直播中

刘娟

8年用户 671经验值
私信 关注
[问答]

迁移到dsPIC33但缺少PIC24FJ备用中断向量表

主题总结了我的苦恼,但我会试着扩大一下。并解释为什么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 Alternative 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.

回帖(5)

李戈

2019-7-2 11:27:09
思考我自己的问题。我真的应该检查USB使用中断这个问题都可能是无用的。

以上来自于百度翻译


      以下为原文

    Pondering on my own problem. I should really check does USB use interrupts this question could all be for nothing.
举报

李天竹

2019-7-2 11:45:28
艾维特在记忆的第一页。你需要擦除IVT并重置向量来重写它。当这个区域被擦除时,如果有什么不好的事情发生(例如,电源丢失),你的芯片被阻塞了。我认为MU已经复位,并且在他们的辅助闪存中具有基本的IVT。

以上来自于百度翻译


      以下为原文

    AIVT is in the first page of the memory. You need to erase IVT and reset vector to re-write it. While this area is erased, if something bad happens (e.g. power lost), your chip is bricked.
 
I think MU have reset and rudimentary IVT in their Aux flash memory.
 
举报

李戈

2019-7-2 12:01:28
没多久。是的,USB使用中断。所以现在我有一个问题,因为我正在使用微芯片的USB堆栈,所以没有访问他们的USB中断源来稍微改变它

以上来自于百度翻译


      以下为原文

    That didn't take long. Yes USB Uses Interrupts. So now I have a problem as I am using Microchip's USB stack so don't have access to their USB Interrupt source to change it slightly
 
举报

李戈

2019-7-2 12:06:53
是的,但不是!是的,PIC24的AIVT在Flash的第一页,但是诀窍在于,你不把向量存储在那里,你只是把向量存储到向量中。所以让我们说,引导加载坐在较低的地址,固件从0x88开始。保持相同的中断向量表结构,可以说固件的向量从地址0x8804开始,运行到0x88 FE。鉴于Flash第一页中的AIVT包含的是跳转地址0x8804、0x8806、0x8808……因此,每一次中断都要花费额外的一跳,但您已经获得了一个可爱的小引导程序。

以上来自于百度翻译


      以下为原文

    Yes but No!
 
Yes the AIVT of the PIC24 is in the first page of Flash but the trick is that you don't store the Vectors there you just store the vectors to the vectors. So lets say that the Bootload sits down in the lower address and that firmware starts at 0x8800. Keeping the same Interrupt Vector table structure you can say that the Firmware's Vectors start at address 0x8804 and run up to 0x88FE. Given that all that the AIVT in the first page of Flash contains is the jump address
0x8804, 0x8806, 0x8808 ......
So you've cost yourself an extra jump with each Interrupt but you've gained a sweet little bootloader.
 
举报

更多回帖

发帖
×
20
完善资料,
赚取积分