AnsweredAssumed Answered

STM32F2XX Interrupts

Question asked by de_wit.stephan on May 30, 2011
Latest reply on May 31, 2011 by de_wit.stephan
I have recently ported an application from the STM32F107 to the STM32F217 using the CrossWorks from Rowley tool chain.  My '107 project builds and runs correctly.  Amongst other things this project uses interrupts to monitor the serial port and some GPIOs.  Unfortunately I can't get any of these interrupts to function with my '217 board.  I am using the STM32F2xx Standard Peripherals Library and I have included my serial port configuration below. 

{
USART_InitTypeDef USART_InitStructure;
NVIC_InitTypeDef NVIC_InitStructure;
GPIO_InitTypeDef GPIO_InitStructure;
USART_ClockInitTypeDef  USART_ClockInitStructure;

// 1.
    RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART2, ENABLE);

// 2.
    RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOD, ENABLE);

// 3.
    GPIO_PinAFConfig(GPIOD, GPIO_PinSource5, GPIO_AF_USART2);
    GPIO_PinAFConfig(GPIOD, GPIO_PinSource6, GPIO_AF_USART2);

    GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6;
    GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
    GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
    GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
    GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP; 
    GPIO_Init(USART2, &GPIO_InitStructure);

    GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5;
    GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
    GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
    GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
    GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP; 
    GPIO_Init(USART2, &GPIO_InitStructure);

// 4.
    USART_InitStructure.USART_BaudRate = 115200;
    USART_InitStructure.USART_WordLength = USART_WordLength_8b;
    USART_InitStructure.USART_StopBits = USART_StopBits_1;
    USART_InitStructure.USART_Parity = USART_Parity_No;
    USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
    USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;
    USART_Init(USART2, USART_InitStruct);

// 5
    NVIC_InitStructure.NVIC_IRQChannel = USART2_IRQn;
    NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = configLIBRARY_KERNEL_INTERRUPT_PRIORITY;
    NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
    NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
    NVIC_Init( &NVIC_InitStructure );

    USART_ITConfig( USART2, USART_IT_RXNE, ENABLE );

// 6.
// No DMA

// 7.
    USART_Cmd(USART2, ENABLE);

// 8.
// No DMA
}

Does anyone know if there is some sort of global interrupt enable added to the STM32F2xx library?  I know I am missing something in regards with interrupts but I can't figure out what.  Any help is appreciated.

Steph

Outcomes