The board is an LPC55S69-EVK.
I'm trying to re-create lpcxpresso55s69_i2s_dma_transfer as a ThreadX task. (ThreadX is a requirement for this project.)
I am currently stuck on the I2C initialization of the codec. The code looks the same, and it (usually) claims that the codec was initialized properly. Two things make me think that the I2C is not working properly:
1) Frequently the code will fire a fail assertion for the first SMB transfer.
2) The configuration commands are very different between the example and my code. The trace for the example has several thousand transactions, while my version has only 200 or so.
The example does not include a .mex file, so I can't copy the I2C/Flexcomm4 configuration from it
Any pointers on where to look? Other tests I can run?
Gary.
It seems that the problem is trying to use FLEXCOM4 for I2C. If I don't make that mistake things seem to work.
This is what I have learned so far:
A little background: The software is driving the WM8904 on the LPC55S69-EVK. FLEXCOMs 6 & 7 are used for the I2S, FLEXCOM4 is used for the I2C. In addition, MCLOCK is sourcing 24.576 MHz to the WM8904.
If I connect a scope probe - Genuine Tektronix 10 Megohm, 13 pF - to the MCLOCK pin, FLEXCOM4 stops working.
I don't have to do anything else. Just probe the pin, and I2C stops working.
The clock looks OK on the scope but all I2C transactions to the WM8904 fail.
Reproducing the error is simple - just run the program. Detecting the error is a little harder: I have a monitor that captures the I2C transactions, and there are many missing, and most have transfer errors.
Bottom line is that after calling Codec_Init, the codec is not initialized.
Hello @gary-h
Recommend you using logic analysis the I2C signal.
"Bottom line is that after calling Codec_Init, the codec is not initialized."
->> Debug step by step check the issue. and fist can try to use i2s demo, confirm it works well, then add ThreadX .
BR
Alice
Hello @gary-h
Please take a picture about hardware connection and show the errors you said:
" I have a monitor that captures the I2C transactions, and there are many missing, and most have transfer errors."
thanks.
BR
Alice