Hello all,
In the example of the flash writing operation for F550x family we can find code below.
void main(void){ unsigned long * Flash_ptrD; // Initialize Flash pointer Seg D unsigned long value; WDTCTL = WDTPW+WDTHOLD; // Stop WDT Flash_ptrD = (unsigned long *) 0x1800; // Initialize Flash pointer value = 0x12345678; // Initialize Value FCTL3 = FWKEY; // Clear Lock bit FCTL1 = FWKEY+ERASE; // Set Erase bit *Flash_ptrD = 0; // Dummy write to erase Flash seg FCTL1 = FWKEY+BLKWRT; // Enable long-word write *Flash_ptrD = value; // Write to Flash FCTL1 = FWKEY; // Clear WRT bit FCTL3 = FWKEY+LOCK; // Set LOCK bit while(1); // Loop forever, SET BREAKPOINT HERE}
Simple application.
There are two things I want to know.
1. Is compiler smart enough to don' t store program memory at 0x1800 address?
2. Is it recommended to use any range of addresses?
Best regards,
Mikolaj
Mikolaj Filar Is compiler smart enough to don' t store program memory at 0x1800 address?
This command file usually (if not altered for some reason by teh user) defines info flash as 'there but not used for anything'. Code and init vlaues for variables are stored in main memory.
_____________________________________Before posting bug reports or ask for help, do at least quick scan over this article. It applies to any kind of problem reporting. On any forum. And/or look here.If you cannot discuss your problem in the public, feel free to start a private conversation: click on my name and then 'start conversation'. But please do so only if you really cannot do it in a public thread, as I usually read all threads. And I prefer to answer where others can profit from it (or contribute to it) too.