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.

Another msp432 peripheral library flash question



Hi,

 There is no library call to read flash for the 432, or is there an example. 

  Do I just use a pointer into the flash address and read via the usual C memory access?

  The demo example for writing only provides the address for sector 31, not the other sectors. 

  I assume the read address and the write addresss are the same, is this correct?

  Do I just subtract 4096 from the sector 31 address to get the address for sector 30, and so on?

thanks!

PS - I read memory at the address from the demo:  CALIBRATION_START and got back A5's. However, I then cycled power and memory at address CALIBRATION_START read 0xff's. I thought flash was supposed to retain state after power cycling. I must be doing something wrong. Any help?

  • Hello Robert,

    Yes, using a pointer to a flash address will allow you to read at that address. Reading and writing use the same addresses. Please keep in mind the APIs provided for Writing/Erasing only go to the sector level. You can read at the byte or word level. Please see the Flash Controller section of the User Guide for more information on this subject. Please see section 6.3.1 of the Datasheet for memory table details. Both of these documents are located on the product page of the device. ti.com/.../MSP432P401R

    For the Flash API example you reference, one of the steps of the example is to erase the flash sector that contains the fake calibration data. This changes that sector of memory to 0xff (erased).
  • Hi, JH,
    The problem I'm having now is that flash memory data isn't retained on power cycling my 432 launchpad.
    My question is, does the code composer development tool erase all flash memory and not just the memory space needed for the executable when it installs the program to debug?
    thanks,
    bob s.

    PS - I just saw a reply to an earlier question, and this is now OBE (overtaken by events).

    The CCS debugger DOES erase flash on startup but there's a workaround.

    Oh this is funny. The message I saw is the one below. 

  • Robert,

    Yes, CCS will erase all memory if you reprogram the device. This is by default. You do have some additional options though. Within CCS, if you right click your MSP432 projet, head to Properties > Debug (at the bottom) > MSP432 Setting. There is an Erase Configuration that gives you a few options.
  • It works! Thank you!

**Attention** This is a public forum