Skip to content

Conversation

@avisconti
Copy link
Contributor

@avisconti avisconti commented Jun 27, 2018

(FIX for STM32 DMA)
I noticed that the STM32 DMA is not used much inside zephyr, expecially the memory-to-peripheral and peripherl-to-memory part. I'm currently implementing the stm32-i2s driver and I'm using the DMA for that purpose. My intention is to use it also inside SPI driver and maybe others.

@avisconti avisconti requested a review from erwango as a code owner June 27, 2018 09:14
@codecov-io
Copy link

codecov-io commented Jun 27, 2018

Codecov Report

Merging #8579 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #8579   +/-   ##
=======================================
  Coverage   64.17%   64.17%           
=======================================
  Files         429      429           
  Lines       41157    41157           
  Branches     6925     6925           
=======================================
  Hits        26413    26413           
  Misses      11587    11587           
  Partials     3157     3157

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 19d7803...8b8d8ba. Read the comment docs.

@SebastianBoe
Copy link
Contributor

recheck

@avisconti
Copy link
Contributor Author

@SebastianBoe
same (or similar) error

@galak galak added area: DMA Direct Memory Access platform: STM32 ST Micro STM32 labels Jun 27, 2018
The Transfer Complete (TC) interrupt as well as the Memory
Increment (MINC) bits were not enabled for Periperal To
Memory (and Memory to Peripheral) case.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
The DMA API provides dma_slot field as a method to configure at
runtime which peripheral DMA_request the DMA controller should
select.

This method allows to specify different selections for different stm32
DMA streams. So, all the Kconfig definitions, which by the way where
fixing the same selection for all DMA streams, have been deleted.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
@avisconti
Copy link
Contributor Author

Ok, sanitycheck is passed and bug has been closed. If it happens again I will re-open it.

@avisconti
Copy link
Contributor Author

@erwango
Pls add who else is needed for the review of this part. I noticed that Lee Jones (Linaro) has done some work in the past on stm32 DMA.

Copy link
Member

@erwango erwango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Can you confirm that tests/drivers/dma is still 'passed' with this change?
(requires to change DMA_DEVICE_NAME to "DMA_2")

@avisconti
Copy link
Contributor Author

LGTM, Can you confirm that tests/drivers/dma is still 'passed' with this change?
(requires to change DMA_DEVICE_NAME to "DMA_2")

Actually I don't know. How can I check it?
I have to improve my knowledge on the Continuos Integration (CI) system technology.

@erwango
Copy link
Member

erwango commented Jul 2, 2018

@avisconti :
Test is not in CI, You have to run the test manually
Go in tests/drivers/dma/loop_transfer
Make the change to "DMA_2"
Build vs a target supporting dma, then flash and run the test, and you will have the verdict.

Then (if you're interested), maybe would be worth to get some STM32 targets running this test in CI, btw...

@avisconti
Copy link
Contributor Author

@erwango

Test is not in CI, You have to run the test manually

OK, got it.

Go in tests/drivers/dma/loop_transfer
Make the change to "DMA_2"
Build vs a target supporting dma, then flash and run the test, and you will have the verdict.

I had also to add in prj.conf the following
CONFIG_DMA_STM32F4X=y

After that I launched the test on my ArgonKey and it worked:

***** Booting Zephyr OS v1.12.0-453-g286bd85 *****
DMA memory to memory transfer started on DMA_2
Preparing DMA Controller
Starting the transfer and waiting for 1 second
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 jumps over the lazy dog
RX data Loop 2: The quick brown fox jumps over the lazy dog
RX data Loop 3: The quick brown fox jumps over the lazy dog
RX data Loop 4: The quick brown fox jumps over the lazy dog
Finished: DMA

@avisconti
Copy link
Contributor Author

avisconti commented Jul 2, 2018

@erwango
Pls note that the DMA loop transfer test does only memory to memory transfers, while my modifications are more concerned with mem-to-periph and periph-to-mem. But it is good to see that my commits didn't break the functionality.

To really test the commits I used the I2S driver I'm writing and tested it on ArgonKey. I tested it in both directions using I2S RX (from Microphone) and I2S TX on 96 board connector watching the transactions with a scope.

@avisconti
Copy link
Contributor Author

@erwango
Is this patch fine for you then? As you see above the dma test pass as expected.

@galak galak merged commit b29daba into zephyrproject-rtos:master Jul 5, 2018
@avisconti avisconti deleted the dma-stm32-fix branch July 6, 2018 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: DMA Direct Memory Access platform: STM32 ST Micro STM32

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants