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.

question on peripheral library and launchpad demo project flash_mass_erase

Other Parts Discussed in Thread: MSPWARE

Hi,

  I loaded and single stepped through flash_mass_erase and could not get past the call MAP_FlashCtl_performMassErase().

  How long should I wait for MAP_FlashCtl_performMassErase() for the launchpad MSP 432?

  Is there a "don't shoot yourself in the foot" issue between what the demo is trying to do and program execution, i.e. trying to erase the executable program as it executes?

  • Hi Robert,

    I have brought your question to the attention of the Example's author, he will formulate a proper response by the end of the day.

    Regards,
    Ryan
  • thank you.

    I noticed the other flash demo, which does complete ok, doesn't read back to verify the write.

    Are there demo examples that work the varieties of  verifies and reads, i.e test FlashCtl_getReadMode, FlashCtl_setReadMode, FlashCtl_verifyMemory? 

    The reason I am asking is that I am porting PIC code. The PIC demos didn't verify either, and when I tested their Flash, believe it or not, the PIC NVM  did not always read back what I had written and even worse did not save data on power cycling. Which is why I'm porting my code to your MSP432.

    What is the difference between a "main memory bank" and an "info memory bank"?  These aren't described in the user guide.

    bob s.

  • Hello Robert,

    All of the verification requirements are handled within the FlashCtl APIs themselves. The verification/read mode APIs are made available to enable power users to write their own flash drivers, however it is highly recommended that the majority of users rely on the DriverLib APIs to handle all of the verification requirements and read mode transitions.

    As far as the timing for the mass erase function, it is very dependent on your code. The majority of this code is actually going to be executing from the MSP432's ROM. This means that there are no requirements for erasing and bank execution, however if you erase the code that the mass erase function jumps back to after completion your program counter is going to be incorrect. 

    Could you share which version of CCS you are using as well as which version of DriverLib?

    Best Regards,

  • I'm just trying to run the demo you provide to users.

    Note that there is one sector enabled for erasure in the flash_program_memory demo, and that demo returns almost immediately.

    Here's my settings:
    MSPWare version (found in project properties): MSPWare_3_30_00_18
    Code Composer Studio (found in "About"): Version: 6.1.3.00033

    The filename for the user's guide I have is: MSP432_DriverLib_Users_Guide-MSP432P4xx-3_10_00_09.pdf
    Is there a more recent version?

    ps - the flash_program_memory demo (and the user's guide) only shows how to erase sector 31 because it #defines the start address
    for the sector. Can you provide the start address for sectors 0 through 30?
  • Hey Robert,

    Flash main memory is separated into two banks (0 and 1) that are each 128 KB. From each bank are 32 sectors of 4 KB each (4*32*2=256). Bank 0 is populated from 0x0000 to 0x1FFFF and bank 1 from 0x20000 to 0x3FFFF. Since you are using bank 1 your sectors would start at 0x20000 and increase by 4 KB (0xFFF) all the way to 0x3FFFF. For example: sector 0 is 0x20000 to 0x20FFF, sector 1 is 0x21000 to 0x21FFF, etc.

    Regards,
    Ryan
  • Thank you. That makes sense. My followup question is on Flash reading.

    There is no library call to read flash for the 432, nor is there an example on flash reading.
    Do I just use a pointer into the flash address and read via the usual C memory access?
  • Yes, the usual C memory access via address pointer should suffice to read the MSP432 flash.

    Regards,
    Ryan
  • Hi Ryan,

      The flash doesn't appear to retain state between power cycles. The A5's in the demo project turn into FF's when I read after unplugging and replugging the launchpad kit into the USB port.

      Do you guys erase all of flash when your debugger loads my program to debug?  

      If so, is there a work around so I can verify that flash actually does retain state?

    thanks,

      bob s.

  • Hi Bob,

    The default action for entering the debugger in CCS is to erase main memory and load the program before starting the debug session, if you would like to avoid this and debug a running target then you can go to Debug Configurations -> Program -> Loading options and select load symbols only: processors.wiki.ti.com/.../MSP430_-_Connecting_to_a_running_target

    Regards,
    Ryan
  • Thank you, I must have missed this reply earlier today. Knowing that CCS erases flash on startup may solve several problems I am experiencing, that flash doesn't retain state when power is cycled..

**Attention** This is a public forum