Author Topic: Cortex M7 and DMA  (Read 8550 times)

0 Members and 1 Guest are viewing this topic.

Offline mac.6

  • Regular Contributor
  • *
  • Posts: 225
  • Country: fr
Re: Cortex M7 and DMA
« Reply #25 on: May 28, 2018, 07:35:01 am »
For i.MX RT, download the SDK from NXP, you have drivers examples for edma/dmamanager and interraction between DMA and other peripheral.
I do not expect RT1020 to be different from RT1050 dma wise.
 

Offline hans

  • Super Contributor
  • ***
  • Posts: 1638
  • Country: nl
Re: Cortex M7 and DMA
« Reply #26 on: May 28, 2018, 07:58:14 am »

Hello hans.

What documentation did you use to learn how to configure the DMA in each microcontroller, the Reference Manual, Source Code examples ...?

My only current good documentation is the book MASTERING STM32 for the STM32, for the Kinetis I only have some Teensy sources, and for Atmel SAM S70 I can not find anything.

I hope to have more luck with the NXP RT1020 using MCUExpresso, which are about to go on sale. At least for June the data sheet should be available, and for June or July the chip.

Best Regards

As said, if you know what you're doing then the documentation provided by the manufacturer should be enough.
If not sufficient I rather look at fellow projects source code (github) than lookup books.

The rest is just experience and hard work, like I cannot tell how to transfer that :-//

 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 8172
  • Country: fi
Re: Cortex M7 and DMA
« Reply #27 on: May 28, 2018, 08:24:17 am »
What documentation did you use to learn how to configure the DMA in each microcontroller, the Reference Manual, Source Code examples ...?

My only current good documentation is the book MASTERING STM32 for the STM32, for the Kinetis I only have some Teensy sources, and for Atmel SAM S70 I can not find anything.

While instructional books and tutorials are extremely useful in learning, they are not any kind of documentation. While you can work with the product documentation alone, you cannot work with the tutorials/books alone.

In fact, I have found that the actual documentation is often all I need. Not saying you shouldn't read books and tutorials as well, but I'm very surprised you have managed to do anything without even looking at the official manufacturer documentation.

The documentation in most modern ARM microcontroller often consists of this combination of documents:
- The datasheet
- The reference manual - this basically explains almost everything. You don't have to read everything, it's a long document. You want to use DMA - read the DMA section.
- Sometimes other documents, such as programming manual, flash programming manual, application notes, etc...
- Errata sheet. Glimpse through it to see if there is something that affects you.
- Manual for the ARM core itself - not needed too often, since the compiler can handle most of the things for you transparently. I looked at it the first time only after many years of fairly complex projects!

You download these documents from your particular chip's home page. (For the ARM core reference manual, that'll be from the ARM's website, instead.)

Basic tutorials help you to better understand how to utilize the reference manual, for example, if you lack experience in the C syntax.

Otherwise, it's fairly simple for well-designed peripherals. Want to use ADC? Look up the ADC section, read how it works to understand their terminology (i.e., so you know what you can actually do with it, and to understand what you actually want to do, in their terms), then look the register section and write whatever configuration you need to use.

For poorly designed peripherals, you just need to stick to the reference manual even closer, and try things out for any undocumented hidden features or bugs, or things working differently from documentation. Unfortunately, MCU vendors don't tend to fix broken documentation to match actual behavior, or even update their errata. I guess a 100-page errata would be too shameful, so they just list 5-10% of errors to make it look like they are responsible by having an errata sheet.

Now, with these "poorly designed peripherals", having a tutorial would be great. Often, they don't exist for these cases.

Sadly, many tutorials focus on doing utterly trivial basic tasks in the most difficult way imaginable. Think about bloating a simple LED blinking oneliner into 100 lines of code! Unfortunately, especially in the STM32 scene, I have seen the tendency to code by copypasting huge snippets of bloated code, utilizing the broken and unusable official libraries (which no one can write code for "by hand", so copypasting or autogeneration are the only options), instead of doing the thing just normally/traditionally (often writing one or two registers in a clear and simple way in two lines of code). When you simply follow the reference manual and don't look at the many tutorials, you avoid this issue completely.

But, the DMA should be fairly simple and unsurprising.
« Last Edit: May 28, 2018, 08:27:31 am by Siwastaja »
 

Offline luiHSTopic starter

  • Frequent Contributor
  • **
  • Posts: 592
  • Country: es
Re: Cortex M7 and DMA
« Reply #28 on: May 31, 2018, 04:54:53 am »
For i.MX RT, download the SDK from NXP, you have drivers examples for edma/dmamanager and interraction between DMA and other peripheral.
I do not expect RT1020 to be different from RT1050 dma wise.

Ok, thanks.
I have download Reference Manual and SDK from NXP web site.

In SDK I found some examples for eDMA, memory to memory and eDMA lspi (master and slave).
I need one for SPI to receive data, and one for input/output for GPIO. I assume that memory to memory allows reading and writing from/to GPIO and lpspi is SPI port.

I also see Flexspi, I still do not know the differences between Flexspi and Lpspi, I'll try everything with my evaluation board for the RT1050.

As my idea is to migrate my Cortex M4 Kinetis MK66 developments to a Cortex M7, I will opt for the RT1020 and I no longer look at the DMA in other microcontrollers (STM32, Atmel SAM, Kinetis).

According to NXP, RT1020 will be available on June 26, Data sheet, samples, evaluation board. I will develop my own board and order the evaluation board, all with TQFP100 400Mhz / 500Mhz.

I also hope that MCUXpresso with the Configuration Tools is as good as ST with Cubemx. With STM32 and Cubemx, I save a lot of time with the source code, I select a peripheral and Cubemx adds all the functions to the source code, so I just need to look for those functions to find an example program immediately.
« Last Edit: May 31, 2018, 05:13:45 am by luiHS »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf