cancel
Showing results for 
Search instead for 
Did you mean: 

SAI configuration of the STM32L5xxx board

DYann.1
Senior II

Hello,

I would like to know if there are people who have already configured the SAI PORT to communicate with a CODEC ?

I configured like this :

DYann1_0-1690208469198.png

But I don't have the clock on the PIN PF7 :

DYann1_1-1690208589059.png

The SAI_MCLK_B is the curve in blue. Thank you for your helps.
Regards.

18 REPLIES 18

Yes now it's better but How did you declare playbuf please ? An array ?

DYann1_0-1690272171888.png

i wrote down in my post...you didnt read, eh ?

int32_t playbuf[4096*2] __attribute__ ((aligned (32)));

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

@AScha.3 wrote:

and for begin, switch off d-cache, if your cpu has it. (cache management ...for later. :) )

in callbacks put your data, or for "pause" , set data zero. but never stop the running stream


Sorry I didn't read all your message. How to switch off d-cache ? By software or by configuration CubeMX ?

your cpu has d-cache ? then ...as you like.

if in Cube ...de-select.

or in main.c just comment out. 

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

I can't see d-cache in CubeMX but icache probably it's the same ?

DYann1_0-1690273880340.png

if so then it is disabled

no !   

i-cache is Instruction , for code

d-cache is for Data !

I-cache is no problem, leave it on.

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

@AScha.3 wrote:

no !   

d-cache is for Data !


Sorry but I can't find where is the 'DCACHE' tab under CubeMX, can you show me ?

DYann.1
Senior II
uint16_t write (uint16_t reg,uint16_t data)
{ 	HAL_StatusTypeDef txResponse;
	uint8_t buff[4] ;
	buff[3]=0xff & data;
	buff[2]= 0xff & data>>8;
	buff[1]= 0xff & reg;
	buff[0]= 0xff & reg;

	txResponse = HAL_I2C_Master_Transmit(&hi2c1,WRITE_ADDRESS,buff,4,HAL_MAX_DELAY); //0XFF
    if (txResponse != HAL_OK)
	{
    	return HAL_ERROR;
	}
    HAL_Delay(1) ;
    return (0);
}

I don't know where is the 'DCACHE' but now I have a clock on the MCLK pin and I have no errors on my I2C bus.
Before I have an error in this function. Thank you for your helps AScha.3.

good !

and - if not there - your cpu has no d-cache !  :)

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