Not applicable
Oct 30, 2013
07:22 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oct 30, 2013
07:22 AM
Hallo,
I'm trying to erase flash memory by using FASH002-App, but I get a sequence error SQER on a XMC4500 MCU. It seems that the compiler optimizes away the first line in "Flash002_EraseSector" as the same adress is accessed twice:
Using a volatile in M32 macro helps. But of course, this change is lost if I run the code generator again. How can I use the function without a SQER?
Thanks
I'm trying to erase flash memory by using FASH002-App, but I get a sequence error SQER on a XMC4500 MCU. It seems that the compiler optimizes away the first line in "Flash002_EraseSector" as the same adress is accessed twice:
/* Clear the flash status register */
M32(FLASH002_UNCACHED_BASE + 0x5554U)=0x000000F5U;
/* Erase sequence */
M32(FLASH002_UNCACHED_BASE + 0x5554U)=0x000000AAU;
M32(FLASH002_UNCACHED_BASE + 0xAAA8U)=0x00000055U;
M32(FLASH002_UNCACHED_BASE + 0x5554U)=0x00000080U;
M32(FLASH002_UNCACHED_BASE + 0x5554U)=0x000000AAU;
M32(FLASH002_UNCACHED_BASE + 0xAAA8U)=0x00000055U;
M32(Address)=0x00000030U;
Using a volatile in M32 macro helps. But of course, this change is lost if I run the code generator again. How can I use the function without a SQER?
Thanks
- Tags:
- IFX
2 Replies
Oct 31, 2013
11:47 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oct 31, 2013
11:47 PM
endres wrote:
Hallo,
I'm trying to erase flash memory by using FASH002-App, but I get a sequence error SQER on a XMC4500 MCU. It seems that the compiler optimizes away the first line in "Flash002_EraseSector" as the same adress is accessed twice:
Using a volatile in M32 macro helps. But of course, this change is lost if I run the code generator again. How can I use the function without a SQER?
Thanks
Can you please use the "Flash002_EraseSector"?
#include
int main(void)
{
uint32_t status;
uint32_t StartAddr = FLASH002_SECTOR7_BASE;
// Initialize
DAVE_Init(); // FLASH002_Init() will be called within DAVE_Init()
status = Flash002_EraseSector(StartAddr);
while(1)
{
}
}
Not applicable
Nov 03, 2013
11:35 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 03, 2013
11:35 PM
Hi,
I'm using "Flash002_EraseSector". The code is extracted out of this function. I forgot to mention that. I also tried this example before. Same problem there. Stepping over the last line "M32(Address)=0x00000030U;" rises a SQER-error.
I'm using "Flash002_EraseSector". The code is extracted out of this function. I forgot to mention that. I also tried this example before. Same problem there. Stepping over the last line "M32(Address)=0x00000030U;" rises a SQER-error.