To: | |
---|---|
Subject: | [ts-7000] 7250: MAX197 A/D present |
From: | "overclocker_mmu" <> |
Date: | Thu, 14 Feb 2013 09:28:02 -0000 |
Hi, I've found this code online, trim it just to try the MAX197 present checking. #include <fcntl.h> #include <assert.h> #include <unistd.h> #include<sys/mman.h> #include<sys/types.h> #include<unistd.h> #include<stdio.h> #include <stdlib.h> int main(void) { volatile unsigned short *complete, *data; volatile unsigned char *control; volatile unsigned char *present; int fd = open("/dev/mem", O_RDWR | O_SYNC); if (fd <= 0) { printf("Unable to open /dev/mem\n"); exit(1); } present = (unsigned char *)mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0x22400000); if (present == (unsigned char *)-1) { printf("Unable to mmap the A/D presence register\n"); exit(1); } if ((*present & 1) == 0) { printf("MAX197 A/D converter not present in TS-7250\n"); exit(1); } control = (unsigned char *)mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0x10f00000); if (control == (unsigned char *)-1) { printf("Unable to mmap the A/D control register\n"); exit(1); } data = "" short *)control; complete = (unsigned short *)mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0x10800000); if (complete == (unsigned short *)-1) { printf("Unable to mmap the A/D 'complete' register\n"); exit(1); } close(fd); return 0; } I compile this code by issuing this : arm-unknown-linux-gnu-gcc -Wall -o max197present max197present.c -mcpu=arm9 Then I copy the binary to the board via ftp. I ran the binary and nothing happened. I am expecting "MAX197 A/D converter not present in TS-7250" to appear since I have uninstalled the MAX197 chip. The board is unmodifed running TS-Linux/arm 7.0 Where did I do wrong? __._,_.___
Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required) Change settings via email: =Email Delivery: Digest | m("yahoogroups.com?subject","ts-7000-fullfeatured");=Change Delivery Format: Fully Featured">Switch to Fully Featured Visit Your Group | Yahoo! Groups Terms of Use | =Unsubscribe __,_._,___ |
<Prev in Thread] | Current Thread | [Next in Thread> |
---|---|---|
|
Previous by Date: | [ts-7000] (unknown), varun lodaya |
---|---|
Next by Date: | [ts-7000] Problem in load_ts7300 command, Asim |
Previous by Thread: | [ts-7000] (unknown), varun lodaya |
Next by Thread: | [ts-7000] Problem in load_ts7300 command, Asim |
Indexes: | [Date] [Thread] [Top] [All Lists] |
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