BCM20732 SPI flow control issue

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

cross mob
Anonymous
Not applicable

Hi,

I follow the spi_comm_master and spi_comm_slave to make an application about transferring data between my toy with an iphone app. I can transfer data from my toy to iphone app for first few times. I send 103 bytes to the iphone app. I divide 103 bytes into 13 frames since I only can transfer 8 bytes per frame. For first few times of transceiver data, everything is good. Then the iphone app only receives few frames data. Sometime lost data is the first frame, most of the time is some last frames. When the lost frames is at the last of transfer, I see the Flow Control Pin (P24, see note 1 for configuration) is set at high level (3.3V). Can someone please help to explain what is wrong? I am using STM32F205 to communicate with BCM20732 via SPI bus. Thank you.

Note 1

// use GPIO P24 for output flow control

#define SPIFFY2_OUTPUT_FLOW_CTRL_PIN                8

#define SPIFFY2_OUTPUT_FLOW_CTRL_PORT               1

P/S: Is there any way that I can debug the code on BCM20732? Thank you.

0 Likes
1 Solution
Anonymous
Not applicable

Hello Hung,

Try the two SDK SPI samples to make sure that they work (they do).

There are a number of posts that describe how to enable debug (it is always enabled by default over HCI UART).

On 20732, you can use any terminal app to see the traces.

Also make sure to check voltage levels.

Thanks

JT

View solution in original post

0 Likes
5 Replies
BoonT_56
Employee
Employee
500 likes received 250 likes received 100 likes received

Perhaps you may want to verify using the spi_comm_master and spi_comm_slave under Apps within the SDK as these have been tried and tested.

SPI on BCM920732TAG

Any chance of moving to 736/737?

0 Likes
Anonymous
Not applicable

Hi,

I follow those examples in SDK\Apps. My toy is using STM32F205 with SPI master mode. So I have to follow the concept at example in SDK\apps\spi_comm_master\application_gpio_interrupt_handler function. So I can make my application works for 3-4 first time, after that I lose some frames.  Thank you.

0 Likes
Anonymous
Not applicable

Hello Hung Phan,

From the developers:

  1. Are you handling the interrupts correctly?
  2. Did the spi_master <-> spi_slave samples work correctly for you?

Thanks

JT

0 Likes
Anonymous
Not applicable

Hi JT,

I set the Flow Control Pin (FCP) interrupt at both falling and rising edge. The FCP is set as input interrupt with internal pull up and pull down.

Here is my pseudo code for interrupt handler. I follow the example from SDK.

// interrupt handler

        {

            //1. Clear Interrupt flag

            // 2. Check FCP status

                //2.1 FCP == High

                    //2.1.1 SPI_CS == Low (Reset, assert chip select)

                        //Transfer data from Master Slave

                        // Set SPI_CS = High (deassert chip select)

                    //2.1.2 SPI_CS == High

                        // Set SPI_CS = Low (assert chip select)

                //2.2 FCP == Low

                    //2.2.1 SPI_CS == Low (Reset, assert chip select)

                        // Receive data from Slave  Master

                        // Set SPI_CS = High (deassert chip select)

                        // Process data into buffer and rise flag for post receiving process after exit interrupt.

                    // 2.2.2 SPI_CS == High (deassert chip select)

                        // Set flag eFrameReceiveDone = True for all frames are received.

        }

Do you have any tool or idea can help me to check if I do something wrong. I still can't debug via UART. Is that possible to debug via UART on BCM20732? What I should do to make it work.

The BCM20732 chip is installed on my tool now.

Thank you.

Hung Phan

0 Likes
Anonymous
Not applicable

Hello Hung,

Try the two SDK SPI samples to make sure that they work (they do).

There are a number of posts that describe how to enable debug (it is always enabled by default over HCI UART).

On 20732, you can use any terminal app to see the traces.

Also make sure to check voltage levels.

Thanks

JT

0 Likes