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

How create heap in external memory

hi

i am working an embedded project with keil mdk-arm compiler.

i am trying to access to external memory as heap,but after download my programe in my micro(my micro is lpc1788) it crash(without start main function) in startup.c file.

now any one can explain to me how can configure keil to use my external memory as heap.

thanks

aria

  • Modify the heap size/section in the startup.s files, and modify your scatter file to place that section into the region which defines the external memory.

    http://www.keil.com/forum/23045/

  • And remember to set up any memory controller configurations that the processor requires to access any external memory before you start to access the heap address range.

  • very thanks for your fast reply.
    after your post until now, i am exploring in internet for scatter and i read very documents about it,but i can not found answer of my question.
    can you give more explain about scatter ?
    i put my scatter code in below :

    ; *************************************************************
    ; *** Scatter-Loading Description File generated by uVision ***
    ; *************************************************************
    
    LR_IROM1 0x00000000 0x00080000  {    ; load region size_region
      ER_IROM1 0x00000000 0x00080000  {  ; load address = execution address
       *.o (RESET, +First)
       *(InRoot$$Sections)
       .ANY (+RO)
      }
      RW_IRAM1 0x10000000 0x00010000  {  ; RW data
       .ANY (+RW +ZI)
      }
      RW_IRAM2 0x2007C000 0x00008000  {
       .ANY (+RW +ZI)
      }
    }
    
    

    it is incorrect ????

    again " thank you for your reply "

    aria.

  • Doesn't seem to be quite like the ones I posted as examples in the cited thread above, does it?
    I don't presume to know where the external memory is on your board/design.
    Are the Keil manuals not enlightening?
    You need to direct the HEAP to where it's supposed to reside.

    www.keil.com/.../armlinkref_chdjdjfe.htm
    www.keil.com/.../armlinkref_Chdbjdii.htm

  • hi
    thanks for your response
    my problem was resolved,simply by add this line in scatter file :

    startup_LPC177x_8x.o (STACK)
    


    (strartup_LPC17x_8x is name of my startup.s file)

    now my scatter file is below :

    ; *************************************************************
    ; *** Scatter-Loading Description File generated by uVision ***
    ; *************************************************************
    
    LR_IROM1 0x00000000 0x00080000  {    ; load region size_region
      ER_IROM1 0x00000000 0x00080000  {  ; load address = execution address
       *.o (RESET, +First)
       *(InRoot$$Sections)
       .ANY (+RO)
      }
      RW_IRAM1 0x10000000 0x00010000  {  ; RW data
            startup_LPC177x_8x.o (STACK)
       .ANY (+RW +ZI)
      }
    }
    


    again thanks