Quantcast
Channel:
Viewing all articles
Browse latest Browse all 59170

Forum Post: RE: Using external RAM for heap (GCC compiler, optimised libraries)

$
0
0
Hello Mike Thank you for asking. I almost forgot all about this matter... Actually I did. It turned out that I haven't read the KPIT FAQ's carefully enough. I found more information at KPIT FAQ's under GNU H8 tool chain/advanced/Q7. I put this into the linker file for the external memory: /* The heap in external RAM */   .heap ORIGIN(extram)(NOLOAD): {   /* _end must be added here to ensure that heap is allocated in external RAM */   _end = .;   __heap_start = .;  . += LENGTH(extram) - 1;   __heap_end = .; } extram "extram" is defined at the start of 2M memory area - defined by a chip select. AND I added this code to initialise the heap pointer and a function to return the top heap pointer: /** * @brief Heap initialisation *        Use stdlib.h to allow redefine of _top_of_heap function */ #include stdlib.h extern char _heap_end; extern char _heap_start; char* _heap_of_memory = NULL; char* _last_heap_object = NULL; /** * @brief Return top of heap * @return top of heap */ char* _top_of_heap(void) {   return (&_heap_end); } /** * @brief Initialise heap start */ void heap_initialise(void) {   _heap_of_memory = (char*) &_heap_start;   _last_heap_object = (char*) &_heap_start; } Now I am in a position were I can move the heap to any memory area I want. Unfortunately the heap couldn't exceed 64 k:-( When using a debugger it looked too me that their library code uses 16 bit to handle the heap size. I reported this to KPIT and it can be found here (ID=04577): www.kpitgnutools.com/.../bug_view_advanced_page.php KPIT provided a solution that I haven't seen before today- email notification of KPIT must have failed? It turns out that I must use the compiler flag -mint32 to handle all internal integers as 32 bit. I haven't tried this yet, but KPIT - from my point of view - always has been very reliable so I am sure it will work. If my targets will like to treat all internal integers as 32 bit is another story? I have to try that soon and report back to KPIT. Am I the only one in the Universe using H8SX's? I would very much appreciate KPIT/Renesas to update their wonderful GCC H8 tool chain for the newest versions of GCC like they do on RX and others. I guess they won't if I am alone?;-) Best regards Frank

Viewing all articles
Browse latest Browse all 59170

Trending Articles