cancel
Showing results for 
Search instead for 
Did you mean: 

Change SPI speed (clock prescaler) and resume operation on H7

bully
Senior

Hello,

 

I'd like to change speed (clock prescaler setting in CFG1) and then resume sending bytes on SPI.

Right now, I do :

retval = HAL_SPI_Abort(&hspi2);

My_SPI2_Init(SPI_EyeGenPrescaler);

where My_SPI2_Init is just slightly customized version of Mx_SPI2_Init with new Prescaler value as input argument.

 

After this, I don't see anything on SPI MOSI output.

 

What am I doing wrong? Is something else needed to shutdown SPI and initialize it at new prescaler value ?

 

Can I somehow change speed more fine-grained than just changing prescaler to values like powers of 2 ?

 

Thanks,

regards.

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hello,

 

thanks for response... It seems that I've forgot to start new send after reinitialization. Now it works...

Regards.

 

View solution in original post

2 REPLIES 2
Saket_Om
ST Employee

Hello @bully 

 

Could you please deinitialize the SPI before reinitializing it and check the result?

 

If your question is answered, please close this topic by clicking "Accept as Solution".

Thanks
Omar

Hello,

 

thanks for response... It seems that I've forgot to start new send after reinitialization. Now it works...

Regards.