9 Replies Latest reply on Nov 29, 2018 10:32 AM by MichaelF_56

    OTA/FreeRTOS heap issues (M0120)


      I have a project on a PSoC 4200 BLE which uses a lot of RAM (about 2k remaining).  I'm using FreeRTOS, but because I'm only using static allocation, I have the heap size set to 0 to give my application as much RAM as possible.


      I recently started trying to implement an Upgradeable Stack Bootloader for this project, following the instructions in AN97060.  After making the required changes to my project, the application project fails to build with error M0120 (section '.heap' will not fit in region '.ram").


      This seems to be caused by the custom linker script from the OTA changes needing heap space which I don't have room for.  I see that the BLE component datasheet says that for the stack-only BLE component in the stack project, "requires approximately 3024 additional bytes of heap memory".


      My questions are:


      1:  Why does having the component in stack-only mode require any heap space when having OTA disabled does not?

      2:  Why is this heap space necessary when the stack is being used by the application rather than just by the stack application?  The component works fine with no heap space when OTA is disabled.

      3:  Is there any way around this problem or can I not do OTA firmware upgrade when my application requires most of the PSoC's RAM, even if most of that RAM is available to the stack application when the real application isn't running?