2 Replies Latest reply on Feb 19, 2019 4:07 PM by andrew.trobia_3264986

    How do I use the memory meant for CM0 in CM4?

    andrew.trobia_3264986

      I am using a PSoC 6. I have a CM4 system defined that is running out of memory (stack overflow). I want to neglect the CM0 processor use of memory and use the memory saved in CM4 processor. How do I do this?

       

       

      At compile time code:167508 sram:128152 is reported. There is only 9K more memory for the CM4 system. I have a screen buffer for a 600x800 display. I have the buffer as Booleans, so the actual buffer is 600x100. However, font data and other FreeRTOS task requirements is using all of the memory resource (i.e. 288K bytes). I have only 10K defined as heap. That is the minimum setting I can use.

       

      It would be nice to fine more memory borrowing it from the unused CM0. It this possible?

        • 1. Re: How do I use the memory meant for CM0 in CM4?
          YeshwanthK_56

          Hi Andrew,

          It is possible to relocate the memory assigned for CM0 and CM4 by default. CM4's memory location starts after CM0's memory location. Change the "size" of SRAM for CM0 in the linker script to the desired value. Change the start of the CM4's SRAM to the end of CM0's memory, finally change the "size" of SRAM for CM4.

           

          Example:

           

          (Before)

          For ARM GCC -

          ram               (rwx)   : ORIGIN = 0x08000000, LENGTH = 0x24000                              (CM0)

          ram               (rwx)   : ORIGIN = 0x08024000, LENGTH = 0x23800                              (CM4)

           

          (After)

          For ARM GCC -

          ram               (rwx)   : ORIGIN = 0x08000000, LENGTH = 0x10000                              (CM0)

          ram               (rwx)   : ORIGIN = 0x08010000, LENGTH = 0x37800                              (CM4)

           

          Regards,

          Yeshwanth