Hello,
I am using the MSP432P401R microcontroller and I have been experiencing odd behaviors during run-time where my program will either skip over some logic or get stuck at certain points. I am attempting to figure out what may be causing the issue, and I would like to look into the integrity of what's in memory. Is it possible that the code region is being marginally programmed during firmware uploads? I use the BSL with the BSL-Scripter to load firmware.
If this is possible, does anyone have any examples of how to use marginal reads? I have attempted a solution using the MSP Driver Library, but I am not sure if it is 100% correct. I appreciate your help in advance.
{ volatile uint32_t *a = (uint32_t *)addr; SETUP_CLOCK_1MHZ(); for (uint16_t n = 0; n < size; n += sizeof(*a), ++a) { uint32_t v0, v1, vs; FlashCtl_setReadMode(FLASH_BANK0, FLASH_MARGIN1_READ_MODE); v1 = *a; FlashCtl_setReadMode(FLASH_BANK0, FLASH_MARGIN0_READ_MODE); v0 = *a; FlashCtl_setReadMode(FLASH_BANK0, FLASH_NORMAL_READ_MODE); vs = *a; if (v1 != vs || v0 != vs) { SETUP_CLOCK_FAST(); return 0; } } SETUP_CLOCK_FAST(); return 1; }
Thanks,
Zach