Arm Community
Site
Search
User
Site
Search
User
Support forums
Arm Development Studio forum
Dynamic (Runtime) ITCM (Instruction Scratchpad Memory) Allocation
Jump...
Cancel
Locked
Locked
Replies
2 replies
Subscribers
119 subscribers
Views
3002 views
Users
0 members are here
Options
Share
More actions
Cancel
Related
How was your experience today?
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
Dynamic (Runtime) ITCM (Instruction Scratchpad Memory) Allocation
Amir Mahdi Hosseini Monazzah
over 12 years ago
Note: This was originally posted on 12th May 2012 at
http://forums.arm.com
Hi,
These days my important question is about how to allocate ITCM (Instruction Scratchpad Memory) of ARM926ej-s. for doing this, i use scatter loading and part my code to some definite area of my memory, each area contain a function, then i define a function pointer and before running this part of program with aid of memcopy() function, i copy the function from it's address in main memory to ITCM Area, and change the address of function pointer to the new location of it in ITCM. this method already works for ordinary program wich has only operation like multiply, divide and ..., but when the function is more complex and use c library function or any other linker symbols, then after relocating the program crash, when it arrive at that symbols. for debugging this problem i searched the disassembled code and find that by memcopy() i can't take thew linker symbols to the itcm, infact after relocation a primary code like " BL _rt_sdiv" changes to "BL 0xffef0000". i've also try to constructe a symdef file and use it as linker symbol table, but unfortunately this method didn't work.
now my primary question is "How to Allocate The ITCM dynamically without needing to implement all the c function library again?"
Sincerely,
A.M.H.Monazzah
Peter Harris
over 12 years ago
Note: This was originally posted on 13th May 2012 at
http://forums.arm.com
Can you define "crash" in more detail? Does it segfault, give invalid instruction, etc?
If you have a mix of ARM and Thumb then make sure you set the bottom bit of the jump address to 1 if the function in TCM is a Thumb entry point, or you are going to get interworking faults.
Cancel
Vote up
0
Vote down
Cancel
Scott Douglass
over 12 years ago
Note: This was originally posted on 14th May 2012 at
http://forums.arm.com
If you can arrange to iniitalize the ITCM so that it's ready to be loaded before scatter loading then I'd suggest that you try scatter loading the desired code directly into the ITCM instead of using memcpy "by hand". That way the debug symbols will be right. (But I haven't done this myself, so there may be problems I don't know about.)
If you have to do the memcpy, then the functions that you relocate need to be built /ropi so that they are position-independant.
Cancel
Vote up
0
Vote down
Cancel