I want to use external RAM as heap storage.
It needs to be initialized before the copy section.
How can I make Processor Expert generate such Code ?
Unfortunately, PEx will not do this for you. In this case you need to do this manually but you can use the help of PEx to initialize the peripheral that you will use to communicate with external memory. The required steps are the following:
1) Edit linker file
- Go to your project folder > Project Settings > linker Files and open .ld file.
- Create a new memory segment according to the external memory address range you will use. Please refer to the following document for information about editing linker file: Relocating Code and Data Using the KDS GCC Linker File for Kinetis
- In linker file locate label __heap_size and set the desired size.
- Also locate section ._user_heap_stack : and change the memory segment where it is going to be located. In this case it is the new segment you created in previous step. You can refer also to the same document Relocating Code and Data Using the KDS GCC Linker File for Kinetis
2) Initialize external interface
- Use PEx to generate the initialization code of the peripheral you will use to communicate with external memory.
- Copy this code in __init_hardware() function located in Cpu.c inside project folder > Generated Code
If you want to debug this part of the application go to menu Run > debug Configurations > select debug interface to be sued> Startup tab > and write __init_hardware in 'Set breakpoint at:' box.
I hope this helps.
thank you very much!
I will have a try!
with my project, there is no "__init_hardware()"...
Does it only get generated by special circumstances ?
Retrieving data ...