Solved

Write into an internal register on ADS target

Posted on 2004-10-10
1
175 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 500 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

825 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