esp32c3_dma: Remove the DMA test included in the driver along with its
defconfig. Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
This commit is contained in:
parent
aeb1d3098d
commit
860370284e
@ -917,20 +917,6 @@ endmenu # SPI Flash configuration
|
||||
menu "GDMA Configuration"
|
||||
depends on ESP32C3_DMA
|
||||
|
||||
config ESP32C3_DMA_M2M_TEST
|
||||
bool "Test GDMA M2M"
|
||||
default n
|
||||
|
||||
config ESP32C3_DMA_M2M_TEST_LOOPS
|
||||
int "Test GDMA M2M loops"
|
||||
default 256
|
||||
depends on ESP32C3_DMA_M2M_TEST
|
||||
|
||||
config ESP32C3_DMA_M2M_TEST_BUFSIZE
|
||||
int "Test GDMA M2M buffer size"
|
||||
default 16000
|
||||
depends on ESP32C3_DMA_M2M_TEST
|
||||
|
||||
endmenu # GDMA Configuration
|
||||
|
||||
config ESP32C3_AUTO_SLEEP
|
||||
|
@ -381,153 +381,3 @@ void esp32c3_dma_init(void)
|
||||
modifyreg32(DMA_MISC_CONF_REG, 0, DMA_CLK_EN_M);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: esp32c3_dma_main
|
||||
*
|
||||
* Description:
|
||||
* ESP32-C3 DMA testing example.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_ESP32C3_DMA_M2M_TEST
|
||||
void esp32c3_dma_main(int argc, char *argv[])
|
||||
{
|
||||
int chan;
|
||||
struct esp32c3_dmadesc_s *rx_dmadesc;
|
||||
struct esp32c3_dmadesc_s *tx_dmadesc;
|
||||
uint8_t *rxbuf;
|
||||
uint8_t *txbuf;
|
||||
bool success = true;
|
||||
|
||||
const size_t bufsize = CONFIG_ESP32C3_DMA_M2M_TEST_BUFSIZE;
|
||||
#if (CONFIG_ESP32C3_DMA_M2M_TEST_BUFSIZE % ESP32C3_DMA_BUFLEN_MAX) > 0
|
||||
const size_t dmadesc_num = bufsize / ESP32C3_DMA_BUFLEN_MAX + 1;
|
||||
#else
|
||||
const size_t dmadesc_num = bufsize / ESP32C3_DMA_BUFLEN_MAX;
|
||||
#endif
|
||||
|
||||
syslog(LOG_INFO, "----- BEGIN TEST -----\n");
|
||||
|
||||
rxbuf = kmm_malloc(bufsize);
|
||||
if (rxbuf == NULL)
|
||||
{
|
||||
syslog(LOG_ERR, "Failed to malloc RX buffer\n");
|
||||
|
||||
success = false;
|
||||
goto test_end;
|
||||
}
|
||||
|
||||
txbuf = kmm_malloc(bufsize);
|
||||
if (txbuf == NULL)
|
||||
{
|
||||
syslog(LOG_ERR, "Failed to malloc TX buffer\n");
|
||||
kmm_free(rxbuf);
|
||||
|
||||
success = false;
|
||||
goto test_end;
|
||||
}
|
||||
|
||||
rx_dmadesc = kmm_malloc(sizeof(struct esp32c3_dmadesc_s) * dmadesc_num);
|
||||
if (rx_dmadesc == NULL)
|
||||
{
|
||||
syslog(LOG_ERR, "Failed to malloc RX DMA descriptor\n");
|
||||
kmm_free(txbuf);
|
||||
kmm_free(rxbuf);
|
||||
|
||||
success = false;
|
||||
goto test_end;
|
||||
}
|
||||
|
||||
tx_dmadesc = kmm_malloc(sizeof(struct esp32c3_dmadesc_s) * dmadesc_num);
|
||||
if (txbuf == NULL)
|
||||
{
|
||||
syslog(LOG_ERR, "Failed to malloc TX DMA descriptor\n");
|
||||
kmm_free(rx_dmadesc);
|
||||
kmm_free(txbuf);
|
||||
kmm_free(rxbuf);
|
||||
|
||||
success = false;
|
||||
goto test_end;
|
||||
}
|
||||
|
||||
esp32c3_dma_init();
|
||||
|
||||
chan = esp32c3_dma_request(ESP32C3_DMA_PERIPH_MEM, 1, 1, false);
|
||||
if (chan < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "Request DMA channel error\n");
|
||||
|
||||
success = false;
|
||||
goto test_end_cleanup;
|
||||
}
|
||||
|
||||
for (int i = 1; i <= CONFIG_ESP32C3_DMA_M2M_TEST_LOOPS; ++i)
|
||||
{
|
||||
const uint8_t watermark = i & UINT8_MAX;
|
||||
size_t j = 0;
|
||||
|
||||
/* Prepare buffers for DMA transfer */
|
||||
|
||||
memset(rxbuf, 0, bufsize);
|
||||
memset(txbuf, watermark, bufsize);
|
||||
|
||||
/* Setup DMA descriptors.
|
||||
* Intentionally ignore the last byte for TX.
|
||||
*/
|
||||
|
||||
esp32c3_dma_setup(chan, false, rx_dmadesc, dmadesc_num,
|
||||
rxbuf, bufsize);
|
||||
esp32c3_dma_setup(chan, true, tx_dmadesc, dmadesc_num,
|
||||
txbuf, bufsize - 1);
|
||||
|
||||
/* Start DMA transfer */
|
||||
|
||||
esp32c3_dma_enable(chan, false);
|
||||
esp32c3_dma_enable(chan, true);
|
||||
|
||||
/* Wait for DMA transfer to complete */
|
||||
|
||||
esp32c3_dma_wait_idle(chan, true);
|
||||
esp32c3_dma_wait_idle(chan, false);
|
||||
|
||||
/* Verify if last byte on RX buffer is unchanged */
|
||||
|
||||
if (rxbuf[bufsize - 1] != 0)
|
||||
{
|
||||
success = false;
|
||||
goto test_end_cleanup;
|
||||
}
|
||||
|
||||
/* Verify if RX buffer contains expected values */
|
||||
|
||||
for (j = 0; j < bufsize - 1; ++j)
|
||||
{
|
||||
if (rxbuf[j] != watermark)
|
||||
{
|
||||
syslog(LOG_ERR,
|
||||
"DMA-M2M-TEST loop %d fail buf[%zu]=%" PRIu8 "\n",
|
||||
i, j, rxbuf[j]);
|
||||
|
||||
success = false;
|
||||
goto test_end_cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
syslog(LOG_INFO, "DMA-M2M-TEST loop %d OK\n", i);
|
||||
}
|
||||
|
||||
test_end_cleanup:
|
||||
kmm_free(tx_dmadesc);
|
||||
kmm_free(rx_dmadesc);
|
||||
kmm_free(txbuf);
|
||||
kmm_free(rxbuf);
|
||||
|
||||
test_end:
|
||||
syslog(LOG_INFO, "----- END TEST -----\n");
|
||||
|
||||
syslog(LOG_INFO, "\n");
|
||||
|
||||
syslog(LOG_INFO, "----- RESULT: %s -----\n",
|
||||
success ? "SUCCESS" : "FAILED");
|
||||
}
|
||||
#endif
|
||||
|
@ -1,31 +0,0 @@
|
||||
#
|
||||
# This file is autogenerated: PLEASE DO NOT EDIT IT.
|
||||
#
|
||||
# You can use "make menuconfig" to make any modifications to the installed .config file.
|
||||
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
|
||||
# modifications.
|
||||
#
|
||||
CONFIG_ARCH="risc-v"
|
||||
CONFIG_ARCH_BOARD="esp32c3-devkit"
|
||||
CONFIG_ARCH_BOARD_ESP32C3_DEVKIT=y
|
||||
CONFIG_ARCH_CHIP="esp32c3"
|
||||
CONFIG_ARCH_CHIP_ESP32C3=y
|
||||
CONFIG_ARCH_CHIP_ESP32C3WROOM02=y
|
||||
CONFIG_ARCH_INTERRUPTSTACK=1536
|
||||
CONFIG_ARCH_RISCV=y
|
||||
CONFIG_ARCH_STACKDUMP=y
|
||||
CONFIG_BOARD_LOOPSPERMSEC=15000
|
||||
CONFIG_BUILTIN=y
|
||||
CONFIG_ESP32C3_DMA=y
|
||||
CONFIG_ESP32C3_DMA_M2M_TEST=y
|
||||
CONFIG_IDLETHREAD_STACKSIZE=2048
|
||||
CONFIG_INTELHEX_BINARY=y
|
||||
CONFIG_LIBC_PERROR_STDOUT=y
|
||||
CONFIG_LIBC_STRERROR=y
|
||||
CONFIG_PREALLOC_TIMERS=0
|
||||
CONFIG_RAW_BINARY=y
|
||||
CONFIG_START_DAY=29
|
||||
CONFIG_START_MONTH=11
|
||||
CONFIG_START_YEAR=2019
|
||||
CONFIG_UART0_SERIAL_CONSOLE=y
|
||||
CONFIG_USER_ENTRYPOINT="esp32c3_dma_main"
|
Loading…
Reference in New Issue
Block a user