cancel
Showing results for 
Search instead for 
Did you mean: 

stm32f070 low power mode flash programming and DMA

Md Mubdiul Hasan
Associate III
Posted on October 25, 2016 at 08:18

Dear All,

I am new in stm32 world.

The device I am going to make, its on low power mode.

As far as I know from STM32F070xB /STM32F070x6 datasheet, it has 128KB flash memory.

Now my question is

1.can the DMA request access flash memory ?

2. Should I need to make flash code by HAL FLASH                             Generic Driver/FLASH Firmware driver API?

3. DMA is necessary ?

                        
6 REPLIES 6
Walid FTITI_O
Senior II
Posted on October 25, 2016 at 12:26

Hi hasan.md_mubdiul, 

First, the main information can be found in the STM32F0 reference manual RM0360.

As a brief response : 

[1+2]:

''DMA Access to Flash, SRAM, APB and AHB peripherals as source and destination''

DMA should be used in sleep mode to do memory/peripheral transfer when CPU is OFF.

In run mode , DMA can be used to save CPU load or let it do other operation. ITs use optimize the overall performance and flexibility.

[3]: Yes the driver is created for that purpose. I recommend to check and run one of the Flash example in the STM32CubeF0.

-Hannibal-

Md Mubdiul Hasan
Associate III
Posted on October 26, 2016 at 02:35

Dear Sir Hannibal,

Thank you for posting here.

You have described nicely.

Does it mean, such low power mode application I need to make Flash code also?

I am using DMA for SPI application here. Previously in this project people did not use DMA.

Let me know more about suitability about using DMA.

Regards

Hasan

Walid FTITI_O
Senior II
Posted on October 26, 2016 at 12:55

Hi 

hasan.md_mubdiul, 

There is dedicated document to learn such feature and go in deep description. After the reference manual of device , II recommend the application note 

http://www.st.com/content/ccc/resource/technical/document/application_note/27/46/7c/ea/2d/91/40/a9/DM00046011.pdf/files/DM00046011.pdf/jcr:content/translations/en.DM00046011.pdf

-Hannibal-

Posted on October 26, 2016 at 18:04

Let me know more about suitability about using DMA.

It will depend hugely on your implementation and goals. DMA can help significantly decimate interrupt loading, and pulling the device in/out of sleep mode, ie WFI idle loop. It will work well for large and continuous streams of data. When you are only using half-a-dozen bytes, the overhead of programing and managing DMA might outweigh the benefits.

This is something you'll have to own as a developer, and with insight into your own system architecture and design constraints.

Why the F0 device over an L0 one?

Running code out of RAM instead of FLASH may result in power/speed benefits.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Md Mubdiul Hasan
Associate III
Posted on November 02, 2016 at 02:52

Dear Sir Clive,

Thank you very much for your kind explanation!!

Things are seems that, for my temperature sensor small data, I dont need to use DMA.

 Someone who make this code he uses, Flash code in this application.

Right now the problem is, I have to moderate this code in accordance of SPI without DMA, may be in other way with keep in mind state files are not changeable.

Problem is also for compiling in suitable IDE,  compiler, and project properties.

Some time HAL library cant recognize by compiler.

In case of 

Ac6 System Workbench for STM32( asking help to forum)

The error is arm-none-eabi-gcc: fatal error: no input files

compilation terminated.

Do you want me to use Keli?

Regards

Hasan 

Md Mubdiul Hasan
Associate III
Posted on November 22, 2016 at 09:17

Dear Sir Clive1,

Having such experience on Flash, 

Could you tell me how you use your flash in KEIL?

I mean how the flash code have to make ? With the example of STM32Cube_FW_F0_V1.6.0?

Instead of it, what you did?

Regards

Hasan