Errors compiling SPI.setSSEL()
Posted: Thu Sep 12, 2024 7:55 pm
Hi,
I am using a NUCLEO-144 F722ZE. I am trying to enable CS pin management by the SPI engine.
Here is a sample code
And, here is the first error message:
Thank you
I am using a NUCLEO-144 F722ZE. I am trying to enable CS pin management by the SPI engine.
Here is a sample code
Code: Select all
#define SPI_SPEED 50000000
SPISettings spi_settings( SPI_SPEED, MSBFIRST, SPI_MODE0);
const int CNVSTPin = 10;
const int SDIPin = 11;
const int SDOPin = 12;
const int CLKPin = 13;
SPI.setSSEL(CNVSTPin);
// To be called from setup()
void setupSPI() {
#ifndef MANAGED_SPI_SEL
// SPI library takes care of the other pins
DIGITALWRITE(CNVSTPin, LOW);
#endif
SPI.begin();
}
So, we change SPI.setSSEL(PC10); to SPI1.setSSEL(PC10);, and here is the new error message:/home/nelson/Projects/TeensyDataAcquistion/SPI_Instrumenation_Project/Firmware/Arduino_Benchmark_240901/Arduino_Benchmark_240901.ino:425:1: error: 'SPI' does not name a type; did you mean 'SPI1'?
425 | SPI.setSSEL(PC10);
| ^~~
| SPI1
exit status 1
So, what's wrong?In file included from /home/nelson/.arduino15/packages/STMicroelectronics/hardware/stm32/2.8.1/system/Drivers/CMSIS/Device/ST/STM32F7xx/Include/stm32f7xx.h:117,
from /home/nelson/.arduino15/packages/STMicroelectronics/hardware/stm32/2.8.1/cores/arduino/../../libraries/SrcWrapper/inc/stm32_def.h:36,
from /home/nelson/.arduino15/packages/STMicroelectronics/hardware/stm32/2.8.1/cores/arduino/../../libraries/SrcWrapper/inc/clock.h:19,
from /home/nelson/.arduino15/packages/STMicroelectronics/hardware/stm32/2.8.1/cores/arduino/wiring_time.h:23,
from /home/nelson/.arduino15/packages/STMicroelectronics/hardware/stm32/2.8.1/cores/arduino/wiring.h:38,
from /home/nelson/.arduino15/packages/STMicroelectronics/hardware/stm32/2.8.1/cores/arduino/Arduino.h:36,
from /home/nelson/Projects/TeensyDataAcquistion/SPI_Instrumenation_Project/Firmware/Arduino_Benchmark_240901/Arduino_Benchmark_240901.ino:44:
/home/nelson/.arduino15/packages/STMicroelectronics/hardware/stm32/2.8.1/system/Drivers/CMSIS/Device/ST/STM32F7xx/Include/stm32f722xx.h43: error: expected ')' before '*' token
1106 | #define SPI1 ((SPI_TypeDef *) SPI1_BASE)
| ~ ^
/home/nelson/Projects/TeensyDataAcquistion/SPI_Instrumenation_Project/Firmware/Arduino_Benchmark_240901/Arduino_Benchmark_240901.ino:425:1: note: in expansion of macro 'SPI1'
425 | SPI1.setSSEL(PC10);
| ^~~~
/home/nelson/.arduino15/packages/STMicroelectronics/hardware/stm32/2.8.1/system/Drivers/CMSIS/Device/ST/STM32F7xx/Include/stm32f722xx.h43: error: expected ')' before '*' token
1106 | #define SPI1 ((SPI_TypeDef *) SPI1_BASE)
| ~ ^
/home/nelson/Projects/TeensyDataAcquistion/SPI_Instrumenation_Project/Firmware/Arduino_Benchmark_240901/Arduino_Benchmark_240901.ino:425:1: note: in expansion of macro 'SPI1'
425 | SPI1.setSSEL(PC10);
| ^~~~
exit status 1
Compilation error: exit status 1
Thank you