The Godfather talking
You think I am funny guy huh?
Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 04, 2016, 02:53:37 02:53


Login with username, password and session length


Pages: [1]
Print
Author Topic: ST eeprom simulation weird memory footprint.  (Read 910 times)
0 Members and 1 Guest are viewing this topic.
dotm
Active Member
***
Offline Offline

Posts: 149

Thank You
-Given: 61
-Receive: 47


C15H15NO2S


« on: May 31, 2014, 01:38:55 01:38 »

I simply refuse to understand this, maybe someone can enlight me:
When I read AN4056 (http://www.st.com/st-web-ui/static/active/en/resource/technical/document/application_note/DM00049071.pdf) it says:
Quote
Memory footprint for EEPROM emulation mechanism
Minimum(1) required code size (bytes)
Flash: 2260
SRAM: 2074
(1) Based on one 32-bit variable (16-bit for address and 16-bit for data). The SRAM memory used increases
depending on the number of variables used.
Well then look at the code attached. It's the driver. Where the  Lips sealed are the 2k RAM used?
I even thought that maybe the Flash functions have compiler directives to be loaded to the ram, but: no.
This is driving me NUTS!  Tongue Shocked
« Last Edit: May 31, 2014, 01:47:54 01:47 by dotm » Logged
sn00p
Newbie
*
Offline Offline

Posts: 15

Thank You
-Given: 0
-Receive: 1


« Reply #1 on: June 01, 2014, 10:46:29 10:46 »

A quick read of the data sheet indicates that it has a mode where you store "variables" in flash, I and sync them between ram and flash with a flush call.  It looks like its all caching.
Logged
bobcat1
Active Member
***
Offline Offline

Posts: 151

Thank You
-Given: 1117
-Receive: 29


« Reply #2 on: June 01, 2014, 10:47:42 10:47 »

Hi

Flash memory can only written in block's (depend on processor word size)
There for you need at lest twice the size of the lowest block size to emulate eeprom on flash

All the best

Bobi
Logged
dotm
Active Member
***
Offline Offline

Posts: 149

Thank You
-Given: 61
-Receive: 47


C15H15NO2S


« Reply #3 on: June 01, 2014, 10:20:55 22:20 »

Flash memory can only written in block's (depend on processor word size)
There for you need at lest twice the size of the lowest block size to emulate eeprom on flash

Do you mean Pages? If yes, this driver uses two pages to continouusly transfer from one to another.
My question was: where at the code (for the driver) is the SRAM used with such a huge amount
Logged
Ichan
Hero Member
*****
Offline Offline

Posts: 840

Thank You
-Given: 312
-Receive: 387



WWW
« Reply #4 on: June 03, 2014, 12:05:44 00:05 »

My question was: where at the code (for the driver) is the SRAM used with such a huge amount

I am just guessing, it can be on the flash access routine - i think the eeprom driver calling it.

Have you compile the code? Is the compiler confirm that 2K RAM requirement?

Yeah no internal eeprom can be a pain, i choose to use external eeprom / fram - remember that writing the flash will stall the MCU, no interrupt can be catch on that time.

-ichan
Logged

There is Gray, not only Black or White.
dotm
Active Member
***
Offline Offline

Posts: 149

Thank You
-Given: 61
-Receive: 47


C15H15NO2S


« Reply #5 on: June 03, 2014, 03:06:50 03:06 »

I am just guessing, it can be on the flash access routine - i think the eeprom driver calling it.

Have you compile the code? Is the compiler confirm that 2K RAM requirement?

See attached file. have not found the RAM usage in this driver neither. I want to avoid any further ram usage that's why I hesitated using the eeprom driver yet.
As far as I can see this code will not use any more RAM than the stack.


« Last Edit: June 03, 2014, 03:11:32 03:11 by dotm » Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC