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.

CC2640: Saving data from external processor to SNV while OAD is enabled

Part Number: CC2640
Other Parts Discussed in Thread: , BLE-STACK

Hello,

In our hardware cc2640 is connected to STM32L471RET6 through I2C. I want to save some information coming from STM32L471RET6 on SVN/ other non volatile memory.

I am also using onchip OAD but SNV is disabled (OSAL_SNV=0) by stack. If i set it  OSAL_SNV=1 or OSAL_SNV=2, the img_b does not get compiled and it shows out of memory error.

I am using IAR 7.70.2 for building the application.

How to reduce the memory usage and make SNV to work along with OAD?

Is there is any other way to preserve data so it stays in memory even on shutdown?.

waiting for your kind help.

Thank in Advance.

Regards

  • Part Number: CC2640

    Tool/software: TI C/C++ Compiler

    Hello,

    I want to use SNV with OAD service. I performed write/read on SNV in simple_perpheral_app_lp but it returns status = 2.

    Then i checked the pre-processor of stack ( 2.2.1) and i found OSAL_SNV=0. That means no page is allocated for SNV. I changed OSAL_SNV  to OSAL_SNV=1 and also tried OSAL_SNV=2.

    But when i compiled the application I got following error.

    I checked the SNV with simple_peripheral (without OAD) and it works fine. I am working with IAR 7.70.2 and stack 2.2.1.

    Can you please help how i can enable the SNV along with OAD on chip ?

    I think it is some configuration related issue. What changes should be done to get resolve this issue?

    Thanks in advance.

    Waiting for kind help.

  • Any help from TI please? Its urgent.
    Thanks a lot.
  • Use of SNV and/or Bond Manager with on chip OAD for CC2640 is not supported due to flash size limitations. I recommend you use CC2640R2F for this configuration.

    Best wishes
  • Hello,

    As stated in the OAD guide, OSAL_SNV=0 and no GapBondMgr functionality are built into ImageA for BLE-Stack v2.2.1. There is likely not enough space to perform this functionality, this is why the image is failing to link.

    If you would like to be able to use ImageA with SNV and bonding please consider migrating to the CC2640R2F.
  • Hello Sean,

    Is there is any other way (beside SNV)to preserve data so it stays in memory even on shutdown?

    Waiting for your help.

    Thanks a lot.
  • Hello,

    Writing to NV is the only way to preserve information across a shutdown. Due to the nature of NV, it is probably best to use SNV, otherwise you will end up implementing something very similar using the FLASH APIs. If you need to use SNV, then you can try to optimize the space for imageB by trimming the size of the stack and imageA.


    This would be a pretty involved process though and would require modifications to the linker file. Is using the CC2640R2F or storing the data on the STM32L471RET6 an option for you?
  • Hi Sean,

    There is no option to use cc2640R2F as our hardware is finalized. Data can not be stored on STM32L471RET6.
    Can you please suggest me what modifications I should made in linking files? So that I can use SNV some how.

    Waiting for kind reply.

    Regards
  • Sure, but there is no guarantee that this will actually work. Here is what I would try:

    1. Optimize the size of imgA, remove all code that is not absolutely necessary. This app is already pretty lean and trim, but maybe you can find a place to trim a few bytes here and there. From there, look at your map file and try to trim the space allocated to imageA. Once you can get imageA linking and building flash it

    2. Use the leanest stack configuration you can. Make sure you are peripheral only, no 4.1 controller, no extra features, etc. Re-build and re-flash the stack. To enable OSAL_SNV you will need to build the stack with OSAL_SNV=1 this requires around 4kB of additional memory.

    3. Try to optimize imageB to fit, but once you have set your stack size, your space for imageB is fixed. The only other thing you can tweak is your memory footprint within this space. (i.e. splitting sections, etc).
  • Hello Sean,

    According to IAR output following are the size of each part:

    Image_B size :
    43,305 Bytes

    oad_application size:
    35,422 Bytes

    BIM size:
    8,170 Bytes

    Stack size:
    49,422 Bytes


    Can you suggest me how these can be improved?

    Waiting for your kind reply.
  • Hello,

    1. Bim can't be reduced much
    2. The stack can only be reduced by configuring it to it's leanest configuration, this is covered in the software developer's guide
    3. ImageA is already pretty small but maybe you can find a few bytes here and there.
    4. ImageB, make sure you are not including any unneeded drivers, (display, etc). Remove registering for unneeded callbacks from the stack, etc.


    Again, this is an advanced use case that really isn't supported on CC2640R1 due to flash size limitations. You will need to need to attempt the modifications, feel free to post back with specific questions.
  • Hello JXS,

    As you suggested CC2640R2F. Would it be possible to port the code of cc2640 to CC2640R2F? As CC2640R2F is using bluetooth 5.0 instead of 4.2.

    waiting for your kind reply.
  • Hi mabbas,

    Yes the code porting should be very simple. BLE-Stack 3.0.1 is based on Bluetooth 4.2 as well.

    See software-dl.ti.com/.../migration.html