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.

CC2340R5-Q1: Flash Memory Programming Verification

Part Number: CC2340R5-Q1
Other Parts Discussed in Thread: UNIFLASH, CC2340R5

Hello,

We would like to verify whether the correct values have been written after writing to the flash memory. In our previous products, we have read out all the data from the flash memory and performed a bit-level verification check. We would like to carry out the same read verification with the CC2340R5-Q1.

However, none of the documents we have reviewed describe how to perform a read operation. Since UniFlash can read the data, we believe there must be a method to do so. Could you please let us know how?

Thank you in advance.

  • Hello,

    Uniflash is using SACI commands to read out the memory, a feature of the debugger. 

    How did you dump the flash before? It should work the same on the CC2340R5. Alternatively, you can use CCS to dump the memory: https://software-dl.ti.com/ccs/esd/documents/users_guide/ccs_debug-main.html#memory-view

    Best,

    Nima Behmanesh

  • Hi Nima, thank you for your response.

    I’d like to rephrase my question: could you please provide details on the SACI command used to read flash memory values?

    I want to retrieve the values with a tool other than CCS or UniFlash.

    I couldn’t find the information in “CC23xx_CC27xx In-Circuit Debugging Tools Guideline.pdf” or “IHI0031G_debug_interface_v5_2_architecture_specification (1).pdf”.

    By the way, I have already performed writing and CRC32 verification using those tools.

    Thank you.

  • Hello,

    I'm not quite sure what documents you are referring to. I'm also not aware of any other tools that can be used to read the memory from the device. 

    Additionally, I misspoke, there is not a SACI command that will allow you to dump flash from the chip. You must use CCS or Uniflash. 

    You can use CCS: https://software-dl.ti.com/ccs/esd/documents/users_guide/ccs_debug-main.html?highlight=memory#memory-view

    You can also use CCS scripting: 7.8. Scripting — Code Composer Studio 20.4.0 Documentation

    Best,

    Nima Behmanesh

  • Hi Nima,
    To elaborate a bit more — in our product manufacturing process, we would like to avoid changing our existing writer equipment (currently used for writing to the memory of non-TI MCUs) for reasons related to change management. Instead, we are considering adding support for CC2340R5 writing to the existing equipment.

    Therefore, we are looking for methods to perform write, erase, verify, and read operations (the read is for read-verify purposes) on the CC2340R5. For all operations except reading, we have already obtained the necessary information from the documents mentioned earlier, implemented them, and confirmed that they work.

    So now, I would like to know how to perform the read operation. Since UniFlash is able to perform a dump, I believe there should be a method for doing this, and I’d like to ask if you could share that information.

    Please note that we are not planning to use CCS or UniFlash during manufacturing.

    Thank you in advance.
  • Hello,

    To make sure I'm understanding you correctly:

    You are trying to read the flash of the CC2340R5 by sending a command to the CC2340R5 via an external device. This external device will read the data and perform the verification.

    If the above is true, then you will need to write a layer in your application that can communicate via a serial protocol that will send the data to the external device. There is not a command or way via the ROM serial bootloader or SACI that will read the entirety of flash from the device. This is because doing so would be a security concern.

    Alternatively, you will need to write your own tool that can communicate with the debugger via the ARM Cortex-M debugger specification.

    Best,

    Nima Behmanesh

  • Hi Nima,
    Your understanding is correct, and I also understand why the SACI command cannot read the entire flash memory of the device.
    That said, I have three questions:
    1. You mentioned that this is possible using the ARM Cortex-M Debugger Specification. Do UniFlash and CCS use the same method to dump the flash memory?
    2. Would you be able to share the communication specification used by UniFlash and similar tools, or provide any documentation such as a specification sheet?
    3. You referred to “read the entirety of flash from the device”—is there a way to read only a portion of it?

    Thank you for your assistance.

  • Hi,

    You mentioned that this is possible using the ARM Cortex-M Debugger Specification. Do UniFlash and CCS use the same method to dump the flash memory?

    Uniflash and CCS both communicate the device over SWD which follows the ARM Cortex-M debugger specification. This information is available online, though, I should mention that developing such a tool is not trivial. I suggest either using command line Uniflash or CCS scripting if such a tool is desired. APIs are available to read flash that way.

    Would you be able to share the communication specification used by UniFlash and similar tools, or provide any documentation such as a specification sheet?

    You can find the ARM debugger specification here: https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&ved=2ahUKEwiohtmUgY6SAxU7lWoFHW3KNnoQFnoECBgQAQ&url=https%3A%2F%2Fdocumentation-service.arm.com%2Fstatic%2F622222b2e6f58973271ebc21%3Ftoken%3D&usg=AOvVaw3P6WcCOejcQE78Mc2abDgD&opi=89978449

    You referred to “read the entirety of flash from the device”—is there a way to read only a portion of it?

    You are referring to this statement: 

    There is not a command or way via the ROM serial bootloader or SACI that will read the entirety of flash from the device. This is because doing so would be a security concern.

    Let me clarify: There is not a command or way via the ROM serial bootloader or SACI that will read flash from the device

    The options to read flash (whether it's all of it or just part of it) must either be implemented via a layer in the application, or a tool that leverages the SWD line on the device. Uniflash and CCS both leverage the SWD, and has APIs that allow you to write tools (specifically CCS scripting as I've linked in an earlier post). 

    Please understand that support will be limited for any implementations that do not use Uniflash and CCS. 

    Best,

    Nima Behmanesh

  • Hi Nima.
    I understand that it cannot be read via SACI or similar methods.

    Since we aim to use a tool other than development tools like CCS or UniFlash for mass production, it may be challenging, but we will attempt development based on the information you have provided.
    Thank you for your response. I will close this thread now.

    Thanks again.