Hello,
The BSL_scripter program takes up to 2 minutes to burn our current FW into our watches.
The watches are based on the EZ-430 Chronos model and use MSP4307623.
When the watches are reset after the FW burning, the time shown is usually 2 minutes before the actual time, though sometimes the time gets changed altogether.
I would like the BSL_scripter to save the PC date/time to the flash (in data area) after burning the FW. Then when the watch is reset with the new FW, its time and date will be correct.
Is this possible?
Please let me know.
Below is the code within the FW that updates the date/time on the flash.
Thanks,
Mechi
#define FLASH_BASE __MSP430_BASEADDRESS_FLASH__ // 0x0140 in the MSP4307623
#define FLASH_DATE_START INFOB_START // defined as 0x1900
currentTime is a Calendar struct from rtc_c.h:
typedef struct {
uint8_t Seconds;
uint8_t Minutes;
uint8_t Hours;
uint8_t DayOfWeek;
uint8_t DayOfMonth;
uint8_t Month;
uint16_t Year;
} Calendar;
void flashSaveDate()
{
uint16_t status;
//Erase DATE area
do
{
FLASH_segmentErase(FLASH_BASE, (uint8_t *)FLASH_DATE_START);
status = FLASH_eraseCheck(FLASH_BASE, (uint8_t *)FLASH_DATE_START, NUMBER_OF_BYTES);
} while (status == STATUS_FAIL);
//Flash Write
FLASH_write8(FLASH_BASE, (uint8_t *)¤tTime, (uint8_t *)FLASH_DATE_START, sizeof(currentTime));
}