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.

CCS/CC2640R2F: Project with BLE 5.0

Part Number: CC2640R2F

Tool/software: Code Composer Studio

Hi,

I realized my project with BLE SDK 2.20.00.49 using ble 4.2 and it is ok.

Now, I try to modify the simple_peripheral project example in /ti/simplelink_cc2640r2_sdk_2_20_00_49/examples/rtos/CC2640R2_LAUNCHXL/ble5stack adapting him to my project, to use BLE 5.0. When I finish I have a problem with memory, in particular with .cinit section, that exceed the max value. 

I tried to delete the parts of the simple_peripheral project that I don't use an I tried to compile him without adding the parts of my project, the project is build but if I see the memory allocation .cinit section with view->memory allocation I see that its value is already very close to the limit. So when I added my project component I exceed the limit, while with my original projet in bluetooth 4.2 I'm very under the limit.

Can I know why?

Thanks.

Best regards.

Giuseppe

  • Hi Giuseppe,

    You can try following this e2e thread on reducing the amount of flash in the BLE5 Simple Peripheral example. Are there any specific BLE5 features that you are trying to use in your project? Otherwise if Bluetooth 4.2 is adequate for your design, I suggest using it instead to help you achieve maximum application flash memory availability. 

  • Hi,

    I have already made the changes mentioned in point 3. But I have the problem.
    The only reason to use BLE 5 is to keep up with the BLE technology and any future developments.

    Thanks.

    Best regards.

    Giuseppe

  • Giuseppe,

    Can you post your .map file and your linker file? Did you adjust the linker file any?
  • Giuseppe,

    Also, how much code space does your actual application portion of your code (the code you added) take? It could be that you're just running out of available flash memory.
  • allocation.pdf

    Hi,

    As you can see from the file  .cinit section is only 1.516  in my project with 4.2 . In the BLE 5.0 without change to simple peripheral project it is greater than 5000.

    Best regards.

    Giuseppe

  • Hi Giuseppe,

    Can you send us your .map file, linker file, and the flash memory for the BLE 5.0 version?
  • file.zip

    Hi,

    I have attached .map file and linker.cmd file, I'm not sure that I understood what files you asked me.

    Anyway , when I remove some parts from the code that  I don't use for the connection (but for other purposes) between android app and cc2640r2f so that the memory allocation is ok, the connection is ok every time, while with the stack 4.2 many time I have the error code 133 on the Android app, so it would be good to switch from 4.2 to 5.

    Thanks.

    Best regard

    Giuseppe

  • Hi,
    I verified now that when I introduce
    ADC_init();
    to initialize the ADC the memory allocation explodes.
    Best regards.
    Giuseppe
  • Giuseppe,

    What do you mean by "explodes"? Does it cause the project to not fit or are you meaning something else? Unfortunately, we don't know what error code 133 is on the android app you are using or what android app you are using. If you have sniffer logs that would be great or if that's an entirely different issue, please create a new thread so we can stay on the topic of this post.

    We will look at your linker file, but when you add ADC_init, that's adding extra code/drivers and another library which will add to flash.

    I see the FAILED TO ALLOCATE message in the .map file. Was this reported as an error in CCS errors/issues window?
  • Hi,

    with exploding I mean that it does not fit memory. 

    with reference to error 133, I use a custom app and sorry but I have not a sniffer, only the hci bluetooth report from the smartphone.

    The FAILED TO ALLOCATE is report as error from CCS.

    Thanks.

    Best regards.

    Giuseppe

  • Hi Giuseppe,

    Based on the .map file you provided, it looks like some dmaSPI control tables are being added to your .cinit. Can you tell me what changes you are making to your example and confirm whether or not you are making any changes to your memory?

    Please be aware of the amount of application code you add and how much flash your example is using. If you want to use BLE5, it is recommended that you upgrade your device to the CC26x2 if you plan on adding a significant amount of application code since that device has more available memory.  Otherwise since BLE4.2 is suitable for your application, I would recommend staying with BLE4.2 instead of upgrading. BLE5 is backwards compatible and will still work with BLE4.2 devices.

    Your .map file:

    Out of Box BLE5 Simple Peripheral .map file:

  • Hi,

    I add the ADC_init, the Sensor_I2C and external flash control pin, and some other added to drive external Relè when certain events occur.

    If with  changes to the  memory you  referto changes to .cmd file or other files, no.

    Thanks.

    Best regards

    Giuseppe

  • Hi Giuseppe,

    If all you added were TI-Driver calls then your application code uses too much memory for BLE5 on the CC2640R2. You can either reduce your application code or consider what I recommended above.
  • OOK, 

    Thanks.

    Best regards

    Giuseppe