|
|||||||||||
| 技術(shù)交流 | 電路欣賞 | 工控天地 | 數(shù)字廣電 | 通信技術(shù) | 電源技術(shù) | 測控之家 | EMC技術(shù) | ARM技術(shù) | EDA技術(shù) | PCB技術(shù) | 嵌入式系統(tǒng) 驅(qū)動(dòng)編程 | 集成電路 | 器件替換 | 模擬技術(shù) | 新手園地 | 單 片 機(jī) | DSP技術(shù) | MCU技術(shù) | IC 設(shè)計(jì) | IC 產(chǎn)業(yè) | CAN-bus/DeviceNe |
有關(guān)AT91SAM7S64的中斷嵌套啟動(dòng)文件的問題 |
| 作者:mytempid 欄目:ARM技術(shù) |
在keil環(huán)境下,使用WWW.AT91.COM的例程,發(fā)現(xiàn)啟動(dòng)文件有下述問題: 即加注釋的兩行代碼。 IRQ_Handler_Entry ;- Manage Exception Entry ;- Adjust and save LR_irq in IRQ stack sub lr, lr, #4 stmfd sp!, {lr} ;- Save SPSR need to be saved for nested interrupt mrs r14, SPSR stmfd sp!, {r14} ;- Save and r0 in IRQ stack stmfd sp!, {r0} ;- Write in the IVR to SUPPORT Protect Mode ;- No effect in Normal Mode ;- De-assert the NIRQ and clear the source in Protect Mode ldr r14, =AT91C_BASE_AIC ldr r0 , [r14, #AIC_IVR] str r14, [r14, #AIC_IVR] ;- Enable Interrupt and SWITCH in Supervisor Mode msr CPSR_c, #Mode_SVC ;- Save scratch/used registers and LR in User Stack stmfd sp!, { r1-r3, r12, r14} ;- Branch to the routine pointed by the AIC_IVR ; mov r14, pc add r14, pc, #4 ;// MODIFIED bx r0 ;- Restore scratch/used registers and LR from User Stack msr CPSR_c, #Mode_SVC ;// MODIFIED ldmia sp!, { r1-r3, r12, r14} ;- Disable Interrupt and SWITCH BACK in IRQ mode msr CPSR_c, #I_Bit :OR: Mode_IRQ ;- Mark the End of Interrupt on the AIC ldr r14, =AT91C_BASE_AIC str r14, [r14, #AIC_EOICR] ;- Restore SPSR_irq and r0 from IRQ stack ldmia sp!, {r0} ;- Restore SPSR_irq and r0 from IRQ stack ldmia sp!, {r14} msr SPSR_cxsf, r14 ;- Restore adjusted LR_irq from IRQ stack directly in the PC ldmia sp!, {pc}^ 做上述修改后,可實(shí)現(xiàn)中斷嵌套。 有誰有更好的解決辦法? 另: 關(guān)于AT91SAM7S64中幾個(gè)NVM位(即掉電檢測位)的設(shè)置問題,看了手冊后無法設(shè)置,請各位同仁指教?捎欣虆⒖? 謝了 * - 本貼最后修改時(shí)間:2006-8-5 20:03:18 修改者:mytempid |
| 2樓: | >>參與討論 |
| 作者: mytempid 于 2006/8/7 10:47:00 發(fā)布:
現(xiàn)在測試正確了 是我的錯(cuò)。 中斷程序定義時(shí)去掉“_irq”標(biāo)識(shí),上述問題就沒有了。 |
|
|
|
| 免費(fèi)注冊為維庫電子開發(fā)網(wǎng)會(huì)員,參與電子工程師社區(qū)討論,點(diǎn)此進(jìn)入 |
Copyright © 1998-2006 m.58mhw.cn 浙ICP證030469號(hào) |