Other Parts Discussed in Thread: SYSCONFIG, TAD5212
Mcasp buffer order
To be short, in case of multiple serializers used in one Mcasp, the samples are placed interleaved by slot not frame by default. (Please check the "12.1.2.2.2.2 Definition of Terms " in TRM for definition of slot and frame).
The following figure displays the buffer allocation when configuring the two serializers on one mcasp to be TDM2/I2S .
This buffer order is by default when mcasp transfer mode is configured as MCASP_TRANSFER_MODE_DMA, in which case the MCASP_AUDBUFF_FORMAT_1SER_MULTISLOT_INTERLEAVED is likely to be ignored and default config is used.
Experiments
Modify mcasp_chime_tad5212 example sysconfig as follows:
Modify sysconfig to use mcasp0 instead of mcasp1 as mcasp0 is more easily to measure with aec board. Add one serializer as transmit.
diff --git a/examples/drivers/mcasp/mcasp_chime_tad5212/am275x-evm/c75ss0-0_freertos/example.syscfg b/examples/drivers/mcasp/mcasp_chime_tad5212/am275x-evm/c75ss0-0_freertos/example.syscfg
index 33904304..5351d8d0 100644
--- a/examples/drivers/mcasp/mcasp_chime_tad5212/am275x-evm/c75ss0-0_freertos/example.syscfg
+++ b/examples/drivers/mcasp/mcasp_chime_tad5212/am275x-evm/c75ss0-0_freertos/example.syscfg
@@ -1,9 +1,9 @@
/**
* These arguments were used when this file was generated. They will be automatically applied on subsequent loads
* via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
- * @cliArgs --device "AM275x" --part "AM2754" --package "ANJ" --context "c75ss0-0" --product "AM275x_FREERTOS_SDK@11.01.00"
- * @v2CliArgs --device "AM2754" --package "FCCSP (ANJ)" --context "c75ss0-0" --product "AM275x_FREERTOS_SDK@11.01.00"
- * @versions {"tool":"1.23.0+4000"}
+ * @cliArgs --device "AM275x" --part "AM2754" --package "ANJ" --context "c75ss0-0" --product "AM275X_FREERTOS_SDK@11.01.00"
+ * @v2CliArgs --device "AM2754" --package "FCCSP (ANJ)" --context "c75ss0-0" --product "AM275X_FREERTOS_SDK@11.01.00"
+ * @versions {"tool":"1.24.0+4150"}
*/
/**
@@ -44,19 +44,24 @@ mcasp1.enableLoopback = false;
mcasp1.clkSyncMode = "ASYNC";
mcasp1.enableMcaspRx = false;
mcasp1.txCallbackFxn = "mcasp_txcb";
-mcasp1.txActiveSlotMask = 0x3;
mcasp1.txLoopjobBufLength = 384000;
mcasp1.externTxLoopjob = true;
mcasp1.txLoopjobBufExtern = "uint8_t audio_sample[]";
mcasp1.txLoopjobBuf = "audio_sample";
+mcasp1.txActiveSlotMask = 0x3;
mcasp1.CLOCKING.$assignAllowConflicts = "CLOCKING";
-mcasp1.mcaspSer.create(1);
+mcasp1.mcaspSer.create(2);
mcasp1.mcaspSer[0].$name = "CONFIG_MCASP_SER0";
-mcasp1.mcaspSer[0].serNum = 1;
-mcasp1.mcaspSer[0].MCASP.$assignAllowConflicts = "MCASP1";
-mcasp1.MCASP.$assignAllowConflicts = "MCASP1";
-scripting.suppress("Resource conflict,MCASP1 is also in use by @@@.+?@@@", mcasp1.mcaspSer[0].MCASP, "$assign");
-scripting.suppress("Resource conflict,MCASP1 is also in use by @@@.+?@@@", mcasp1.MCASP, "$assign");
+mcasp1.mcaspSer[0].MCASP.$assignAllowConflicts = "MCASP0";
+mcasp1.mcaspSer[0].MCASP.AXR0.$assign = "MCASP0_AXR0";
+mcasp1.mcaspSer[1].$name = "CONFIG_MCASP_SER2";
+mcasp1.mcaspSer[1].serNum = 1;
+mcasp1.mcaspSer[1].MCASP.$assignAllowConflicts = "MCASP0";
+mcasp1.mcaspSer[1].MCASP.AXR1.$assign = "MCASP0_AXR1";
+mcasp1.MCASP.$assignAllowConflicts = "MCASP0";
+scripting.suppress("Resource conflict,MCASP0 is also in use by @@@.+?@@@, @@@.+?@@@", mcasp1.mcaspSer[0].MCASP, "$assign");
+scripting.suppress("Resource conflict,MCASP0 is also in use by @@@.+?@@@, @@@.+?@@@", mcasp1.mcaspSer[1].MCASP, "$assign");
+scripting.suppress("Resource conflict,MCASP0 is also in use by @@@.+?@@@, @@@.+?@@@", mcasp1.MCASP, "$assign");
const udma = scripting.addModule("/drivers/udma/udma", {}, false);
const udma1 = udma.addInstance({}, false);
@@ -137,9 +142,8 @@ mmu_armv812.attribute = "MAIR4";
* version of the tool will not impact the pinmux you originally saw. These lines can be completely deleted in order to
* re-solve from scratch.
*/
-i2c1.I2C.SCL.$suggestSolution = "I2C0_SCL";
-i2c1.I2C.SDA.$suggestSolution = "I2C0_SDA";
-mcasp1.mcaspSer[0].MCASP.AXR1.$suggestSolution = "MCASP1_AXR1";
-mcasp1.MCASP.AFSX.$suggestSolution = "MCASP1_AFSX";
-mcasp1.MCASP.ACLKX.$suggestSolution = "MCASP1_ACLKX";
-debug_log.uartLog.UART.RXD.$suggestSolution = "MCASP0_AXR6";
+i2c1.I2C.SCL.$suggestSolution = "I2C0_SCL";
+i2c1.I2C.SDA.$suggestSolution = "I2C0_SDA";
+mcasp1.MCASP.AFSX.$suggestSolution = "MCASP0_AFSX";
+mcasp1.MCASP.ACLKX.$suggestSolution = "MCASP0_ACLKX";
+debug_log.uartLog.UART.RXD.$suggestSolution = "MCASP0_AXR6";
Modify the data to be transferred to help discriminate the data:
diff --git a/examples/drivers/mcasp/mcasp_chime_tad5212/audio_sample.h b/examples/drivers/mcasp/mcasp_chime_tad5212/audio_sample.h
index 251fa7db..6ee9ffa6 100644
--- a/examples/drivers/mcasp/mcasp_chime_tad5212/audio_sample.h
+++ b/examples/drivers/mcasp/mcasp_chime_tad5212/audio_sample.h
@@ -40,12 +40,12 @@ extern "C"
/* Dual channel audio sample (48 KHz) */
const unsigned int audio_sample[]= {
-0x00000000,
-0x00000000,
-0x00121900,
-0x00121900,
-0x00479000,
-0x00479000,
+0x00000001,
+0x00000002,
+0x00121901,
+0x00121902,
+0x00479001,
+0x00479002,
0x009df1c6,
0x009df1c6,
0x01114608,
Rebuild this example and capture the data transferred on mcasp1 ax0 and ax1 with logic analyser.
The data captured from logic analyser:

channel 2 refers to ax0 and channel 3 refers to ax1.
The data defined in buffer in the example code:

The captured data and the transferred data conforms.
Regards,
Adam Hua