用移植到stm32的ucos写串口中断为什么一直死机啊,研究快两天了,请大侠指点一二。谢谢
中断处理函数
void USART1_IRQHandler(void) { OS_CPU_SR cpu_sr; UCOS_II_REENTRANT_ISR_PROLOG UCOS_II_REENTRANT_ISR_EPILOG OS_ENTER_CRITICAL();; OSIntNesting++; OS_EXIT_CRITICAL(); if(USART_GetITStatus(USART1, USART_IT_RXNE) == SET) {
data = (USART_ReceiveData(USART1) & 0x7F); USART_ClearITPendingBit(USART1, USART_IT_RXNE); } OSIntExit(); }
向量表
;****************************************************************************** ; ; INTERRUPT VECTORS ; ARM ; KEIL's uVision3 ; (RealView Microprocessor Developer Kit) ; ; Filename : vectors.s ;******************************************************************************
PRESERVE8 AREA VECT, CODE, READONLY ; Name this block of code ; THUMB
ENTRY
;****************************************************************************** ; IMPORTS ;******************************************************************************
IMPORT Tmr_TickISR_Handler ; IMPORT ProbeRS232_RxTxISRHandler IMPORT USART1_IRQHandler IMPORT OSPendSV IMPORT ResetHndlr IMPORT ||Image$$ARM_LIB_STACK$$ZI$$Limit|| ; Import stack limit from scatter-loading file ;
;****************************************************************************** ; EXPORTS ;****************************************************************************** ;EXPORT USART1_IRQHandler ;****************************************************************************** ; DEFINITIONS ;******************************************************************************
;****************************************************************************** ; INITIALIZE EXCEPTION VECTORS ;******************************************************************************
Vectors DCD ||Image$$ARM_LIB_STACK$$ZI$$Limit|| ; 0, SP start value. DCD ResetHndlr ; 1, PC start value. DCD App_NMI_ISR ; 2, NMI DCD App_Fault_ISR ; 3, Hard Fault DCD App_Spurious_ISR ; 4, Memory Management DCD App_Spurious_ISR ; 5, Bus Fault DCD App_Spurious_ISR ; 6, Usage Fault DCD 0 ; 7, Reserved DCD 0 ; 8, Reserved DCD 0 ; 9, Reserved DCD 0 ; 10, Reserved DCD App_Spurious_ISR ; 11, SVCall DCD App_Spurious_ISR ; 12, Debug Monitor DCD App_Spurious_ISR ; 13, Reserved DCD OSPendSV ; 14, PendSV Handler DCD Tmr_TickISR_Handler ; 15, uC/OS-II Tick ISR Handler DCD App_Spurious_ISR ; 16, INTISR[ 0], Window Watchdog DCD App_Spurious_ISR ; 17, INTISR[ 1] PVD through EXTI Line Detection DCD App_Spurious_ISR ; 18, INTISR[ 2] Tamper Interrupt DCD App_Spurious_ISR ; 19, INTISR[ 3] RTC Global Interrupt DCD App_Spurious_ISR ; 20, INTISR[ 4] FLASH Global Interrupt DCD App_Spurious_ISR ; 21, INTISR[ 5] RCC Global Interrupt DCD App_Spurious_ISR ; 22, INTISR[ 6] EXTI Line0 Interrupt DCD App_Spurious_ISR ; 23, INTISR[ 7] EXTI Line1 Interrupt DCD App_Spurious_ISR ; 24, INTISR[ 8] EXTI Line2 Interrupt DCD App_Spurious_ISR ; 25, INTISR[ 9] EXTI Line3 Interrupt DCD App_Spurious_ISR ; 26, INTISR[ 10] EXTI Line4 Interrupt DCD App_Spurious_ISR ; 27, INTISR[ 11] DMA Channel1 Global Interrupt DCD App_Spurious_ISR ; 28, INTISR[ 12] DMA Channel2 Global Interrupt DCD App_Spurious_ISR ; 29, INTISR[ 13] DMA Channel3 Global Interrupt DCD App_Spurious_ISR ; 30, INTISR[ 14] DMA Channel4 Global Interrupt DCD App_Spurious_ISR ; 31, INTISR[ 15] DMA Channel5 Global Interrupt DCD App_Spurious_ISR ; 32, INTISR[ 16] DMA Channel6 Global Interrupt DCD App_Spurious_ISR ; 33, INTISR[ 17] DMA Channel7 Global Interrupt DCD App_Spurious_ISR ; 34, INTISR[ 18] ADC Global Interrupt DCD App_Spurious_ISR ; 35, INTISR[ 19] USB High Priority / CAN TX Interrupts DCD App_Spurious_ISR ; 36, INTISR[ 20] USB Low Priority / CAN RX0 Interrupts DCD App_Spurious_ISR ; 37, INTISR[ 21] CAN RX1 Interrupt DCD App_Spurious_ISR ; 38, INTISR[ 22] CAN SCE Interrupt DCD App_Spurious_ISR ; 39, INTISR[ 23] EXTI Line[9:5] Interrupt DCD App_Spurious_ISR ; 40, INTISR[ 24] TIM1 Break Interrupt DCD App_Spurious_ISR ; 41, INTISR[ 25] TIM1 Update Interrupt DCD App_Spurious_ISR ; 42, INTISR[ 26] TIM1 Trigger & Commutation Interrupts DCD App_Spurious_ISR ; 43, INTISR[ 27] TIM2 Global Interrupt DCD App_Spurious_ISR ; 44, INTISR[ 28] TIM3 Global Interrupt DCD App_Spurious_ISR ; 45, INTISR[ 29] TIM4 Global Interrupt DCD App_Spurious_ISR ; 46, INTISR[ 30] I2C1 Event Interrupt DCD App_Spurious_ISR ; 47, INTISR[ 31] I2C1 Error Interrupt DCD App_Spurious_ISR ; 48, INTISR[ 32] I2C2 Event Interrupt DCD App_Spurious_ISR ; 49, INTISR[ 33] I2C2 Error Interrupt DCD App_Spurious_ISR ; 50, INTISR[ 34] SPI1 Global Interrupt DCD USART1_IRQHandler ; 51, INTISR[ 35] SPI2 Global Interrupt DCD App_Spurious_ISR ; 52, INTISR[ 36] USART1 Global Interrupt DCD App_Spurious_ISR ; 53, INTISR[ 37] USART2 Global Interrupt DCD App_Spurious_ISR ; 54, INTISR[ 38] USART3 Global Interrupt DCD App_Spurious_ISR ; 55, INTISR[ 39] EXTI Line [15:10] Interrupts DCD App_Spurious_ISR ; 56, INTISR[ 40] RTC Alarm through EXT Line Interrupt DCD App_Spurious_ISR ; 57, INTISR[ 41] USB Wakeup from Suspend through EXTI Int. DCD App_Spurious_ISR ; 57, INTISR[ 41] USB Wakeup from Suspend through EXTI Int. DCD App_Spurious_ISR ; 57, INTISR[ 41] USB Wakeup from Suspend through EXTI Int. DCD App_Spurious_ISR ; 57, INTISR[ 41] USB Wakeup from Suspend through EXTI Int. DCD App_Spurious_ISR ; 57, INTISR[ 41] USB Wakeup from Suspend through EXTI Int. DCD App_Spurious_ISR ; 57, INTISR[ 41] USB Wakeup from Suspend through EXTI Int. DCD App_Spurious_ISR ; 57, INTISR[ 41] USB Wakeup from Suspend through EXTI Int. DCD App_Spurious_ISR ; 57, INTISR[ 41] USB Wakeup from Suspend through EXTI Int. ;****************************************************************************** ; DEFAULT HANDLERS ;******************************************************************************
App_NMI_ISR B App_NMI_ISR
App_Fault_ISR B App_Fault_ISR
App_Spurious_ISR B App_Spurious_ISR
ALIGN END |
|