2017-05-04 03:41 AM
Hi,
I am occasionally loosing a byte on SPI reads from an external ADC and would appreciate any suggestions about how to investigate further.
Summary: I have a FreeRTOS based application running on the STM32F769I Eval board. Periodically the application reads data from an external ADC (AD7606) connected via SPI. Data reads from the ADC are using DMA. Very occasionally (~one cluster in every 250000 transfers) I lose a byte in the middle of a number of successive transfers. The missing data is visibleon the bus an external SPI Analyser. The SPI Error interrupt never triggers.
Details:
hspi1.Instance = SPI1;
hspi1.Init.Mode = SPI_MODE_MASTER; hspi1.Init.Direction = SPI_DIRECTION_2LINES_RXONLY; hspi1.Init.DataSize = SPI_DATASIZE_8BIT; hspi1.Init.CLKPolarity = SPI_POLARITY_LOW; hspi1.Init.CLKPhase = SPI_PHASE_1EDGE; hspi1.Init.NSS = SPI_NSS_SOFT; hspi1.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_8; hspi1.Init.FirstBit = SPI_FIRSTBIT_MSB; hspi1.Init.TIMode = SPI_TIMODE_DISABLE; hspi1.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE; hspi1.Init.CRCPolynomial = 7; hspi1.Init.CRCLength = SPI_CRC_LENGTH_DATASIZE; hspi1.Init.NSSPMode = SPI_NSS_PULSE_DISABLE;On Bus: 0x24 0x06 0x24 0x0F
0x24
0x23
0x24 0x12 0x24 0x14 0x23 0xFA 0x24 0x06 0x24 0x10Received: 0x24 0x06 0x24 0x0F0x23
0x24 0x12 0x24 0x14 0x23 0xFA 0x24 0x06 0x24 0x10 0x24Thanks in advance for any suggestions.
Jonathan
#dma #spi #stm32f7 #freertos Note: this post was migrated and contained many threaded conversations, some content may be missing.2017-05-15 07:41 AM
I have had to focus on some other issues over the past few days, but I did discover that if I reduce the SPI clock to 60/32 (1.875MHz) then it seems the problem stops occurring. This is just masking the real issue, but it does buy me a little time. I am waiting on a call back from an ST FAE who I am hoping can shed some light on the problem..
2017-05-16 03:50 AM
Dear
Roberts.Jonathan
,As you already said, you are currently in direct contact with our local FAE in UK who will help you to more investigate your case.
But we continue check with the help of Community members here in the forum based on all details you provided. Would it be possible to share with us a reduced project that allows to reproduce the case using our Discovery or Eval board (ST boards) emulating the external ADC as you did? This will help to identify the root cause of the issue.Best Regards,
-AmelTo give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.