Solved

Write into an internal register on ADS target

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

706 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now