ISM43362 BCM943362 platform.c interrupt priorities

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

I plan to use USART3 on the ISM43362 which uses the STM32F205 processor.  I modified the platform.c and platform.h files to include the correct pins, interrupts, DMA channels and streams.  I also had to update the interrupt priorities function:

void platform_init_peripheral_irq_priorities( void )

{

    /* Interrupt priority setup. Called by WICED/platform/MCU/STM32F2xx/platform_init.c */

    NVIC_SetPriority( RTC_WKUP_IRQn    ,  1 ); /* RTC Wake-up event   */

    NVIC_SetPriority( SDIO_IRQn        ,  2 ); /* WLAN SDIO           */

    NVIC_SetPriority( DMA2_Stream3_IRQn,  3 ); /* WLAN SDIO DMA       */

    NVIC_SetPriority( DMA1_Stream3_IRQn,  3 ); /* WLAN SPI DMA        */

    NVIC_SetPriority( USART1_IRQn      ,  6 ); /* WICED_UART_1        */

    NVIC_SetPriority( USART2_IRQn      ,  6 ); /* WICED_UART_2        */

    NVIC_SetPriority( USART3_IRQn      ,  6 ); /* WICED_UART_2        */

    NVIC_SetPriority( DMA2_Stream7_IRQn,  7 ); /* WICED_UART_1 TX DMA */

    NVIC_SetPriority( DMA2_Stream2_IRQn,  7 ); /* WICED_UART_1 RX DMA */

    NVIC_SetPriority( DMA1_Stream6_IRQn,  7 ); /* WICED_UART_2 TX DMA */

    NVIC_SetPriority( DMA1_Stream5_IRQn,  7 ); /* WICED_UART_2 RX DMA */

    NVIC_SetPriority( DMA1_Stream3_IRQn,  7 ); /* WICED_UART_3 TX DMA */

    NVIC_SetPriority( DMA1_Stream1_IRQn,  7 ); /* WICED_UART_3 RX DMA */

    NVIC_SetPriority( EXTI0_IRQn       , 14 ); /* GPIO                */

    NVIC_SetPriority( EXTI1_IRQn       , 14 ); /* GPIO                */

    NVIC_SetPriority( EXTI2_IRQn       , 14 ); /* GPIO                */

    NVIC_SetPriority( EXTI3_IRQn       , 14 ); /* GPIO                */

    NVIC_SetPriority( EXTI4_IRQn       , 14 ); /* GPIO                */

    NVIC_SetPriority( EXTI9_5_IRQn     , 14 ); /* GPIO                */

    NVIC_SetPriority( EXTI15_10_IRQn   , 14 ); /* GPIO                */

}

I noticed that the entry for SPI DMA is DMA1_Stream3 and this is not correct for SPI1.  SPI1_RX is on DMA2_Stream0.  I compared this function to that of BCD943362 which is a similar module and the interrupt priorities are the same.

I would ask anyone more familiar with the STM32F205 to review and let me know the correct entry.  If it is correct as is, then I need to decide if it is priority 3 or 7 since USART3 uses that same DMA and stream but different channel.

Thanks,

Tom

0 Likes
1 Reply
SeyhanA_31
Employee
Employee
250 replies posted 100 replies posted 50 replies posted

Hi,

You are right the DMA1_Stream3_IRQn is for SPI2 and it is correctly setup. Because ISM43362_M3G_L44 and BCM943362WCD2 implements the BCM43362 interface of SDIO and SPI, where the SPI2 is routed to be used for that.

Default built option for BCM43362 interface is SDIO and if SPI needs to be used "-SPI" needs to be added to "Make Target" command.

If SPI1 is used by the platform, DMA setup defined in the "const platform_spi_t platform_spi_peripherals[]" used by the platform_spi_transfer(...) in .../platform/platform_spi.c (in this case .../WICED/platform/MCU/STM32F2xx/peripherals/platform_spi.c).

Seyhan

0 Likes