Part Number: MSP430F5529
Hi,
I'm trying to read/write from/to Info D internal Flash area on the MSP430F5529.
When using the MSP430F55xx_flashwrite_02.c example, it works great but when I use the USB example (C1_LedOnOff) it seems not to work.
I'm using the C1_LedOnOff example as is with the below additional code at the beginning (for debug purpose):
void main (void)
{
WDT_A_hold(WDT_A_BASE); // Stop watchdog timer
unsigned long * Flash_ptrD; // Initialize Flash pointer Seg D
unsigned long FlashTmp;
Flash_ptrD = (unsigned long *) 0x1800; // Initialize Flash pointer
FlashTmp = *Flash_ptrD; // Initialize Value
FlashTmp++;
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 = FlashTmp; // Write to Flash
FCTL1 = FWKEY; // Clear WRT bit
FCTL3 = FWKEY+LOCK; // Set LOCK bit
while(1); // Loop forever, SET BREAKPOINT HERE
// Minumum Vcore setting required for the USB API is PMM_CORE_LEVEL_2 .
PMM_setVCore(PMM_CORE_LEVEL_2);
USBHAL_initPorts(); // Config GPIOS for low-power (output low)
USBHAL_initClocks(8000000); // Config clocks. MCLK=SMCLK=FLL=8MHz; ACLK=REFO=32kHz
initTimer(); // Prepare timer for LED toggling
USB_setup(TRUE, TRUE); // Init USB & events; if a host is present, connect
__enable_interrupt(); // Enable interrupts globally
while (1)
{
...
Is there something that locks the FLASH Info area when using the USB example?
Thanks,
Itay