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.

RTOS/LAUNCHXL-CC1310: Read internal flash page on BIM.

Part Number: LAUNCHXL-CC1310
Other Parts Discussed in Thread: CC1310, CC1350

Tool/software: TI-RTOS

Hello All,

I wanted to implement FACTORY RESET on our CC1310 device. I'm planning to add this on the offchip_bim example.

My idea is to check if a certain location on the external flash (preferably the address for BLE STACK) contains an image.

If it doesn't contain an image, will copy the image from the internal flash into the external flash. 

However, I can't find any function that could read from the internal flash on file flash.c (C:/ti/<sdk_version>/source/ti/device/cc13x0/driverlib).

There is a HalReadFlash function on the hal_flash_wrapper.c (C:/ti/<sdk_version>/source/ti/ti154stack/hal/src/target/_common)

but can't compile the code successfully when I add it on my application code.

Any help would be appreciated.

Anyways, below is my setup:

CCS version: 8.3.1

SDK version: 2.20.00.38

Thanks and Regards,

Elton

  • Hi Elton ,

    Have you considered using the NVS driver? Check out this nvsinternal example from the SDK: <SDK_INSTALL_DIRECTORY>/examples/rtos/CC1350_LAUNCHXL/drivers/nvsinternal

    It shows how to use the Non-Volatile Storage (NVS) driver to read and write data to on-chip flash memory.

    Thanks,

    Alexis

  • Hello Alexis,

    Thanks for the response.

    I think if I'll add the NVS driver on the OFFCHIP BIM example, this would increase the compiled binary size and might not able to fit the allocated size for OFFCHIP BIM on internal flash which is ~0x1000. Am I right?

    Below shows the offchip OAD memory layout.

    I would like to have a minimal modification. Is there any other options other than the NVS driver?

    Regards,

    Elton

  • Hi Elton,

    Okay, then yes you can use the driverlib functions to do this. What errors are you getting when you try to compile your code? You can also probably try looking at the onchip example for how to read/write to it. 

    Thanks,

    Alexis

  • Hello Alexis,

    Was able to find some an alternative, since I'm getting compilation issues when I tried to use the HalFlashRead() function, I created a new function which is similar on the HalFlashRead() and added it on the bim_main.c file and it worked!

    I have now a working factory reset.

    Thanks for your help!

    Regards,

    Elton