[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Parallella Community • View topic - How do I place the libaplc library in external memory ?

How do I place the libaplc library in external memory ?

Discussion about Parallella (and Epiphany) Software Development

Moderators: amylaar, jeremybennett, simoncook

How do I place the libaplc library in external memory ?

Postby Dr.BeauWebber » Sun Jun 02, 2013 12:07 pm

User avatar
Dr.BeauWebber
 
Posts: 114
Joined: Mon Dec 17, 2012 4:01 am
Location: England

Re: How do I place the libaplc library in external memory ?

Postby Dr.BeauWebber » Sun Jun 02, 2013 5:46 pm

User avatar
Dr.BeauWebber
 
Posts: 114
Joined: Mon Dec 17, 2012 4:01 am
Location: England

Re: How do I place the libaplc library in external memory ?

Postby ed2k » Tue Jun 04, 2013 6:08 am

does it work on legacy.ldf? I mean try the other way around, start from legacy.ldf and move the needed lib into internal.
as mentioned in this post
ed2k
 
Posts: 113
Joined: Mon Dec 17, 2012 3:27 am

Re: How do I place the libaplc library in external memory ?

Postby Dr.BeauWebber » Tue Jun 04, 2013 10:40 am

Thanks yes that partly works, I am using the legacy.ldf at the moment.
I have two problems :
1) I am using a buffer as a buffer for std out replacement, and that is overlapping the working program, I do not know how to separate them using the .ldf.
2) when I try and move functions they 'are not found' I think my syntax is wrong

- is there a .ldf guide anywhere ? Is it particular to the parallella ? I have seen some for the Blackfin, but that looks different.
User avatar
Dr.BeauWebber
 
Posts: 114
Joined: Mon Dec 17, 2012 4:01 am
Location: England

Re: How do I place the libaplc library in external memory ?

Postby ysapir » Tue Jun 04, 2013 5:01 pm

When using the legacy or fast profiles, some code is placed at the external memory. Normally, it will occupy a 1MB-pre-core region, starting at 0x8e000000. This means that the code will occupy up to 16MB of the external space.

The upper 16MB are allocated for the program heap, again, 1MB per core. When using malloc(), *printf() and other stdio functions that use malloc internally, they will use this heap space for their operation. If you look carefully you'll notice that the heap segments are locates in the "shared_dram" section. This means that what you see is most probably the heap running over your mailbox, or vice-versa.

If this is indeed the case, you can solve it by doing one of these:

1. Using a custom LDF, shrink down the heap and locate it in the upper part of "shared_dram";

2. Assuming that the program operation does not require too much heap space, and that the heap grows linearly, you can place your mailbox in the upper area of the section. In order to do this, you can:

2.1. Change your outbuf from a string to a pointer and assign it a specific address (say 0x8fffff00), discarding the SECTION() attribute. Remember to change the mailbox address in the host program accordingly;

2.2. In a custom LDF, define a new section in a specific address (say 0x8fffff00) and change the outpuf attribute to that section name. See the matmul example for an how-to reference.

The GNU website has a reference manual for linker scripts, if you want to go deeper in the LDF mechanics:



and here's another one:

User avatar
ysapir
 
Posts: 393
Joined: Tue Dec 11, 2012 7:05 pm

Re: How do I place the libaplc library in external memory ?

Postby Dr.BeauWebber » Wed Jun 05, 2013 12:33 am

User avatar
Dr.BeauWebber
 
Posts: 114
Joined: Mon Dec 17, 2012 4:01 am
Location: England

Re: How do I place the libaplc library in external memory ?

Postby ysapir » Wed Jun 05, 2013 1:00 am

From a glance, before really verifying your LDF code, I think that the host buffer address should be 0x01fff000, and not 0x00fff000 (I assume that the buffer is above the heap, and the heaps start at 0x01000000).

Also, there is a problem with e_alloc() when the offset is not a multiple of page size (4KB on this system), which is why you get the mmap() failure when allocating the 128 bytes buffer. I am actually right now working on a fix for this problem, which I found a couple of days ago, so it should be OK in the next release.
User avatar
ysapir
 
Posts: 393
Joined: Tue Dec 11, 2012 7:05 pm

Re: How do I place the libaplc library in external memory ?

Postby Dr.BeauWebber » Wed Jun 05, 2013 7:32 am

User avatar
Dr.BeauWebber
 
Posts: 114
Joined: Mon Dec 17, 2012 4:01 am
Location: England

Re: How do I place the libaplc library in external memory ?

Postby Dr.BeauWebber » Wed Jun 05, 2013 7:58 am

User avatar
Dr.BeauWebber
 
Posts: 114
Joined: Mon Dec 17, 2012 4:01 am
Location: England

Re: How do I place the libaplc library in external memory ?

Postby ysapir » Wed Jun 05, 2013 3:06 pm

User avatar
ysapir
 
Posts: 393
Joined: Tue Dec 11, 2012 7:05 pm

Next

Return to Programming Q & A

Who is online

Users browsing this forum: No registered users and 3 guests

cron