Thanks for trying my recommendations and for providing the project. For my setup, I'm using CCS v6.1.3 and the red MSP432 Rev2.0 LaunchPad (with on-board debugger, which shouldn't matter). After importing and debugging the code from your project, I noticed that the large "largeArray_u64_arr" array was getting stored in RAM, not flash. When I added "0x55555555" to the front of the array, the RAM changed accordingly, and I was able to execute the printf() function both times. Now, I made some changes to your project and also created another project to simulate your Bootloader project. Here is a summary of those changes: Main Code project (TestFlashErase project) Added "const" qualifier to the declaration of the array (verified that array was placed in flash, not RAM) Added the following line of code before the declaration of the array to specify its location in flash /*******************************************/ /* Defines */ /*******************************************/ /*******************************************/ /* Globals */ /*******************************************/ #pragma LOCATION(largeArray_u64_arr, 0x2000) const uint32_t largeArray_u64_arr[] = Modified the linker file to specify that MAIN memory started at 0x00000000 with length 0x00014000. For the debug settings, I chose "Erase main memory only" for the Erase Method, and no other settings were changed. Verified that the array started at 0x2000 in flash (see screenshot below). Bootloader Code project (tempProject project) Based on Blink LED code example (no changes to C file) Modified the linker file to change default MAIN to BOOT memory started at 0x00014000 with length 0x00004000. NOTE that I also changed .intvecs to 0x00014000 in SECTIONS. For the debug settings, I chose "Erase and download necessary segments only" for the Erase Method and also unchecked "On a program load or restart" option under "Auto Run Options" . As shown below, the array in MAIN memory hasn't changed after programming the BOOT section to flash. In my implementation, I flashed main code first, then bootloader code. For yours, it sounds like you want to program the bootloader code first, then make changes to the main code sections. You would just reverse my projects to accomplish this, but hopefully it demonstrates that it can be done. I've attached both projects, so please give them a try and let me know what you see. This should hopefully resolve your issue. I changed both projects to output a TI TXT file to easily review and compare the binary with the flash memory. I'd recommend you continue aligning the code sections in the linker files to 4KB (multiples of 0x1000h) as discussed earlier. Please let me know if you have any questions. (Please visit the site to view this file) (Please visit the site to view this file) Regards, James MSP Customer Applications
↧