Skip to main content
Associate II
November 13, 2024
Question

spi1 and spi2 in same project not working on spi2. spi1 works

  • November 13, 2024
  • 2 replies
  • 1749 views

 i have a stm32u5a5 board but I needed a SPI full duplex Master example with DMA so i used the one for stm32u575.

full duplex Master DMA

it runs fine on my u5a5 board.

i added a SPI 2 channel and i cannot get it to work.  i only want to run them one at a time now.

i think i have the SPI 2 configured properly.

can you please give me some advice.

i have attached my .ioc file

I am using STM32cubeMX  6.12.1

 

stm32 cubeIDE 1.16.1

 

 

firmware 1.6.0

one question is the u575 different between u5a5 on how it runs SPI 2

thanks

phil

 

2 replies

Andrew Neil
Super User
November 13, 2024

@Weightwatcherphil wrote:

i think i have the SPI 2 configured properly.


So if you have just SPI2 - without SPI1 - does that work?

You'll need to show your, tell what board you have, etc:

https://community.st.com/t5/community-guidelines/how-to-write-your-question-to-maximize-your-chances-to-find-a/ta-p/575228

 

What, exactly, does "not working" mean here?

  • code crashes?
  • anything seen on the SPI lines?
  • etc?
A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Associate II
November 13, 2024

i running the code on a nucleo-u5a5 board.

i pulled the SPI FULL DUPLEX MASTER DMA example. (i could not find the example for u5a5)

generated code with STM32cubeMX 6.12.1

used u5 firmware 1.6.0

 

i compiled the example using STM32cube IDE 1.16.1 and ran it with SPI1 and it ran on the u5a5 board.

then  i used STM32cubeMX 6.12.1 to remove spi1 and add spi2.

and generated new code.

i used STM32cubeIDE 1.16.1 to compile and i had to change some spi instances  to spi2 instance in a few places.

i kept the same DMA channels

this code did not run.

iin particular when i transmitted the spi data i never got a COMPLETE back.

thank you so much for your quick response.

i have attached my .ioc file 

since i am using the example code i will not repeat it here.

phil

 

Associate II
November 13, 2024

to be clear when i use MXcube to generate the code it is showing U575 as the board..

it am just thinking for SPI the u5a5 and u575 seem the same.

and for SPi1 it worked.

Associate II
November 14, 2024

Yes the code reaches the Hal transmitandreceive statement and gets all the way to the while loop. The zip files contain the entire project so you can try it for yourself .