cancel
Showing results for 
Search instead for 
Did you mean: 

Using Data flash

ssk
Associate II
Posted on February 18, 2015 at 12:25

Hello Members,

I am using SPC560D030 for my product. I want to use the Data flash to store the device configuration i.e. I want to use Data flash as NVM. The configuration data is of 120 bytes. I tried reading the reference manual (CD00259063.pdf) on using the Data flash as NVM but may be I am unable to understand on reading/writing to Data flash. I don't find any APIs for it. How can I use the 'DFLASH' for reading or writing? Any example code or document reference will be helpful.

Thanks in advance for any help.

Mike.

#dflash #dataflash #dataflash #orhan-y?lmaz #data-flash
16 REPLIES 16
Posted on February 23, 2015 at 10:07

Hi,

Attached there is some -unofficial- code I wrote.

Giovanni

________________

Attachments :

source.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0S2&d=%2Fa%2F0X0000000bZ7%2FWNu1EFPKCggfY50dV8Iy8ETURWSJnyeuhc6dAGTCuwU&asPdf=false
ssk
Associate II
Posted on February 24, 2015 at 12:01

Thanks Giovanni. I shall update you when I make use of this code.

Thanks.

Mike.
ssk
Associate II
Posted on March 10, 2015 at 13:45

HelloGiovanni,

I tried using the code for reading/writing to data flash. I used discovery kit SPC560D-DIS and used the code provided. I have not succeeded writing any data and hence unable to read anything. It gives an error as 'CallFrame, unable to read register R1' and the execution stops.

Even I tried to write few bytes using the UDE Visual platform but there also it failed to write. Please see attached log for the same.

Please clarify the issue. Thanks.

Mike.

________________

Attachments :

DFlash_10Mar15.log : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0My&d=%2Fa%2F0X0000000bZ8%2FinIR4DuKq6lRjJX7xDZZM0jmPJNSNpmyPlrCWBkFgxE&asPdf=false
ssk
Associate II
Posted on March 16, 2015 at 16:00

Hello Giovanni,

I tried using the code for reading/writing to data flash. I used discovery kit SPC560D-DIS and used the code provided. I have not succeeded writing any data and hence unable to read anything. It gives an error as 'CallFrame, unable to read register R1' and the execution stops.

Even I tried to write few bytes using the UDE Visual platform but there also it failed to write. Please see attached log from the previous post for it.

Please clarify the issue. Thanks.

Mike.

ssk
Associate II
Posted on March 24, 2015 at 15:56

Has anyone worked with Data Flash for SPC560D? I am unable to write to it using UDE interface. Can anyone explain on using Data Flash?

Thanks in advance.

Mike.

nooshin_1382
Associate II
Posted on March 28, 2015 at 14:15

Hi Mike

I use the Giovanni code and it is ok on SPC560B50L5 and  i see the writed data on UDE Memory View .

orhanyilmaz
Associate II
Posted on April 27, 2015 at 11:21

Hello Vanima,

I'm not using data flash. (my test addr: 0x00800000 and 0x00804000)

What use the data flash address for test?

Thanks.

Erwan YVIN
ST Employee
Posted on April 29, 2015 at 13:34

Hello Orhan & Mike,

There is no issue on Giovanni's source code. it is working well 😉 0x800000 is mapped on DFLASH.

spc5_dflash_init();
spc5_dflash_write_word(0x0,0x55555555);
spc5_dflash_write_word(0x4,0x55555555);

Check on UDE ((*(uint32_t *)0x800000)) you will see the value. Anyway, SPC560Bxx OS-Less Flash Integration Test Application test is available in SPC5Studio Appwizard. Best regards Erwan
orhanyilmaz
Associate II
Posted on April 29, 2015 at 15:38

Hello Erwan,

Your test addr(0x0 and 0x4) is not mapped DFLASH. It is mapped Code FLASH. (CFLASH)

I checked but not change.

Thanks.