[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/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 - ssize_t e_read

ssize_t e_read

Discussion about Parallella (and Epiphany) Software Development

Moderators: amylaar, jeremybennett, simoncook

ssize_t e_read

Postby gordon » Tue Jun 06, 2017 10:43 am

gordon
 
Posts: 24
Joined: Mon May 29, 2017 10:37 am

Re: ssize_t e_read

Postby CocoaGeek » Tue Jun 06, 2017 2:58 pm

Hello,

Couple of things:

- If you are only reading a single float, buf0 doesn't need to be a pointer but just a float variable
- It looks like you have a "ssize_t *" before your call to e_read. That's incorrect. You should be assigning the return value of e_read to a variable, ignoring it, or directly comparing the value to sizeof(float).

Hope this help.
CocoaGeek
 
Posts: 29
Joined: Thu Apr 13, 2017 3:56 am

Re: ssize_t e_read

Postby gordon » Wed Jun 07, 2017 5:49 am

I have tried removing ssize_t and declaring buff just as a pointer. But now it shows dev is undeclared. I tried initializing it in the device program as (e_epiphany_t dev;) for which i need to use <e-hal.h> but then it terminates when i include the library.
gordon
 
Posts: 24
Joined: Mon May 29, 2017 10:37 am

Re: ssize_t e_read

Postby nickoppen » Wed Jun 07, 2017 6:21 am

Looking at your code the second parameter of e_read is not the epiphany device. Look in the epiphany_sdk_ref (page 95) for an explanation of the parameters.

Yes you have declared buf as a pointer but you have not allocated any memory for the actual value. If it is a local variable declare it float buf; and then if you need it as a typeless pointer you need to de-reference it and then type cast it (void *)&buf;.

This is what C programming is like. You just have to scratch your head until you figure it out.
Sharing is what makes the internet Great!
User avatar
nickoppen
 
Posts: 266
Joined: Mon Dec 17, 2012 3:21 am
Location: Sydney NSW, Australia

Re: ssize_t e_read

Postby gordon » Wed Jun 07, 2017 6:28 am

I have used ssize_t e_read which is mentioned under the data transfer functions part of the manual (Page no.131)

and its synstax goes like this:

ssize_t e_read(void *dev, unsigned row, unsigned col, off_t from_addr, void *buf, size_t size)

When i declare this statement in the device code, it gives me dev undeclared, but i cant use e-hal.h library in my device code. But which i declare the same statement in host code I'm getting a segmentation error.
gordon
 
Posts: 24
Joined: Mon May 29, 2017 10:37 am

Re: ssize_t e_read

Postby sebraa » Wed Jun 07, 2017 10:37 am

You are only supposed to use e_read() in the host code. The device code doesn't use it.
sebraa
 
Posts: 495
Joined: Mon Jul 21, 2014 7:54 pm

Re: ssize_t e_read

Postby GreggChandler » Wed Jun 07, 2017 11:23 pm

Although I don't use e_read() on the Epiphany cores, (I use memory pointers and move functions,) the eSDK does document the use of e_read() and e_write() on the Epiphany core (p. 95 of the Epiphany_sdk_ref, section 13.15.2). One must be careful, as the use documented on the host (p. 131, section 14.4.2) uses slightly different parameters. In particular, compare parameter pay attention to parameter 1. In summary, there is an e-lib version and a e-hal version. The function is declared in the appropriate header (.h) file.
GreggChandler
 
Posts: 66
Joined: Sun Feb 12, 2017 1:56 am


Return to Programming Q & A

Who is online

Users browsing this forum: No registered users and 4 guests

cron