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.

CC2652R7: Using M95P32 external flash from ST for offchip OAD.

Part Number: CC2652R7
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

Hello,

I want to use the M95P32 external SPI flash from ST in my custom design and implement off-chip OAD. Currently, I have implemented OAD with the macronix flash present on the launchpad.

Can anyone please guide me on how to change the firmware to work with the M95P32 SPI flash?

I have developed SPI drivers for the M95P32 to read, write, and erase the flash. I believe I can add the "flash_inteface_ext_rtos.c" file to the project and implement my SPI drivers in the files "ExtFlash.c/h". Also what files should I modify in the bootloader to communicate with the external flash?

What all changes should I make in the OAD-related files?

Any guidance will be helpful.

Best regards,

Royce

  • Hi Royce,

    I think the easiest way will be:

    1. Copy/paste into your project the file NVSSPI25X.c (found in C:\ti\simplelink_cc13xx_cc26xx_sdk_7_40_00_77\source\ti\drivers\nvs)
    2. Modify the file from step 1 to match your new external flash (e.g. your SPI code)
    3. Update the various ext flash parameters in SysConfig (e.g. sector size, addresses, etc)

    You shouldn't need any changes in the OAD-related files.

    Thanks,
    Toby

  • Hi Toby,

    Thanks for the reply.

    Please correct me if I'm wrong.

    So I should copy/paste the NVSSPI25X.c and .h files into the project. Modify the SPI interface section in these files. Update SysConfig params for the external flash. And finally, include the NVSSPI25X.h header file in the "flash_interface_ext_rtos_NVS.c", and change the NVS driver calls in this file to the NVSSPI25X.c driver functions right?

    Best regards,

    Royce

  • Hi Royce,

    No need to update the flash_interface_ext_rtos_NVS.c, since functions there eventually lead to NVSSPI25X.c.

    For example, notice that flash_interface_ext_rtos_NVS --> flash_open calls NVS_open(CONFIG_NVSEXTERNAL, &nvsParams), and this CONFIG_NVSEXTERNAL (plus related content) is generated from SysConfig, which also includes NVS_config --> NVSSPI25X_fxnTable --> NVSSPI25X_open.

    Thanks,
    Toby

  • Hi Toby,

    Yes, understood. I did as you suggested. Now the OAD blocks are written to the M95P32 external flash, but after the OAD process is complete, the BIM is not able to read from the external flash and copy the new image to the internal flash and start the new application.

    Can you please let me know what all changes I have to make in the BIM off chip project to get it working with the external flash?

    I have already changed the SPI pin definitions (BSP_IOID_FLASH_CS, BSP_SPI_MOSI, BSP_SPI_MISO, BSP_SPI_CLK_FLASH) in the "bsp.h" file in the bim project.

    Best regards,

    Royce

  • Hi Toby,

    OAD with the external flash works now. I had to add info about the ST flash to the ExtFlashInfo_t struct in "ext_flash.c" file in the BIM project. Also I had to change the instruction opcode macro "BLS_CODE_MDID" to read the manufacturer device ID to match the ST flash. With these changes the Bootloader reads the manufacturer ID of the external flash and verify it and then copy the new image from OAD to the internal flash and starts the application.

    Thanks for the support.

    Best regards,

    Royce