2023-01-25 12:50 PM
i had I2S 16bit out in slave mode running, but with 32bit data no success. always wrong byte order.
so i try SAI , slave mode, 32bit data. but nothing coming from SAI....check with DSO.
also DMA -> callbacks for half + full buffer never triggered.
i dont know, what i am doing wrong, anyone can help ?
i did (CubeIDE -> HAL ...) :
init from HAL:
MX_SAI1_Init();
callbacks:
HAL_SAI_RegisterCallback(&hsai_BlockA1, HAL_SAI_TX_HALFCOMPLETE_CB_ID, HAL_SAI_TxHalfCpltCallback);
HAL_SAI_RegisterCallback(&hsai_BlockA1, HAL_SAI_TX_COMPLETE_CB_ID, HAL_SAI_TxCpltCallback);
DMA init:
fresult = HAL_DMA_Init(&hdma_sai1_a);
start DMA:
fresult = HAL_SAI_Transmit_DMA(&hsai_BlockA1, (uint8_t *)playbuf , (sizeof(playbuf))/2);
i think, SAI should run now and via callbacks data send...but nothing happens.
whats wrong , missing... ??
Solved! Go to Solution.
2023-01-28 03:54 AM
got it working.
+
what STM could do better:
so you know, blocksize is not in bytes , but in size of transfer element (maybe byte or 16...32 bit)
now correct timing on 32bit data:
--- what was not possible with I2S - although no fault is in errata about i2s not working if data > 16 bit.
2023-01-25 01:14 PM
You probably forgot to configure the MPU, for which there is a post in the Knowlede Base.
Does that help you?
Regards
/Peter
2023-01-25 01:35 PM
thx for response.
MPU ? i dont use, or need i use it, when SAI should do something?? i use "SCB_CleanDCache_by_Addr()" to clear cache. but ... why SAI doing nothing, cache or not ?
2023-01-28 03:54 AM
got it working.
+
what STM could do better:
so you know, blocksize is not in bytes , but in size of transfer element (maybe byte or 16...32 bit)
now correct timing on 32bit data:
--- what was not possible with I2S - although no fault is in errata about i2s not working if data > 16 bit.