I am working on integrating a bootloader onto the MSP432. I am using a bootloader framework that in the past I have been able to port to many different platforms. To port it to the MSP432 platform all I need to do is provide a way to write to flash (code) memory. Now I have looked at the examples on how to program flash memory but I cant seam to get anything to work. I cant seam to find the documentation on how the sectors and banks relate to the memory map.
I have been using the following code to try and program memory.
FlashCtl_unprotectSector(FLASH_MAIN_MEMORY_SPACE_BANK0, FLASH_SECTOR1); FlashCtl_initiateMassErase(); FlashCtl_enableWordProgramming(FLASH_IMMEDIATE_WRITE_MODE); FlashCtl_programMemory(data,dest,4096); FlashCtl_protectSector(FLASH_MAIN_MEMORY_SPACE_BANK0,FLASH_SECTOR1);
I understand that the above code will unlock the 32 sector in bank 0 of the device MSP43 flash memory. What I dont get is what address is this. My thought is that this is at address 0x1000 since this is the start o the next 4kB sector after sector 0. When I look at the memory on the device after the above command I see that the memory was never programmed. Am I not calculating the memory address correctly? Is there more that I need to do in order to write to flash memory.