I personally have not tried this, but have you thought about trying to use 
mmap to link the device driver io file directly into memory?

Walt


On Monday, March 3, 2014 2:48:10 PM UTC-6, [email protected] wrote:
>
> I've got a BeagleBone Black running Angstrom, and I want to directly 
> access the ARM335 registers from my C/C++ programs.  A trivial example 
> would be to "read" the Device_ID at memory location 0x44E10600.  To do this 
> I tried: 
>
> #include <iostream>
> using namespace std;
>
> unsigned long int *p;
> unsigned long int DevID = 0x44E10600;
>
> p1 = DevID;  // <= this gives a compiler error: "invalid conversion from 
> 'long unsigned int' to 'long unsigned int*'
> cout << *p1 << endl;  // <= if I "cheat" around the compiler error, I get 
> a Segmentation fault from this statement
>
> // etc
>
> Note 1: just the p1 = DevI statement causes a fatal compiler error (as 
> indicated in the comment.  
> Note 2: I can get around this by using the -fpermissive compiler option, 
> but then the cout statement (or any other way of extracting the contents of 
> that memory location) gives me the segmentation fault.
>
> I *think* this is a permissions thing -- which means I ought to be able to 
> fix it with some command.  Is this correct?  In any case, can someone tell 
> me how to read/write to a particular memory location using c/c++?  Much 
> obliged!
>
> BDD
>
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to