ts-7000
[Top] [All Lists]

[ts-7000] Re: Functions for Peeking and Poking Memory and I/O

To:
Subject: [ts-7000] Re: Functions for Peeking and Poking Memory and I/O
From: "ccc_mindsz" <>
Date: Fri, 09 Jul 2010 20:47:01 -0000
Hi,

I'm trying to use the peekpoke.h functions in a C program, but every time I try 
to use them the SBC stops working and I don't know why.

I'm including the -mcpu=arm9 flag and I can run inline assembly with no 
problems as long as I don't try to peek or poke.

Any help is greatly appreciated.

The following is a small part of what I'm trying to accomplish, but it freezes 
every time I try to run it:

----------------------------------------------------------------------
#include <stdio.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <unistd.h>
#include "peekpoke.h"

int main(void){

 unsigned long address = 0x80840004;
 unsigned long val;
 int dev_mem;

 dev_mem = open("/dev/mem", O_RDWR|O_SYNC);
 address = (unsigned long) mmap(0, getpagesize(), 
                                PROT_READ|PROT_WRITE,
                                MAP_SHARED, dev_mem,
                                0x80840000);

 val = PEEK32(address + 0x04);

 printf("%X -> %X\n", (unsigned int) address, (unsigned int) val);

  return 0;
}
-------------------------------------------------------------------



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

<Prev in Thread] Current Thread [Next in Thread>
  • [ts-7000] Re: Functions for Peeking and Poking Memory and I/O, ccc_mindsz <=
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU