LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices

Reply
 
Search this Thread
Old 01-23-2011, 04:00 PM   #1
laksh_vishnu
LQ Newbie
 
Registered: Jan 2011
Posts: 13

Rep: Reputation: 0
when trying reading the data from flash, it is ffffffff??.. what does it mean...


when I am try reading data from flash it resulting in ffffffff. The code layout is as follows

This function is called from h/w init module.

Getdata(struct ipdev *dev, struct pci_dev *pci_dev)
{
unsigned long int ret ;
pci_start = pci_resource_start(pci_Dev, 0);
pci_len = pci_resource_len(pci_dev, 0);

ipdev->pciptr = ioremap(pci_start, pci_len);

ret = READL(offset);

}
READL is macro which is defined as ipdev->pciptr + offset
ret has ffffffff. what does this mean?.. is the flash erased?... How can i read the data??.. can anyone help me out?
 
Old 01-23-2011, 08:06 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,758

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
Not a coding gun but 'ffffffff' is equivalent to '-1' which is probably a failure, where does the offset value come from ?
 
Old 01-24-2011, 01:05 AM   #3
laksh_vishnu
LQ Newbie
 
Registered: Jan 2011
Posts: 13

Original Poster
Rep: Reputation: 0
offset is given by the vendor....it is a macro defined...

eX:

FLASH_REG_BASE -> 0x38000

FLASH_REG_DATA -> FLASH_REG_BASE + 0X000

FLASH_REG_ADDR -> FLASH_REG_BASE + 0X080

any clues of failure please?
 
Old 01-24-2011, 10:15 AM   #4
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 3,885

Rep: Reputation: 774Reputation: 774Reputation: 774Reputation: 774Reputation: 774Reputation: 774Reputation: 774
Quote:
Originally Posted by kbp View Post
...but 'ffffffff' is equivalent to '-1'
In one encoding system ffffffff would be the representation for the number more commonly known as -1, however I can't see how that could be relevant here.

When a flash cell is erased, the value is 1. If you have a byte worth of those, that would be 'f' in hex, two bytes 'ff' <German> ...und so weiter, und so forth... </German>*

*Not quite clear why German sounded like the right language to this in, but, roughly 'etc, etc' and it allowed me to get 'Forth' into an unrelated question.
 
Old 01-25-2011, 03:12 AM   #5
cnxsoft
Member
 
Registered: Nov 2010
Location: Thailand
Distribution: Fedora 12, Ubuntu 10.10
Posts: 166

Rep: Reputation: 29
Can you print the errno ?

Quote:
fprintf(stderr, "READL Failed: %d, %s\n", errno, strerror(errno))
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Serial port : Read data problem, not reading complete data anujmehta Linux - Networking 5 09-06-2010 06:10 AM
reading from flash memory bony Programming 2 03-21-2010 11:31 PM
eth0: Transmit timed out, status ffffffff, CSR12 ffffffff papitu76 Linux - Hardware 0 03-24-2005 05:51 AM
reading data from a file afrm Programming 2 12-16-2003 07:43 PM
Reading COM Port Data croakofonix Programming 1 06-11-2003 04:17 PM


All times are GMT -5. The time now is 04:40 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration