Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NXP: tests/drivers/dma/loop_transfer fails on FRDM-K64F #26812

Closed
henrikbrixandersen opened this issue Jul 11, 2020 · 2 comments · Fixed by #26964
Closed

NXP: tests/drivers/dma/loop_transfer fails on FRDM-K64F #26812

henrikbrixandersen opened this issue Jul 11, 2020 · 2 comments · Fixed by #26964
Assignees
Labels
area: DMA Direct Memory Access area: Tests Issues related to a particular existing or missing test bug The issue is a bug, or the PR is fixing a bug platform: NXP NXP

Comments

@henrikbrixandersen
Copy link
Member

henrikbrixandersen commented Jul 11, 2020

Describe the bug

The tests/drivers/dma/loop_transfer test case fails on the NXP FRDM-K64F. Not all DMA RX buffers contain the DMA TX buffer string.

To Reproduce
Steps to reproduce the behavior:

  1. cd tests/drivers/dma/loop_transfer; mkdir build; cd build
  2. cmake -DBOARD=frdm_k64f
  3. make flash
  4. See the following output on the board console:
*** Booting Zephyr OS build zephyr-v2.3.0-898-g668e359d8558  ***
DMA memory to memory transfer started on DMA_0
Preparing DMA Controller
Starting the transfer and waiting for 1 second
TX data: The quick brown fox jumps over the lazy dog ....
block_size 48
I: channel 0 error status is 0x2
ERROR: unfinished transfer
Each RX buffer should contain the full TX buffer string.
TX data: The quick brown fox jumps over the lazy dog ....
RX data Loop 0: The quick brown fox jumps over the lazy dog ....
RX data Loop 1: The quick brown fox jups
RX data Loop 2: 
RX data Loop 3: 
RX data Loop 4: 
Finished: DMA

Expected behavior
All RX buffers contain the TX buffer content.

Impact
Not sure if the EDMA driver works correctly. The tests/drivers/dma/chan_blen_transfer test case passes, so something is working...

Environment (please complete the following information):

  • OS: Linux
  • Toolchain Zephyr SDK
  • Commit SHA: 668e359

Additional context
I found the issue while enabling the eDMA driver on the NXP KE1xF SoC (see #26813).

@henrikbrixandersen henrikbrixandersen added bug The issue is a bug, or the PR is fixing a bug area: DMA Direct Memory Access platform: NXP NXP labels Jul 11, 2020
@MaureenHelm MaureenHelm assigned hakehuang and unassigned MaureenHelm Jul 13, 2020
@hakehuang
Copy link
Collaborator

hakehuang commented Jul 14, 2020

@henrikbrixandersen this is a racing condtion which cause the dma access flash which will cause error on dma src, and it is not happened always, but with high possibilities. so the solution is to change the test cases dma.c as below:

#else
/* pad to times of 8*/
- static const char tx_data[] =
+ static char tx_data[] = 
	"The quick brown fox jumps over the lazy dog ....";
static __aligned(16) char rx_data[TRANSFER_LOOPS][RX_BUFF_SIZE] = { { 0 } };
#endif

or you can try my commit below:
hakehuang@f805872

let me know if this fixes your problem, I can create a pull request to for this fix

@hakehuang hakehuang pinned this issue Jul 14, 2020
@hakehuang hakehuang added the area: Tests Issues related to a particular existing or missing test label Jul 14, 2020
@stephanosio stephanosio unpinned this issue Jul 14, 2020
@henrikbrixandersen
Copy link
Member Author

@hakehuang Thank you. I can confirm that your commit mentioned above fixes the race condition.

hakehuang added a commit that referenced this issue Jul 20, 2020
avoid to use the flash address as dma source,
to avoid flash cachce issue
this is fix to issue #26812

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
hakehuang added a commit to hakehuang/zephyr that referenced this issue Jul 20, 2020
avoid to use the flash address as dma source,
to avoid flash cache issue
this is fix to issue zephyrproject-rtos#26812

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
MaureenHelm pushed a commit that referenced this issue Jul 20, 2020
avoid to use the flash address as dma source,
to avoid flash cache issue
this is fix to issue #26812

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: DMA Direct Memory Access area: Tests Issues related to a particular existing or missing test bug The issue is a bug, or the PR is fixing a bug platform: NXP NXP
Projects
None yet
3 participants