Loading...
 

SW4STM32 and SW4Linux fully supports the STM32MP1 asymmetric multicore Cortex/A7+M4 MPUs

   With System Workbench for Linux, Embedded Linux on the STM32MP1 family of MPUs from ST was never as simple to build and maintain, even for newcomers in the Linux world. And, if you install System Workbench for Linux in System Workbench for STM32 you can seamlessly develop and debug asymmetric applications running partly on Linux, partly on the Cortex-M4.
You can get more information from the ac6-tools website and download (registration required) various documents highlighting:

System Workbench for STM32


switch case statement within SPI interface

Hello Everyone,

I am using stm32f405VGTx mcu for my project. I connected an another MCU (as master) which talks with my stm32f405 mcu over SPI. With my 405 I have connected the external ADC(PCM 1808) and accelerometer over I2S and SPI respectively. Now I want to write a routine in my slave 405 mcu - like a switch case statement on spi so that when the master MCU gives command whether to get ADC value or accelerometer value or FFT value from my 405 mcu. But I am very confused how can I incorporate case statement in SPI routine.

Does anyone code before in this situation, a basic help will be appreciated.

Thank you.

Given that the slave only exchanges values with the master when the master says so, the process is along the lines of:
- wait until the master sends the command (this might require sending back a “no value” value such as 0 or 0xff or something that the protocol you define says “ignore this value”)
- read the command value that the master has sent you - you can then use ‘if’ or ‘switch’ statements depending on how many commands there are
- get the appropriate value and load it into the SPI buffer
- wait again until the master does another exchange
- throw away the received value or interpret it as the next command (whatever the protocol you have devices says)
- repeat the above
Of course you need to do all of this before the master requests the 2nd exchange. If this is not possible, then you can either use additional GPIO lines to let the master know when the data is ready or load up the SPI buffer with the “ignore this value” value so that the master knows that the slave has not yet completed and that it will keep trying until it does get a valid value.
This is all part of the protocol you need to define.
Susan