2005-01-13 10:46 PM
2005-01-07 12:23 AM
Hi all,
did anyone of you succeed in using malloc()? If so, is there something I have to take care of ( besides using free())? If we try to use malloc, the processor enters the FIQ-Handler before even calling malloc (?!?!?) Thx for your help2005-01-11 07:37 AM
hello RISC,
could you send me a sample project with user defined stack and heap? Thx2005-01-12 10:19 PM
Hello.
we'd like to configure the linker / compiler to use internal memory for the stack and external memory for the heap (e.g. to use malloc ). For such a kind of memory configuration, there is an example in an107, chapter 4.2.3. ''Two-region model'', where a procedure is described for 71x_init.s. There is made an import of __use_two_region_memory. However, we want to configure it all using the scatterfile and retarget.c. What do we have to do? Our configuration is as follows: ---scatter loading file-------------------------- RAM_MODE 0x20000000 0x420FFFFF { RAM 0x20000000 { 71x_vect.o (Vect, +First) 71x_init.o (Init) * (+RO) * (+RW) } SRAM 0x62000000 UNINIT { * (+ZI) } } ---retarget.c-------------------------------------- __value_in_regs struct R0_R3 { unsigned heap_base, stack_base, heap_limit, stack_limit; } __user_initial_stackheap(unsigned int R0, unsigned int SP, unsigned int R2, unsigned int SL) { struct R0_R3 config; extern unsigned int Image$$SRAM$$ZI$$Base; config.stack_base = SP; config.heap_base = (unsigned int)Image$$SRAM$$ZI$$Base; return config; } --------------------------------------------------- When executing the code, the error message ''Out of heap memory'' is displayed. Where's the error?