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: BLE5-Stack - Static Memory Allocation in FreeRTOS & ICall?

Part Number: CC2340R5
Other Parts Discussed in Thread: SYSCONFIG, CC2340R2, BLE-STACK

HI,

Is it possible to use TI's BLE5-stack with FreeRTOS but use static memory allocation (i.e. instead of dynamic memory allocation)?

Similar question for ICall, as I understand it too uses the heap.

Thanks,

Chi

  • Hi Chi,

    Thank you for reaching out.

    At the moment, the BLEStack does not offer the possibility to only use static memory allocation.

    Also, I don't think it is feasible to modify the way ICall allocates memory.

    I understand this is not the answer you were expecting, and I am sorry for this. I guess you could share the reasons for this request so we can see if other approaches could be considered.

    Best regards,

  • HI Clément,

    Thanks very much for your response.

    For our project, there are safety requirements and using static memory allocation would be a possible mitigation. It would also provide an alternative RTOS solution, such as SafeRTOS.

    Additionally, it was observed that the "basic_ble" example application has already used up a large chunk of the available memory. For example:

    Upon first look, the amount of SRAM remaining doesn't look too bad. Unfortunately, our project is planning to use the CC2340R2 wireless MCU and that only has 28KB of SRAM available which makes it difficult to add new BLE profiles/services and other application features. From what I can tell, a large chunk of the SRAM has been allocated to FreeRTOS? For example (a screenshot from Sysconfig):

    Unsure if these numbers should be tweaked.

    I would appreciate some feedback on the SRAM.

    Cheers,

    Chi

  • Hi Chi,

    Thank you for sharing!

    With regards to the SRAM usage question, please review this piece of documentation: https://software-dl.ti.com/simplelink/esd/simplelink_lowpower_f3_sdk/7.20.00.29/exports/docs/ble5stack/ble_user_guide/html/ble-stack-common/ram_allocation-cc23xx.html#ram-usage

    To be clear, if you want to use a different memory allocation strategy or if you want to change the RTOS used, I am afraid you'll have to rewrite the Bluetooth stack on your own. Honestly, I don't think such approach should be considered.

    Let me know your thoughts!

    Regards,

  • Hi Clément,

    Thanks for the link. That was useful reading.

    You mentioned about rewriting the BLE stack, do you mean creating our own from scratch? My understanding is that TI's BLE-Stack implementation is supplied as a set of pre-built libraries (e.g. OneLib.a and StackWrapper.a, supplied as part of the F3 SDK)?

    Cheers,

    Chi

  • Hi Chi,

    You are right, the TI's BLE-Stack implementation is supplied as a set of pre-built libraries within the F3 SDK.

    My point was, if you want a different implementation then you have to develop everything on your own from scratch. Some of our users do this, but it is of course a lot of work.

    Best regards,

  • Hi Clément,

    Thanks for the clarification. I am now clear on the needs of TI's BLE5-Stack and FreeRTOS.

    I have one unrelated question. Would you be able to explain the difference(s) between an entity and a task, in relation to the ICall framework?

    Cheers,

    Chi

  • Hi Chi,

    Would you be able to explain the difference(s) between an entity and a task, in relation to the ICall framework?

    I do not have all the details here. But, deep in the stack, "entities" and "tasks" are different concepts. At the application level one entity = one task-

    Regards,

  • Thanks Clément,

    I've marked your original response as a resolution to close out this thread.

    Cheers,

    Chi