I made a program for a Teensy 4.0 (worked well) and then I changed the board to a STM32F401 board
I am using the SPI Arduino library
When I go to Verify I get errors when using the black Pill
/Users/michaelburnham/Documents/Arduino/CV_STEP_RECORDER/CV_STEP_RECORDER.ino: In function 'void setup()':
CV_STEP_RECORDER:111:7: error: 'class SPIClass' has no member named 'setSCK'; did you mean 'setSCLK'?
111 | SPI.setSCK(SCK_pin);
| ^~~~~~
| setSCLK
exit status 1
'class SPIClass' has no member named 'setSCK'; did you mean 'setSCLK'?
Firstly why would it behave differently? I presumed that any Library functions programmed in Arduino would be recognised by any Arduino compatible board. Why would the function change from setSCK to setSCLK. And would setSCLK work?
"beginTransaction" is not highlighted in red as it is when on Teensy board
as well as "SPI.transfer16". Are these functions still going to work as intended?
Should I be using an SPI library that has been updated for STM32F boards?
tardishead:
Firstly why would it behave differently? I presumed that any Library functions programmed in Arduino would be recognised by any Arduino compatible board. Why would the function change from setSCK to setSCLK. And would setSCLK work?
That's not a good assumption. Those types of functions are platform-specific. And, in fact, they are not support on some platforms.
"beginTransaction" is not highlighted in red as it is when on Teensy board
as well as "SPI.transfer16". Are these functions still going to work as intended?
Should I be using an SPI library that has been updated for STM32F boards?
Does it compile error-free? If so, there's a good chance it will work. The definitive way to tell is to examine the SPI Library source code specific to the platform you're using.
gfvalvo:
That's not a good assumption. Those types of functions are platform-specific. And, in fact, they are not support on some platforms.
Does it compile error-free? If so, there's a good chance it will work. The definitive way to tell is to examine the SPI Library source code specific to the platform you're using.
Right. So most basic language works fine but some of the libraries will not work?
I struggle to find any definitive info on google that outlines the compatibility/information.
aarg:
Regardless what IDE you used, setSCK() is not a standard method of the SPI class. Also you didn't answer reply#4 about which STM core you're using.
There are alternative ways to specify the pins and you even see the keyword highlighting rules.
If you discover an error, you can report it there as an issue.
There is also a web forum for support: https://www.stm32duino.com/