during the programming of an application for the CM4, I found that the total size of TCM is 256k,
this size is too small to realize my product application.
So I plan to enable OCRAM for the CM4, take i.MX8x QuadlXPlus for example,
I want to use TCM as code section and OCRAM as data section.
Does anybody know if it’s is even possible and what I have to change in my configurations?
Every help is appreciated.
Starting with the good news first: yes, you can split up your code and data between TCM and OCRAM.
I don’t have the details ready to hand out to you, but I can explain you the basic principle:
- modify your linker description file *:ld to include sections for both the TCM and OCRAM.
- define which parts of the code and/or data will be placed in which section.
This can be done either by rules in the linker description file, or by compiler directives in your source code.
If you are using *.elf files for your binary application, that’s all you need to do. The *elf file will contain multiple memory regions, so the code will be automatically loaded to the correct address.
Please note that OCRAM is massively slower than TCM (on i.MX7 this was a factor of about 10x), so make sure you place performance-critical code and often-accessed data into TCM.