cancel
Showing results for 
Search instead for 
Did you mean: 

SPI3 Clock not working on NucleoU575

KKots.1
Associate II

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:


_legacyfs_online_stmicro_images_0693W00000dDPOjQAO.png

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

2 REPLIES 2
AScha.3
Chief III

clk ? i see no sending of data - clk comes only with data bits to send 

see:


_legacyfs_online_stmicro_images_0693W00000dDPZXQA4.png

If you feel a post has answered your question, please click "Accept as Solution".
Foued_KH
ST Employee

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.