Skip to main content
SHebb.1
Associate
June 28, 2022
Solved

SPI6 using BDMA Tx not working

  • June 28, 2022
  • 7 replies
  • 3279 views

I am trying to make SPI6 work with BDMA I see that transfer completion flag set in BMA ISR but SPI registers i don't see EOT bit set. I don't see any data coming from MOSI line of SPI6. Please help me know what is going wrong. There is no error set in any of the registers I have attached a screen shot of BDMA and SPI6 registers. I am using BDMA channel 0 for Rx and BDMA channel 1 for Tx.

This topic has been closed for replies.
Best answer by SHebb.1

Hi,

Thanks for the help.

I could figure out the problem.

  1. one of the problem was i was using SRAM 3 instead of SRAM 4 which is from 0x38000000 this solved the error i was getting in BDMA transfer.
  2. For the EOT not getting set in SR registers of SPI6 - I had not configured port G which i was using for SPI lines as AF5. Also No pull configuration for the GPIO pins.

I am able to transfer and receive the data's using SPI6 with BDMA.

7 replies

waclawek.jan
Super User
June 28, 2022

Which STM32?

> I don't see any data coming from MOSI line of SPI6.

And SCK?

Have you tried polled implementation of SPI6, or at least transmit by writing directly into registers in debugger?

JW

SHebb.1
SHebb.1Author
Associate
June 28, 2022

Iam Using STM32H743I

SHebb.1
SHebb.1Author
Associate
June 28, 2022

No SCK as well

waclawek.jan
Super User
June 28, 2022

Try polled implementation of SPI6, to make sure there's no problem in SPI itself, GPIO or clocks.

JW

SHebb.1
SHebb.1Author
Associate
June 29, 2022

I tried in polling method after i use HAL_SPI_Transmit its waiting in 

while ((__HAL_SPI_GET_FLAG(hspi, Flag) ? SET : RESET) == Status)

for EOT flag in SR register to be set. What can be the reason for this?

I see the SPI6 registers are getting filled properly.

0693W00000Nt14uQAB.png

GCava.2
Visitor II
July 8, 2022

Hello @SHebb.1​ ,

have u define the buffer correctly?

For example, I resolved my problems in this way:

static uint8_t __attribute__ ((section (".BDMA_Access"),used)) sbuffer_tx[2];

static uint8_t __attribute__ ((section (".BDMA_Access"),used)) sbuffer_rx[2];

Then, inside the main, u can initialize the buffer, as:

sbuffer_tx[0]= 0x00;

sbuffer_tx[1]= 0x00;

and the u can use the sample HAL:

HAL_SPI_TransmitReceive_DMA(&hspi6, sbuffer_tx, sbuffer_rx,sizeof(sbuffer_rx));

Finally ".BDMA_Access" is defined inside the linker script file as:

 .BDMABlock : 

 {

  . = ALIGN(32);

  *(.BDMA_Access)

 } >RAM_D3 AT> FLASH

  

Bye!!!

SHebb.1
SHebb.1AuthorBest answer
Associate
July 8, 2022

Hi,

Thanks for the help.

I could figure out the problem.

  1. one of the problem was i was using SRAM 3 instead of SRAM 4 which is from 0x38000000 this solved the error i was getting in BDMA transfer.
  2. For the EOT not getting set in SR registers of SPI6 - I had not configured port G which i was using for SPI lines as AF5. Also No pull configuration for the GPIO pins.

I am able to transfer and receive the data's using SPI6 with BDMA.