Hi everyone, i'm trying to use two stm32 boards (STM32F411DISC &STM32F407VGT) for SPI communication. How to interface the SPI with Two stm32 boards, one act as master another one act as Slave and declare their pins on the cubemx?
in the STM32CubeF4 package, you have an example with SPI_2boards. You may use it as a reference.
thx for your responding, Tilen. I have used SPI1 on two stm32 boards. One act full duplex master another act full slave. I've generated their code using MDK5. But I still confused how to display their SPI results?
nothing is easy,
everyone here has to work though so many issues, don't be discouraged.
nice to see you join the club,
to view SPI data:
can you get an LCD project running ?
or you will have to use a serial port.
try an example LCD project and set up a text window.
send your SPI data to the LCD text window or to the serial port.
You can view the serial data on a terminal emulator.
or I guess you could use a break point in your code, if your IDE supports it.
I don't use an LCD project, only use terminal emulator to view SPI data. Many thanksTilen MAJERLE for your answers and suggestions
How do you use a terminal emulator to view SPI data??
Terminal emulators (generally) work with async - "U(S)ART" - comms; not SPI!
I use Analyzer2Go software as terminal emulator. So, I have two stm32 boards. Early, I use them as master and slave. But i don't have saleae logic analyzer
That's why, I use one of them as logic analyzer to view SPI
Remember that we cannot see what tools you have - it's up to you to explain clearly in your posts!
Are you talking about this: Analyzer2Go - Turn your development board into a logic analyzer ?
T J wrote: nothing is easy,everyone here has to work though so many issues
T J wrote:
everyone here has to work though so many issues
A very common beginner's mistake is to jump in too deep, and try to do too much all at once.
A classic example is trying to write both an SPI slave and an SPI master all at once and then expect it all to "just work".
But then, When it doesn't work, how can you tell if the problem is with the master, or the slave - or both?!
The way to approach a project is always to break it down into small steps; eg, first get your Master working with a known-good slave. Then, once you know the Master is good, move on to making the Slave.
It is also important to think about how you will debug a project from the start.
Hence I suggest the following for getting started - on any microcontroller:
This is the approach that I would take myself when starting any new project.
Hi devie andriyani ,
As it is suggested by Tilen, ready examples that show how to ensure SPI data buffer transmission/reception between two boards ,are included in our STM32cubeF4 firmware package:
I recommend you to start with these examples to develop you own application
You can get the STM32CubeF4 package via this link
thx a lot for your recommendation, Nesrine M. I'll try that later.
Hey devie andriyani you can download the repository of the your suitable board, and their you can get an example of the SPI full duplex communication using IT or polling too.
And if you want to display that value create a new project and enable the USART so can print it on that.
Retrieving data ...