I'm looking at sample code and appNote in SLAA660 and SLAA659. I do not see how to get the 0xACE back from example code: This function is called from main(). Under IAR emulation, I never see the ACK come back. Evidently, the sample code doesn't work or is missing something; or...I'm missing something. How would I, under IAR Embedded Workbench see the ACK come back? This is the example code/problem/project in MSPware called bsl_config. uint32_t CheckAndEraseFlashMailbox(uint32_t flashMailboxCommand) { uint32_t result = BOOT_OVERRIDE_AND_MAILBOX_ERASE_OPERATIONS_SUCCESS; uint32_t eraseCycles = 0, eraseSuccess; /* Only check for commands different from COMMAND_NONE */ if(flashMailboxCommand != COMMAND_NONE) { if(flashMailboxCommand & COMMAND_FACTORY_RESET) { if(*((uint32_t*)(ACK_FACTORY_RESET)) != 0xACE) { result = BOOT_OVERRIDE_OPERATION_FAIL; } } if(flashMailboxCommand & COMMAND_BSL_CONFIG) { if(*((uint32_t*)(ACK_BSL_CONFIG)) != 0xACE) { result = BOOT_OVERRIDE_OPERATION_FAIL; } } if(flashMailboxCommand & COMMAND_JTAG_SWD_LOCK_SECEN) { if(*((uint32_t*)(ACK_JTAG_SWD_LOCK_SECEN)) != 0xACE) { result = BOOT_OVERRIDE_OPERATION_FAIL; } } if(flashMailboxCommand & COMMAND_SEC_ZONE0_EN) { if(*((uint32_t*)(ACK_SEC_ZONE0_EN)) != 0xACE) { result = BOOT_OVERRIDE_OPERATION_FAIL; } } if(flashMailboxCommand & COMMAND_SEC_ZONE1_EN) { if(*((uint32_t*)(ACK_SEC_ZONE1_EN)) != 0xACE) { result = BOOT_OVERRIDE_OPERATION_FAIL; } } if(flashMailboxCommand & COMMAND_SEC_ZONE2_EN) { if(*((uint32_t*)(ACK_SEC_ZONE2_EN)) != 0xACE) { result = BOOT_OVERRIDE_OPERATION_FAIL; } } if(flashMailboxCommand & COMMAND_SEC_ZONE3_EN) { if(*((uint32_t*)(ACK_SEC_ZONE3_EN)) != 0xACE) { result = BOOT_OVERRIDE_OPERATION_FAIL; } } if(flashMailboxCommand & COMMAND_SEC_ZONE0_UPDATE) { if(*((uint32_t*)(ACK_SEC_ZONE0_UPDATE)) != 0xACE) { result = BOOT_OVERRIDE_OPERATION_FAIL; } } if(flashMailboxCommand & COMMAND_SEC_ZONE1_UPDATE) { if(*((uint32_t*)(ACK_SEC_ZONE1_UPDATE)) != 0xACE) { result = BOOT_OVERRIDE_OPERATION_FAIL; } } if(flashMailboxCommand & COMMAND_SEC_ZONE2_UPDATE) { if(*((uint32_t*)(ACK_SEC_ZONE2_UPDATE)) != 0xACE) { result = BOOT_OVERRIDE_OPERATION_FAIL; } } if(flashMailboxCommand & COMMAND_SEC_ZONE3_UPDATE) { if(*((uint32_t*)(ACK_SEC_ZONE3_UPDATE)) != 0xACE) { result = BOOT_OVERRIDE_OPERATION_FAIL; } } if(flashMailboxCommand & COMMAND_JTAG_SWD_LOCK_ENC_UPDATE) { if(*((uint32_t*)(ACK_JTAG_SWD_LOCK_ENC_UPDATE)) != 0xACE) { result = BOOT_OVERRIDE_OPERATION_FAIL; } } } if(result == BOOT_OVERRIDE_OPERATION_FAIL) { return(result); } /* All commands executed successfully, now erase flash mailbox */ eraseSuccess = 0; MAP_FlashCtl_unprotectSector(FLASH_INFO_MEMORY_SPACE_BANK0, FLASH_SECTOR0); while((eraseCycles++ < MAX_FLASH_ERASE_CYCLES) && (!eraseSuccess)) { eraseSuccess = MAP_FlashCtl_eraseSector(FLASH_MAILBOX_START); } if(!eraseSuccess) { result = MAILBOX_ERASE_FAIL; } MAP_FlashCtl_protectSector(FLASH_INFO_MEMORY_SPACE_BANK0, FLASH_SECTOR0); return(result); } Thanks, -Jim
↧