2023-06-08 06:16 AM - edited 2023-11-20 03:38 AM
Hello all,
I want to use a NucleoU575 board to test an accelerometer sensor.
I have written the driver for this accelerometer and currently, without having it connected to the Nucleo, I am trying to check whether my SPI3 Clock is working.
This is the code:
int main(void)
{
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
/* MCU Configuration--------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* USER CODE BEGIN Init */
/* USER CODE END Init */
/* Configure the system clock */
SystemClock_Config();
/* Configure the System Power */
SystemPower_Config();
/* USER CODE BEGIN SysInit */
/* USER CODE END SysInit */
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_ADC1_Init();
MX_SPI3_Init();
MX_UCPD1_Init();
MX_USART1_UART_Init();
MX_USB_OTG_FS_PCD_Init();
MX_ICACHE_Init();
/* USER CODE BEGIN 2 */
// Initialize the IIS3DWBTR Chip
IIS3DWBTR_Initialise(&dev, &hspi3);
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while(1){
while(HAL_SPI_GetState(&hspi3) != HAL_SPI_STATE_READY);
IIS3DWBTR_Initialise(&dev, &hspi3);
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
}
And here is my pin configuration:
I am trying to measure the clock signal with an oscilloscope that has a high enough BW to capture it, yet it seems that a clock signal is not generated.
I am not sure if there is something wrong with the way I initialize my device, or if there is another issue.
Any help would be appreciated.
Thank you in advance,
Kosta
2023-06-08 06:50 AM - edited 2023-11-20 03:38 AM
clk ? i see no sending of data - clk comes only with data bits to send
see:
2023-06-08 06:59 AM
Hello @KKots.1 ,
According to @AScha.3 you should start the communication to have the CLK.
I recommend you to refer to the available examples in the STM32U5 CubeFW :
STM32Cube_FW_U5_V1.2.0\Projects\NUCLEO-U575ZI-Q\Examples\SPI
Foued
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.