Quantcast
Channel: Forum - Recent Threads
Viewing all articles
Browse latest Browse all 5781

S7G2 Internal Data Memory

$
0
0

Currently I am using S7G2's Internal Data Memory for storing application related settings and it works fine.

SSP v1.1.3

 

They way it writes now is each Data Block is 64 bytes long, so even if I want to write/update a 1 byte variable (or) a 2 byte variable in data memory using write API as shown below - is that the right way?

#define DF_BLOCK_0       0x40100000

#define DF_BLOCK_1       0x40100040

uint8_t temp = 0x20;

ssp_err = g_flash0.p_api->erase(g_flash0.p_ctrl, DF_BLOCK_0, 1); //1 sector = 64bytes

ssp_err = g_flash0.p_api->write(g_flash0.p_ctrl, temp, DF_BLOCK_0, 64);  //trying to write 64 bytes using 1 byte variable

 

I would like to do something like this for just updating/writing 1 byte variable - is this even possible?

ssp_err = g_flash0.p_api->write(g_flash0.p_ctrl, temp, DF_BLOCK_0, 1); //trying to write 1 byte using 1 byte variable

 

If I change the definition of each Data block from 64 bytes long to just 1 or 2 bytes long and use the below call would that work?

#define DF_BLOCK_0       0x40100000

#define DF_BLOCK_1       0x40100001

uint8_t temp = 0x20;

ssp_err = g_flash0.p_api->write(g_flash0.p_ctrl, temp, DF_BLOCK_0, 1);  //write 1 byte into memory

 

Instead of a block(64 bytes) write, Is there a way to write just 1 byte (or) 2 bytes or (or) 4 bytes using the write API?

Because if there is only one value updated inside a structure , I don't want to update the entire structure into memory again. 

 

Regards,

Sam


Viewing all articles
Browse latest Browse all 5781

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>