Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
March 19, 2024, 10:08:55 10:08


Login with username, password and session length


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

Posts: 179

Thank You
-Given: 81
-Receive: 75


$$$


« on: May 31, 2014, 12:38:55 00: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, 12:47:54 00:47 by dotm » Logged
sn00p
Newbie
*
Offline Offline

Posts: 15

Thank You
-Given: 0
-Receive: 1


« Reply #1 on: June 01, 2014, 09:46:29 09: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
Senior Member
****
Offline Offline

Posts: 295

Thank You
-Given: 4131
-Receive: 89


« Reply #2 on: June 01, 2014, 09:47:42 09: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: 179

Thank You
-Given: 81
-Receive: 75


$$$


« Reply #3 on: June 01, 2014, 09:20:55 21: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: 833

Thank You
-Given: 312
-Receive: 392



WWW
« Reply #4 on: June 02, 2014, 11:05:44 23: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: 179

Thank You
-Given: 81
-Receive: 75


$$$


« Reply #5 on: June 03, 2014, 02:06:50 02: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, 02:11:32 02: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