Solved

Write into an internal register on ADS target

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
whats a headless user in linux 3 372
making an rpm that just copies the entire project 2 61
Unix / Linux grid computing 5 167
Shell script for mvn build 2 78
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…

680 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