This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Setup heap on external RAM

Hi

I have a board with external RAM and I'm using it quite well, except that I wrote my own malloc and free, which works fine, but I rather use the malloc and free that comes with standard library, I know that wheel will be more reliable than the one I made.
Where is the linker script? I'm using uVision4 IDE and Keil as my compiler.
Basically I want to define heap in a different segment other than the internal RAM of the MCU.
If you can post me an example that will much appreciated.

Thanks
Alejandro

Parents
  • Thanks much

    This is my file, it worked great!!!

    ; *************************************************************
    ; *** Scatter-Loading Description File generated by uVision ***
    ; *************************************************************

    LR_IROM1 0x08000000 0x00100000 { ; load region size_region ER_IROM1 0x08000000 0x00100000 { ; load address = execution address *.o (RESET, +First) *(InRoot$$Sections) .ANY (+RO) } RW_IRAM1 0x20000000 0x00020000 { ; RW data .ANY (+RW +ZI) } ; External RAM ; Used for mallocs, mainly for the file system/nand media driver RW_RAM1 0x60000000 0x00200000 { ; Secondary Memory .ANY (HEAP) ; Object/Section directive, park HEAP in here }
    }

Reply
  • Thanks much

    This is my file, it worked great!!!

    ; *************************************************************
    ; *** Scatter-Loading Description File generated by uVision ***
    ; *************************************************************

    LR_IROM1 0x08000000 0x00100000 { ; load region size_region ER_IROM1 0x08000000 0x00100000 { ; load address = execution address *.o (RESET, +First) *(InRoot$$Sections) .ANY (+RO) } RW_IRAM1 0x20000000 0x00020000 { ; RW data .ANY (+RW +ZI) } ; External RAM ; Used for mallocs, mainly for the file system/nand media driver RW_RAM1 0x60000000 0x00200000 { ; Secondary Memory .ANY (HEAP) ; Object/Section directive, park HEAP in here }
    }

Children
  • Sorry about the formatting, fixed showing correct below.

    ; *************************************************************
    ; *** Scatter-Loading Description File generated by uVision ***
    ; *************************************************************
    
    LR_IROM1 0x08000000 0x00100000  {    ; load region size_region
      ER_IROM1 0x08000000 0x00100000  {  ; load address = execution address
       *.o (RESET, +First)
       *(InRoot$$Sections)
       .ANY (+RO)
      }
      RW_IRAM1 0x20000000 0x00020000  {  ; RW data
       .ANY (+RW +ZI)
      }
      ; External RAM
      ; Used for mallocs, mainly for the file system/nand media driver
      RW_RAM1 0x60000000 0x00200000  {  ; Secondary Memory
       .ANY (HEAP) ; Object/Section directive, park HEAP in here
      }
    }