Hi all,
Using the RT1170EVK and SDK v2.15, I'm seeing the SAI produce a bit clock & FS clock that is double what is expected. Master clock is correct.
You can see in my SAI peripheral config, the input clock is 12.288MHz, bit clock is 3.072MHz and FS clock is 48kHz.
When I debug, I can see the correct values being passed in (See on the left)
But when I measure the output, MCLK is correct and FS clock is 96kHz.
What could be causing this? I'm not changing any settings in my application code, just calling:
BOARD_InitBootPins();
BOARD_InitBootClocks();
BOARD_InitBootPeripherals();
SAI_TransferTxCreateHandleEDMA(SAI1_PERIPHERAL, &saiTxHandle, nullptr, NULL, &DMA0_CH0_Handle);
SAI_TransferTxSetConfigEDMA(SAI1_PERIPHERAL, &saiTxHandle, &SAI1_Tx_config);
sai_transfer_t xfer;
xfer.data = reinterpret_cast<uint8_t *>(txBuff);
xfer.dataSize = BUFFER_SIZE * sizeof(uint32_t);
SAI_TransferSendEDMA(SAI1_PERIPHERAL, &saiTxHandle, &xfer)
Thanks,
Matt
Hi @mttjcksn ,
May I have the steps to reproduce this issue? Was this test based on some SAI demo or custom application? Please kindly clarify.
Have a great day,
Kan
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hi,
I generated a bare-bones C++ project using the MCUXpresso IDE and MCUXpresso SDK v2.15.
I then exported as an archive and imported as a gcc toolchain project using the visual studio code extension and made the manual adjustments to get it to build properly with cmake.
Then using the config tool I added the SAI peripheral driver and configured the clock as shown in my original post.
I've managed to get it to work but it doesn't really make sense as to how this solved the issue...
I stepped through the driver where it writes the DIV field in the TCR2, and I see it writing the correct value, but the clock output is wrong. I then manually set the TCR2 register in my application code, and the clock becomes correct. I then remove the code where I manually set TCR2, and it stays correct.
Maybe a caching issue somewhere? I honestly have no idea. But it certainly didn't work out of the box for me!
Matt
Hi @mttjcksn ,
Is it possible to have the register values of the SAI module after initialization ? We may help to check if FS and BCLK were configured correctly in your case.
Thanks for your patience !
Have a great day,
Kan
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------