Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
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.


  Search this Thread
Old 01-23-2011, 05:00 PM   #1
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, 09:06 PM   #2
Senior Member
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 652Reputation: 652Reputation: 652Reputation: 652Reputation: 652Reputation: 652
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, 02:05 AM   #3
LQ Newbie
Registered: Jan 2011
Posts: 13

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


FLASH_REG_BASE -> 0x38000



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

Rep: Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896
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, 04:12 AM   #5
Registered: Nov 2010
Location: Thailand
Distribution: Fedora 12, Ubuntu 10.10
Posts: 166

Rep: Reputation: 29
Can you print the errno ?

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


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 07:10 AM
reading from flash memory bony Programming 2 03-22-2010 12:31 AM
eth0: Transmit timed out, status ffffffff, CSR12 ffffffff papitu76 Linux - Hardware 0 03-24-2005 06:51 AM
reading data from a file afrm Programming 2 12-16-2003 08:43 PM
Reading COM Port Data croakofonix Programming 1 06-11-2003 05:17 PM > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 03:55 AM.

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