2 Replies Latest reply on Nov 20, 2019 1:22 AM by NazarP_56

    How to set malloc heap size on ModusToolbox 2.0.0? (again)

    KiOk_2981821

      I asked this at How to set malloc heap size on ModusToolbox 2.0.0? .

       

      > How to set malloc heap size on ModusToolbox 2.0.0?

      > Sometime I would like to use small heap or large one.

      >

      > I'm using ModusToolbox Version:  2.0.0 Build ID: 1703 and CY8CPROTO-062-4343W PSoC 6.

       

      The answer was:

       

      > In the Project Explorer in ModusToolbox 2.0, go to libs > TARGET_CY8CPROTO-062-4343W > startup > TOOLCHAIN_GCC_ARM > startup_psoc6_02_cm4.S

      >

      > Please find the following code -

      > #ifdef __HEAP_SIZE

      >    .equ    Heap_Size, __HEAP_SIZE

      > #else

      >    .equ    Heap_Size, 0x00000400

      >

      > You can change the heap size here.

       

      Then I tried to modify it and also specify it at Makefile:

       

      $ vi libs/TARGET_CY8CPROTO-062-4343W/startup/TOOLCHAIN_GCC_ARM/startup_psoc6_02_cm4.S

      __StackLimit:     .space    Stack_Size     .size    __StackLimit, . - __StackLimit __StackTop:     .size    __StackTop, . - __StackTop      .section .heap     .align    3     .equ    Heap_Size, 0x00000100     .globl    __HeapBase     .globl    __HeapLimit __HeapBase:     .if    Heap_Size     .space    Heap_Size     .endif     .size    __HeapBase, . - __HeapBase 

      But it doesn't change the heap size:

      $ make clean $ make build --snip--    --------------------------------------------------    | Section Name         |  Address      |  Size     |     --------------------------------------------------    | .cy_m0p_image        |  0x10000000   |  5068     |    | .text                |  0x10002000   |  41060    |    | .ARM.exidx           |  0x1000c064   |  8        |    | .copy.table          |  0x1000c06c   |  24       |    | .zero.table          |  0x1000c084   |  8        |    | .data                |  0x080022e0   |  1912     |    | .cy_sharedmem        |  0x08002a58   |  8        |    | .noinit              |  0x08002a60   |  148      |    | .bss                 |  0x08002af4   |  836      |    | .heap                |  0x08002e38   |  1030600  |     --------------------------------------------------     Total Internal Flash (Available)          2097152     Total Internal Flash (Utilized)           51220        Total Internal SRAM (Available)           1046528     Total Internal SRAM (Utilized)            1033504