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 two short videos (registration required) highlighting:

System Workbench for STM32


STM32F1 SPI Simpleton Implementation Fail

France

Hi Ben,

First of all you should check that in your project settings at “project >> C/C++ Build >> Settings >> Tool Settings >> MCU GCC Compiler >> Warnings” the “All Warnings (-Wall)” option is checked. This will gives you warnings on potential errors you may have in your code.

Second, there is indeed several problems in your code:

  1. You do not need any parentheses in (pData) = ; you can write it simply as pData =
  2. pData, as its name implies, should be a pointer to uint8_t data (bytes);
    1. You should declare it as uint8_t *pData;
    2. Then you cannot assign it a byte, you must assign it the address of a byte, by pData = &TheDataItself;
    3. Finally you can pass to HAL_SPI_Transmit either pData or &TheDataItself, both will request HAL to transmit 1 byte of data (value of cnt), located in the TheDataItself variable
Probably the cleaner way to transmit a byte on the SPI would be to write:
uint8_t TheDataItself = 0xFF;
HAL_SPI_Transmit(&hspi2, &TheDataItself, sizeof(TheDataItself), 10); // 10 is the time out value.

Finally, I think you should read one of the numerous C programming courses you can find on the web: whatever it may look like, C is not a simple programming language, especially when going to pointers, and you need some guidance when starting to program in C.

Hope this helps clarifying things,

Bernard (Ac6)

 

Newest Forum Posts

  1. openOCD Wrong device detected by maxim221, 12:32
  2. STM32429I_Discovery board with printf float support problem by johannes.visser@msc-technologies.eu, 2019-12-05 16:08
  3. malloc heap issue with CubeMX Project by johannes.visser@msc-technologies.eu, 2019-12-05 16:04
  4. Debugger not working by Daniel Jack Morley, 2019-11-27 21:46
  5. Compiler change problem by Lucian Pop, 2019-11-20 17:41
  6. Sample programs and compiling by jjtimer, 2019-11-20 10:31
  7. Unit test issues for STM32 by Rinkedevries, 2019-11-18 10:32
  8. Ubuntu 19.04 Debug problems by costantino, 2019-11-17 19:17
  9. Compile without eclipse by JSStabl, 2019-11-14 15:55
  10. Problem with PWM signal by ElectroniK, 2019-11-13 20:55

Last-Modified Blogs