Jul 19, 2015
08:52 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 19, 2015
08:52 PM
Hello.
Anyone who have experienced about xmc4500 flash programming help me please.
I need to store some data at non-volatile area.
I added the code from XMClib Flash-progam example but the software has a problem.
XMC_FLASH_EraseSector(XMC_FLASH_SECTOR_11); -------- // 1
XMC_FLASH_ProgramPage(XMC_FLASH_SECTOR_11, idata); -------- // 2
ptr_data = XMC_FLASH_SECTOR_11; --------// 3
for (count = 0; count < XMC_FLASH_WORDS_PER_PAGE; ++count) { --------// 4
odata[count] = *ptr_data; --------- // 5
++ptr_data; ----------// 6
}
Address of XMC_FLASH_SECTOR_11 is 0x0C0C0000
When software is executed with above 6 line, there are written data in SECTOR11 memory.
Remove above line 1(erase) and 2(program) and after power OFF/ON SECTOR11 data are changed to '0'.
It seem that the written data don't retain.
Please help me what should I do.
Anyone who have experienced about xmc4500 flash programming help me please.
I need to store some data at non-volatile area.
I added the code from XMClib Flash-progam example but the software has a problem.
XMC_FLASH_EraseSector(XMC_FLASH_SECTOR_11); -------- // 1
XMC_FLASH_ProgramPage(XMC_FLASH_SECTOR_11, idata); -------- // 2
ptr_data = XMC_FLASH_SECTOR_11; --------// 3
for (count = 0; count < XMC_FLASH_WORDS_PER_PAGE; ++count) { --------// 4
odata[count] = *ptr_data; --------- // 5
++ptr_data; ----------// 6
}
Address of XMC_FLASH_SECTOR_11 is 0x0C0C0000
When software is executed with above 6 line, there are written data in SECTOR11 memory.
Remove above line 1(erase) and 2(program) and after power OFF/ON SECTOR11 data are changed to '0'.
It seem that the written data don't retain.
Please help me what should I do.
4 Replies
Attachments are accessible only for community members.
Jul 22, 2015
02:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 22, 2015
02:59 AM
Hi,
I am not sure what is wrong with your code maybe you can give my flash programming code (see ZIP attachment) a try.
Example flash programming ...
I am not sure what is wrong with your code maybe you can give my flash programming code (see ZIP attachment) a try.
Example flash programming ...
if (FLASH_If_Write(&FlashWriteAddress, (u32*)(LeftBytesTab),1))
{
//Flash program error ...
LED_OFF(); // off led to indicate program error
}
Jul 22, 2015
09:01 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 22, 2015
09:01 PM
Hello Travis.
Thank you for your reply.
Attached your sample code save data into flash well.
But it seems that address offset doesn't match my data type.
I want to save below data at PFLASH sector 11(0x0C0C00000).
{0x9600A8, 0x00FFFFFF, 0x0000000A, 0x02FAF8CB}
How should I correct your sample code please?
Best regards.
Thank you for your reply.
Attached your sample code save data into flash well.
But it seems that address offset doesn't match my data type.
I want to save below data at PFLASH sector 11(0x0C0C00000).
{0x9600A8, 0x00FFFFFF, 0x0000000A, 0x02FAF8CB}
How should I correct your sample code please?
Best regards.
Attachments are accessible only for community members.
Jul 23, 2015
08:14 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 23, 2015
08:14 PM
Hi,
Flash programming is done in a page size, so remaining unused buffer is best to fill them with zeros. Attached is an example which is able to write your mentioned data to sector 11. All you need to do is to set the variable "keypress = 0xAA" while the software is running.
Flash programming is done in a page size, so remaining unused buffer is best to fill them with zeros. Attached is an example which is able to write your mentioned data to sector 11. All you need to do is to set the variable "keypress = 0xAA" while the software is running.
Jul 24, 2015
01:21 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 24, 2015
01:21 AM
Hi Travis.
I finished flash programming by your help.
Thank you very much.
I finished flash programming by your help.
Thank you very much.