4 Replies Latest reply on Dec 10, 2014 1:48 PM by userc_7973

    ISR(Interrupt  service Routine) in SDK3.1.1

      Hi,

       

      For our project, I have developed the DMA I2S API/driver in WICED SDK 2.4.1. We use the Inventek module  ISM43362_M3G_L44 which uses the STM32F205 processor . We configure the SPI2 as the I2S master.  When I tried to port it from SDK 2.4.1 to SDK 3.1.1, I found it doesn’t work and my application is locked up and keeps rebooting. Can you provide followings

       

      1. How to register my I2S_dma_irq() in SDK3.1.1. We use DMA1_stream3. I can’t find any ISR registration example code in SDK 3.1.1.

       

      2. I also found that SPI2  is already used for wifi gSPI bus in SDK 3.1.1. Maybe this will cause the conflict to our i2s pin configuration. How can  I disable this wifi gSPI bus  because we will use spi2 as i2s bus interface and we always the sdio bus for wifi bus?

       

      Thanks,

      Wenjian

        • 1. Re: ISR(Interrupt  service Routine) in SDK3.1.1
          SeyhanA_31

          Hi,

           

          ISR implementation had been updated on the WICED SDK-3.x. Please take a look at the ../platforms/<PLATFORM>/platform.c file for sample code. (.../platforms/BCM943362WCD4/platform.c)

           

          If MCU SPI pins are not connected to WiFi chip, wifi_spi_pins definitions could be removed from ../platforms/<PLATFORM>/platform.c file. By default the SDK builds the WiFi chip interface with SDIO connection. To enable SPI interface of WiFi chip "SPI" need to be included on the Make Target (eg: snip.scan-BCM943362WCD4-SPI download run).

           

          Seyhan

          • 2. Re: ISR(Interrupt  service Routine) in SDK3.1.1

            Hi Seyan,

             

             

            Thanks for your reply.

             

             

            When I use #define RX_BUFFERSIZE 800, it can compile the code. When I use #define RX_BUFFERSIZE 8640,  I got compile errors below. But We need #define RX_BUFFERSIZE 8640 and it can be compiled in WICED SDK 2.4.1.

             

             

            Making .gdbinit

            Building Bootloader

            c:/users/feng/wiced-sdk-3.1.1/wiced-sdk/tools/arm_gnu/bin/win32/arm-none-eabi-ld.exe: build/waf_bootloader-NoOS-NoNS-ISM43362_M3G_L44-SDIO/binary/waf_bootloader-NoOS-NoNS-ISM43362_M3G_L44-SDIO.elf section `.bss.rx_i2s_dma_buffer0' will not fit in region `BTLDR_SRAM'

            c:/users/feng/wiced-sdk-3.1.1/wiced-sdk/tools/arm_gnu/bin/win32/arm-none-eabi-ld.exe: region `BTLDR_SRAM' overflowed by 30618 bytes

            make.exe[3]: *** [build/waf_bootloader-NoOS-NoNS-ISM43362_M3G_L44-SDIO/binary/waf_bootloader-NoOS-NoNS-ISM43362_M3G_L44-SDIO.elf] Error 1

            make.exe[2]: *** [main_app] Error 2

            tools/makefiles/standard_platform_targets.mk:42: recipe for target 'bootloader' failed

            make.exe[1]: *** [bootloader] Error 2

            make: *** [main_app] Error 2

            Makefile:185: recipe for target 'main_app' failed

             

             

            Below is my i2s2_dma_irq(). It can compile in WICED SDK 2.4.1. Do I need modify the link file?

             

             

            #define RX_BUFFERSIZE 8640

            uint16_t rx_i2s_dma_buffer0[RX_BUFFERSIZE] = {0};

            uint16_t rx_i2s_dma_buffer1[RX_BUFFERSIZE] = {0};

            /* i2s DMA transfer flag */

            volatile wiced_bool_t DMA1_Stream3_irq_flag = WICED_FALSE;

            /* DMA memory buffer # */

            volatile uint8_t DMA_Memory_Num = 0;

             

             

            void i2s2_dma_irq(void)

            {

                if (DMA_GetITStatus(DMA1_Stream3, DMA_IT_TCIF3) == SET)

                {

                    DMA_ClearITPendingBit(DMA1_Stream3, DMA_IT_TCIF3);

                    //host_rtos_set_semaphore( &i2s_audio_rx_semaphore, WICED_TRUE );

                    DMA1_Stream3_irq_flag = WICED_TRUE;

                    if(DMA_GetCurrentMemoryTarget(DMA1_Stream3))

                    {

                        // Memory 1 is current target

                        DMA_MemoryTargetConfig(DMA1_Stream3,(uint32_t)rx_i2s_dma_buffer0,DMA_Memory_0);

                        DMA_Memory_Num = 0;

                    }

                    else

                    {

                        // Memory 0 is current target

                        DMA_MemoryTargetConfig(DMA1_Stream3,(uint32_t)rx_i2s_dma_buffer1,DMA_Memory_1);

                        DMA_Memory_Num = 1;

                    }

                }

            }

             

             

             

             

            tiger

            • 3. Re: ISR(Interrupt  service Routine) in SDK3.1.1
              SeyhanA_31

              Hi,

               

              Instead of including the added ISR in the bootloader it should be part of the application software. The bootloader and applications shares the same platform files where added ISR is located. Bootloader section is kept small so that the application could have larger space. Added ISR could be excluded from the bootloader with an ifdef statement and only included to the application section.

               

              Added ISR could be guarded with "#ifdef ADD_I2S2_ISR".

              The "GLOBAL_DEFINES += ADD_I2S2_ISR" could be added to the makefile of the application.

               

              Seyhan

              • 4. Re: ISR(Interrupt  service Routine) in SDK3.1.1

                Hi Seyhan,

                 

                Thanks for your prompt reply. Now it works.

                 

                I still have a question. How to register the I2S_dma_irq() in WICED SDK 2.4.1. We use DMA1_stream3. I can’t find any ISR registration example code in WICED SDK2.4.1.

                 

                Tiger