This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

IWR6843AOPEVM: Flash storage access regarding

Part Number: IWR6843AOPEVM
Other Parts Discussed in Thread: IWR6843AOP, MMWAVE-SDK

Tool/software:

Hi, I'm working on a project using the IWR6843AOP EVM, based on the '3D_People_Tracking' demo source code. I’m currently trying to store the "chirp_configs" file in flash memory. I attempted the approach shown below but encountered an issue where the data read back from flash doesn't match the data written. I've attached debug logs for reference and the source code.

I have a few questions regarding this:

  1. Is it recommended to use the external flash for storing such data?

  2. Does the bootloader implement any protections that could affect read/write access to flash?

  3. Is it possible to obtain the source code for the IWR6843AOP bootloader?


Debug logs:
Starting Flash Test...>
Erasing Sector at 0x001E0000...
Sector erase success
Writing 1024 bytes pattern to Flash...
Flash write success
Reading back from Flash...
Flash read success
Mismatch at offset 0: Read 0x00, Expected 0xA5

static int32_t flash_test(int32_t argc, char *argv[])
{
/* RAM buffers */
static uint8_t txBuffer[FLASH_TEST_SECTOR_SIZE];
static uint8_t rxBuffer[FLASH_TEST_SECTOR_SIZE];
bool result;
uint32_t i;

DBG_PRINT("Starting Flash Test...\n");

/* Step 1: Erase Sector */
DBG_PRINT("Erasing Sector at 0x%08X...\n", FLASH_TEST_ADDRESS);
result = QSPIFlash_eraseSector(FLASH_TEST_ADDRESS);
if (!result)
{
DBG_PRINT("Sector erase failed!\n");
return -1;
}
DBG_PRINT("Sector erase success\n");

/* Step 2: Prepare Pattern */
memset(txBuffer, FLASH_TEST_PATTERN, sizeof(txBuffer));

/* Step 3: Write Pattern */
DBG_PRINT("Writing %u bytes pattern to Flash...\n", (unsigned int)sizeof(txBuffer));
result = QSPIFlash_write(FLASH_TEST_ADDRESS, txBuffer, sizeof(txBuffer));
if (!result)
{
DBG_PRINT("Flash write failed!\n");
return -1;
}
DBG_PRINT("Flash write success\n");

/* Step 4: Clear Read Buffer */
memset(rxBuffer, 0, sizeof(rxBuffer));

/* Step 5: Read Back */
DBG_PRINT("Reading back from Flash...\n");
result = QSPIFlash_read(FLASH_TEST_ADDRESS, rxBuffer, sizeof(rxBuffer));
if (!result)
{
DBG_PRINT("Flash read failed!\n");
return -1;
}
DBG_PRINT("Flash read success\n");

/* Step 6: Compare */
for (i = 0; i < FLASH_TEST_SECTOR_SIZE; i++)
{
if (rxBuffer[i] != FLASH_TEST_PATTERN)
{
DBG_PRINT("Mismatch at offset %u: Read 0x%02X, Expected 0x%02X\n",
(unsigned int)i, rxBuffer[i], FLASH_TEST_PATTERN);
return -1;
}
}

DBG_PRINT("Flash Test PASS \n");
return 0;
}