diff options
author | Ming Wei | 2018-11-19 16:06:25 -0600 |
---|---|---|
committer | Ming Wei | 2018-11-19 16:06:25 -0600 |
commit | 38cbf63fba567b6562888cdea1491336f61b21c6 (patch) | |
tree | d483c82ea4338bbe454eace1c7f7f746e888bc94 | |
parent | 625f4758f49ae5ff16a30f7a69cdd1f5fab15f78 (diff) | |
download | circmicarray-addon-38cbf63fba567b6562888cdea1491336f61b21c6.tar.gz circmicarray-addon-38cbf63fba567b6562888cdea1491336f61b21c6.tar.xz circmicarray-addon-38cbf63fba567b6562888cdea1491336f61b21c6.zip |
add UART terminal output "Test Passed" after 500 audio frames have been processed for K2G and OMAP-L137
Signed-off-by: Ming Wei <mwei@ti.com>
-rw-r--r-- | cmb/test/evmK2G/analog/loopback/src/main.c | 20 | ||||
-rw-r--r-- | cmb/test/evmK2G/analog/loopback/src/mcasp_cfg.c | 12 | ||||
-rw-r--r-- | cmb/test/evmOMAPL137/analog/loopback/src/audioSample_io.c | 6 |
3 files changed, 36 insertions, 2 deletions
diff --git a/cmb/test/evmK2G/analog/loopback/src/main.c b/cmb/test/evmK2G/analog/loopback/src/main.c index f174699..ad737b7 100644 --- a/cmb/test/evmK2G/analog/loopback/src/main.c +++ b/cmb/test/evmK2G/analog/loopback/src/main.c | |||
@@ -49,6 +49,9 @@ | |||
49 | #include "analog_test.h" | 49 | #include "analog_test.h" |
50 | #include "board.h" | 50 | #include "board.h" |
51 | 51 | ||
52 | #include <ti/drv/uart/UART.h> | ||
53 | #include <ti/drv/uart/UART_stdio.h> | ||
54 | |||
52 | /* ADC default configuration parameters */ | 55 | /* ADC default configuration parameters */ |
53 | CmbAdcConfig adcCfg = | 56 | CmbAdcConfig adcCfg = |
54 | { | 57 | { |
@@ -111,7 +114,7 @@ void McaspDevice_init(void); | |||
111 | Cmb_STATUS initPlatform(void) | 114 | Cmb_STATUS initPlatform(void) |
112 | { | 115 | { |
113 | Board_STATUS status = BOARD_SOK; | 116 | Board_STATUS status = BOARD_SOK; |
114 | Board_initCfg arg = BOARD_INIT_PINMUX_CONFIG | BOARD_INIT_MODULE_CLOCK; | 117 | Board_initCfg arg = BOARD_INIT_PINMUX_CONFIG | BOARD_INIT_MODULE_CLOCK | BOARD_INIT_UART_STDIO; |
115 | status = Board_init(arg); | 118 | status = Board_init(arg); |
116 | 119 | ||
117 | #if 1 | 120 | #if 1 |
@@ -162,6 +165,7 @@ void main (void) | |||
162 | if(status != Cmb_EOK) | 165 | if(status != Cmb_EOK) |
163 | { | 166 | { |
164 | cmb_write("Platform Init Failed!\n"); | 167 | cmb_write("Platform Init Failed!\n"); |
168 | UART_printf("Platform Init Failed!\n"); | ||
165 | testRet(1); | 169 | testRet(1); |
166 | } | 170 | } |
167 | 171 | ||
@@ -177,6 +181,14 @@ void main (void) | |||
177 | cmb_write("Test Runs in Audio Loopback Mode\n"); | 181 | cmb_write("Test Runs in Audio Loopback Mode\n"); |
178 | cmb_write("Confirm that CMB Mic 1 and Mic 8 Input are Played at On-Board Line-Out Left and Right Channels\n"); | 182 | cmb_write("Confirm that CMB Mic 1 and Mic 8 Input are Played at On-Board Line-Out Left and Right Channels\n"); |
179 | 183 | ||
184 | UART_printf("\n******************************************\n"); | ||
185 | UART_printf( " CMB Analog Loopback Test \n"); | ||
186 | UART_printf( "******************************************\n"); | ||
187 | |||
188 | UART_printf("\nTest Verifies ADC and DAC Channels\n"); | ||
189 | UART_printf("Test Runs in Audio Loopback Mode\n"); | ||
190 | UART_printf("Confirm that CMB Mic 1 and Mic 8 Input are Played at On-Board Line-Out Left and Right Channels\n"); | ||
191 | |||
180 | /* Initialize McASP HW details */ | 192 | /* Initialize McASP HW details */ |
181 | McaspDevice_init(); | 193 | McaspDevice_init(); |
182 | 194 | ||
@@ -185,6 +197,7 @@ void main (void) | |||
185 | if(status != Cmb_EOK) | 197 | if(status != Cmb_EOK) |
186 | { | 198 | { |
187 | cmb_write("eDMA Configuration Failed!\n"); | 199 | cmb_write("eDMA Configuration Failed!\n"); |
200 | UART_printf("eDMA Configuration Failed!\n"); | ||
188 | testRet(1); | 201 | testRet(1); |
189 | } | 202 | } |
190 | 203 | ||
@@ -193,6 +206,7 @@ void main (void) | |||
193 | if(status != Cmb_EOK) | 206 | if(status != Cmb_EOK) |
194 | { | 207 | { |
195 | cmb_write("Audio Init Failed!\n"); | 208 | cmb_write("Audio Init Failed!\n"); |
209 | UART_printf("Audio Init Failed!\n"); | ||
196 | testRet(1); | 210 | testRet(1); |
197 | } | 211 | } |
198 | 212 | ||
@@ -212,6 +226,7 @@ void main (void) | |||
212 | if(status != Cmb_EOK) | 226 | if(status != Cmb_EOK) |
213 | { | 227 | { |
214 | cmb_write("Audio ADC0 Configuration Failed!\n"); | 228 | cmb_write("Audio ADC0 Configuration Failed!\n"); |
229 | UART_printf("Audio ADC0 Configuration Failed!\n"); | ||
215 | testRet(1); | 230 | testRet(1); |
216 | } | 231 | } |
217 | cmb_delay(10000); | 232 | cmb_delay(10000); |
@@ -220,6 +235,7 @@ void main (void) | |||
220 | if(status != Cmb_EOK) | 235 | if(status != Cmb_EOK) |
221 | { | 236 | { |
222 | cmb_write("Audio ADC1 Configuration Failed!\n"); | 237 | cmb_write("Audio ADC1 Configuration Failed!\n"); |
238 | UART_printf("Audio ADC1 Configuration Failed!\n"); | ||
223 | testRet(1); | 239 | testRet(1); |
224 | } | 240 | } |
225 | cmb_delay(10000); | 241 | cmb_delay(10000); |
@@ -229,6 +245,7 @@ void main (void) | |||
229 | if(status != Cmb_EOK) | 245 | if(status != Cmb_EOK) |
230 | { | 246 | { |
231 | cmb_write("McASP Configuration Failed!\n"); | 247 | cmb_write("McASP Configuration Failed!\n"); |
248 | UART_printf("McASP Configuration Failed!\n"); | ||
232 | testRet(1); | 249 | testRet(1); |
233 | } | 250 | } |
234 | 251 | ||
@@ -251,6 +268,7 @@ void configAudioDAC(void) | |||
251 | if(status != Cmb_EOK) | 268 | if(status != Cmb_EOK) |
252 | { | 269 | { |
253 | cmb_write("Audio DAC0 Configuration Failed!\n"); | 270 | cmb_write("Audio DAC0 Configuration Failed!\n"); |
271 | UART_printf("Audio DAC0 Configuration Failed!\n"); | ||
254 | testRet(1); | 272 | testRet(1); |
255 | } | 273 | } |
256 | } | 274 | } |
diff --git a/cmb/test/evmK2G/analog/loopback/src/mcasp_cfg.c b/cmb/test/evmK2G/analog/loopback/src/mcasp_cfg.c index f160b30..69f96b6 100644 --- a/cmb/test/evmK2G/analog/loopback/src/mcasp_cfg.c +++ b/cmb/test/evmK2G/analog/loopback/src/mcasp_cfg.c | |||
@@ -42,6 +42,9 @@ | |||
42 | #include "mcasp_cfg.h" | 42 | #include "mcasp_cfg.h" |
43 | #include "cmb.h" | 43 | #include "cmb.h" |
44 | 44 | ||
45 | #include <ti/drv/uart/UART.h> | ||
46 | #include <ti/drv/uart/UART_stdio.h> | ||
47 | |||
45 | /* Frame index for Rx and Tx buffers */ | 48 | /* Frame index for Rx and Tx buffers */ |
46 | uint8_t rxFrameIndex = 1; | 49 | uint8_t rxFrameIndex = 1; |
47 | uint8_t txFrameIndex = 1; | 50 | uint8_t txFrameIndex = 1; |
@@ -460,7 +463,7 @@ void testRet(uint32_t status) | |||
460 | * | 463 | * |
461 | * \return Cmb_EOK on Success or error code | 464 | * \return Cmb_EOK on Success or error code |
462 | */ | 465 | */ |
463 | #define DUMP_SEC 5 | 466 | #define DUMP_SEC 10 |
464 | #define FRAME_PER_SEC 100 | 467 | #define FRAME_PER_SEC 100 |
465 | int gCmbDumpBufIdx = 0; | 468 | int gCmbDumpBufIdx = 0; |
466 | unsigned char gCmbDumpBuf[(BUFSIZE*RX_NUM_SERIALIZER)*FRAME_PER_SEC*DUMP_SEC]; | 469 | unsigned char gCmbDumpBuf[(BUFSIZE*RX_NUM_SERIALIZER)*FRAME_PER_SEC*DUMP_SEC]; |
@@ -531,6 +534,13 @@ Void Audio_echo_Task(void) | |||
531 | } | 534 | } |
532 | #endif | 535 | #endif |
533 | 536 | ||
537 | // print "Test Passed", if 500 audio frames have been processed | ||
538 | if (gCmbDumpBufIdx==500) | ||
539 | { | ||
540 | cmb_write("\nTest Passed\n"); | ||
541 | UART_printf("\nTest Passed\n"); | ||
542 | } | ||
543 | |||
534 | /* Copy the receive information to the transmit buffer */ | 544 | /* Copy the receive information to the transmit buffer */ |
535 | #if (CMB_AUDIO_DAC) | 545 | #if (CMB_AUDIO_DAC) |
536 | #if 0 // Mcasp_BufferFormat_MULTISER_MULTISLOT_SEMI_INTERLEAVED_1 | 546 | #if 0 // Mcasp_BufferFormat_MULTISER_MULTISLOT_SEMI_INTERLEAVED_1 |
diff --git a/cmb/test/evmOMAPL137/analog/loopback/src/audioSample_io.c b/cmb/test/evmOMAPL137/analog/loopback/src/audioSample_io.c index b876861..78f7379 100644 --- a/cmb/test/evmOMAPL137/analog/loopback/src/audioSample_io.c +++ b/cmb/test/evmOMAPL137/analog/loopback/src/audioSample_io.c | |||
@@ -627,6 +627,12 @@ Void Audio_echo_Task() | |||
627 | #endif | 627 | #endif |
628 | total_frames_sent++; | 628 | total_frames_sent++; |
629 | 629 | ||
630 | // printf "Test Passed" when 500 auido frames have been processed | ||
631 | if (total_frames_sent==500) | ||
632 | { | ||
633 | cmb_write("\nTest Passed\n"); | ||
634 | UART_printf("\nTest Passed\n"); | ||
635 | } | ||
630 | } | 636 | } |
631 | 637 | ||
632 | MCASP_log("\nTotal %d frames sent",total_frames_sent); | 638 | MCASP_log("\nTotal %d frames sent",total_frames_sent); |