Part Number: CC2340R5
Hi,
When i do a stress test in external flash with read/write, i had encountered an SPI DMA transfer issue.
The test flow as below:
while (1) {
//adc check vbat and thermistor
//ble scan(work as observer) and store to flash
//sleep 10s
}
During store to flash, functions call as below:
NVS_write() with flag NVS_WRITE_PRE_VERIFY -> NVSSPI25X_write() -> doWriteVerify() -> doRead() -> extFlashSpiRead() -> SPI_transfer() -> SPILPF3DMA_transfer()
Since the SPILPF3DMA_hwAttrs.minDmaTransferSize = 10 and doRead() will read 256 bytes, so it it will use DMA for transfer.
When the issue occurs, MCU send SPI read command but it didn't create any CLK of SPI to read data from external flash, as below:
(sorry i don't unknow why i cannot uplaod the picture here, maybe i can try to uplaod it on the commet)
And we try to debug it, we found that, when this issue occurs, it also run to function primeTransfer() and execute below codes, but no any CLK of SPI happen:
if (!object->manualStart)
{
enableSPI(handle);
/* Enable DMA to generate interrupt on SPI peripheral */
enableDMA(hwAttrs->baseAddr, SPI_DMACR_TXEN | SPI_DMACR_RXEN);
UDMALPF3_channelEnable(hwAttrs->rxChannelBitMask | hwAttrs->txChannelBitMask);
}
More information:
1. We use SDK simplelink_lowpower_f3_sdk_8_40_02_01
2. When the issue occurs, the SPI send in polling work well, but send in DMA alway fail
3. When debuging in fail case, after executed enableDMA(hwAttrs->baseAddr, SPI_DMACR_TXEN | SPI_DMACR_RXEN); the register REQDONE of DMA is 0x00000000, but in normal case, it will be 0x00000001. I am not sure if this infromation will be helpful for or not.
Please help to check it, we appreciate any freeback from you.
BR,
Edwin