2023-07-24 07:27 AM
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 :
But I don't have the clock on the PIN PF7 :
The SAI_MCLK_B is the curve in blue. Thank you for your helps.
Regards.
Solved! Go to Solution.
2023-07-25 01:03 AM - edited 2023-07-25 01:07 AM
Yes now it's better but How did you declare playbuf please ? An array ?
2023-07-25 01:11 AM
i wrote down in my post...you didnt read, eh ?
int32_t playbuf[4096*2] __attribute__ ((aligned (32)));
2023-07-25 01:20 AM
@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 ?
2023-07-25 01:23 AM
your cpu has d-cache ? then ...as you like.
if in Cube ...de-select.
or in main.c just comment out.
2023-07-25 01:32 AM
I can't see d-cache in CubeMX but icache probably it's the same ?
if so then it is disabled
2023-07-25 01:38 AM
no !
i-cache is Instruction , for code
d-cache is for Data !
I-cache is no problem, leave it on.
2023-07-25 01:58 AM
@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 ?
2023-07-25 02:30 AM - edited 2023-07-25 02:32 AM
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.
2023-07-25 03:07 AM
good !
and - if not there - your cpu has no d-cache ! :)