Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Write into an internal register on ADS target

Posted on 2004-10-10
1
Medium Priority
?
180 Views
Last Modified: 2010-04-22
Hello,

Genaral:
I'm working with Montavista Linux 3.1 Embedded Development Kit( pro ) on Motorola M9328MXLADS Evaluation Board( has i.MX1 DragonBall Application Processor on it ).
I'm using NFS Cross Compile.

Problem Description:
When I'm trying to debug my code( via Telnet ) the following announcement appears:
"Segmantation problem".

My code:
#define DDIR_A       (*(volatile unsigned int *)(0x0021C000) // Absulote address
DDIR_A = 0x00000004;                                      // Output signal

Could someone help me? I have heard on "mmap" fuction, is it could be helpful?
Thanks.
0
Comment
Question by:nirbena
1 Comment
 
LVL 11

Accepted Solution

by:
dimitry earned 2000 total points
ID: 12272654
From application you need to do something like this:
int fd;
volatile unsigned long *ddir_a;

fd = open("/dev/mem", O_RDWR | O_SYNC);
ddir_a = (volatile unsigned long *)mmap(0,0x1000, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0x0021C000);

*ddir_a = 0x00000004;

munmap((void *)ddir_a, 0x1000);
close(fd);
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question