For I project, I would like to switch from an Arduino Nano to a Nucleo-G431KB.
I use a pressure sensor HRCDRRN100MDSA3 from Honeywell, with the HoneywellTruStabilitySPI library.
Using the Arduino, I have no problem to run the exemple code.
But I can't made it work with my Nucleo, even with adjusting the SPI pin.
I tried to use the debugger to understand where the problem is, but it's to complexe for me to understand

All I know is that I'm blocked in a infinite loop:
In spi_com.c, at line 546
Code: Select all
while (!LL_SPI_IsActiveFlag_TXE(_SPI));
Do you have any idea?
Thanks
Full test sketch
Code: Select all
/*
* PressureSensorTest
*
* Fetch and print values from a Honeywell
* TruStability HSC Pressure Sensor over SPI
*
* The sensor values used in this demo are
* for a -15 to 15 psi gauge pressure sensor.
*
*/
#include <HoneywellTruStabilitySPI.h>
#define SLAVE_SELECT_PIN PA11 // D10 on Arduino
TruStabilityPressureSensor sensor( SLAVE_SELECT_PIN, -100.0, 100.0 );
void setup() {
Serial.begin(115200); // start Serial communication
SPI.setMOSI(PB5); // D11 on Arduino
SPI.setMISO(PB4); // D12 on Arduino
SPI.setSCLK(PB3); // D13 on Arduino
SPI.begin(); // start SPI communication
sensor.begin(); // run sensor initialization
}
void loop() {
// the sensor returns 0 when new data is ready
if( sensor.readSensor() == 0 ) {
Serial.print( "temp [C]: " );
Serial.print( sensor.temperature() );
Serial.print( "\t pressure [psi]: " );
Serial.println( sensor.pressure() );
}
delay( 100 ); // Slow down sampling to 10 Hz. This is just a test.
}