2009-05-04 12:35:08 "Unable to open..." error
Jim Carstensen (UNITED STATES)
Message: 73577
Trying to get back to what Robin had sent many weeks ago on a BF537 Stamp board to run MP3Play using CF card adapter.
Using trunk. CVS upped Friday (5/1) afternoon.
Builds OK, LoadsOK, Boots OK. (Attached Terminal snippet)
Here's what I get:
root:/> mount -t vfat/mnt/dev/sda1
root:/>mp3play /mnt/snd00001.mp3
ERROR: Unable to open 'mnt/snd00001.mp3', errno=2
I'm not sure what errno=2 refers to.
I know for sure that the specified file is on the CF card. I checked. And it played before I loaded a new image.
any ideas?
thanks,
JC
log5_4.txt
QuoteReplyEditDelete
2009-05-04 12:45:38 Re: "Unable to open..." error
Mike Frysinger (UNITED STATES)
Message: 73579
simply look up errno in the header files if you dont know what it is:
$ echo '#include<errno.h>' | bfin-linux-uclibc-gcc -E -dD -P - | grep '\<E.*\<2\>'
#define ENOENT 2
looks to me like your `mount` command is wrong. you sure it didnt result in an error or did you not type it in your forum message properly ?
why dont you use `ls` and such on /mnt to see what is actually in there
QuoteReplyEditDelete
2009-05-04 13:03:43 Re: "Unable to open..." error
Jim Carstensen (UNITED STATES)
Message: 73582
Thanks for the info on how to find the errno.
I didn't get any error message with the mount command.
I did try this: mount /dev/sda1 /mnt/ and it resulted in:
mount: mounting /dev/sda1 on /mnt/ failed: No such file or directory
An ls in /mnt results in nothing.
thanks,
JC
QuoteReplyEditDelete
2009-05-04 14:41:53 Re: "Unable to open..." error
Robin Getz (UNITED STATES)
Message: 73585
Jim:
If you are getting "no such file" it either means that /dev/sda1 isn't there, or /mnt isn't there...
Which is it?
-Robin
QuoteReplyEditDelete
2009-05-04 14:57:28 Re: "Unable to open..." error
Jim Carstensen (UNITED STATES)
Message: 73586
Robin -
It appears that sda1 isn't happening:
root:/> ls
bin etc init mnt root sys usr
dev home lib proc sbin tmp var
root:/> cd mnt
root:/mnt> ls
root:/mnt> cd ..
root:/> cd dev
root:/dev> ls
console ptmx ram3 stdin
cpu_dma_latency pts ram4 stdout
dsp ram0 ram5 timer
fd ram1 ram6 tty
full ram10 ram7 ttyBF0
kmsg ram11 ram8 urandom
log ram12 ram9 watchdog
mem ram13 random zero
network_latency ram14 rtc0
network_throughput ram15 snd
null ram2 stderr
root:/dev>
QuoteReplyEditDelete
2009-05-04 15:08:30 Re: "Unable to open..." error
Robin Getz (UNITED STATES)
Message: 73587
Jim:
Do you have the proper pata platform driver for CF compiled into the kernel?
-Robin
QuoteReplyEditDelete
2009-05-04 15:19:37 Re: "Unable to open..." error
Jim Carstensen (UNITED STATES)
Message: 73589
Probably not. And that's the entire problem. Trying to figure out exactly what to check/uncheck in the menuconfig selections to make an image like the original has been a challenge.
Is there a file that contains these selections? One that perhaps you can send to me that I can work from. It would be nice to develop from a working base.
thanks,
JC
QuoteReplyEditDelete
2009-05-04 15:48:32 Re: "Unable to open..." error
Robin Getz (UNITED STATES)
Message: 73591
Jim:
In a running system - there is always /proc/config.gz (or there is an option to be).
Is there in your older (working) system?
-Robin
QuoteReplyEditDelete
2009-05-04 15:52:22 Re: "Unable to open..." error
Jim Carstensen (UNITED STATES)
Message: 73592
Robin -
No. A working system no longer exists. Remember you sent me a Stamp with the Image already burned in Flash. I've never had a buildable and functional source before. That's what I'm working towards, here.
JC
QuoteReplyEditDelete
2009-05-04 16:33:09 Re: "Unable to open..." error
Mike Frysinger (UNITED STATES)
Message: 73593
it depends on how you want to utilize the CF slot. if it's true ide mode, then review:
docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:pata_platform
QuoteReplyEditDelete
2009-05-04 16:36:47 Re: "Unable to open..." error
Robin Getz (UNITED STATES)
Message: 73594
Jim:
You erased the image in flash? If so, then you can try from these instructions (it took me a few times of hit and miss before I got things figured out).
QuoteReplyEditDelete
2009-05-04 16:49:28 Re: "Unable to open..." error
Jim Carstensen (UNITED STATES)
Message: 73595
OK, great. I'll take a look at those docs.
Our project development requires a few changes to the baseline setup that you originally provided, not the least of which is increasing the channel capacity beyond 3 stereos (to 8) using AD1938 dacs. So I need to be able to build from scratch, burn Flash, and move towards this configuration.
I do see someone in the forum that is doing this AD1938 implementation already, so if we get too wrapped around the axle I'll try to consult with him directly and see if we can work something out. But before that I need to be able to build something that works with the hardware we have. I'm close.
thanks,
JC
QuoteReplyEditDelete
2009-05-05 11:22:39 Re: "Unable to open..." error
Jim Carstensen (UNITED STATES)
Message: 73671
Mike, Robin -
Looking at the documents you referenced it appears that they may be somewhat outdated, as the menuconfig selections for the trunk build I'm using do not correspond well to the screenshots, etc.
That said, I am in the process of trying all the different permutations of ATA/PCMCIA/CF Card/PATA selections in the Kernal Configuration, of which there are several.
Under Bus Options: PCCard (PCMCIA/CardBus) support appears 5 selections, including 16-bit PCMCIA support and Blackfin CompactFlash PCMCIA Driver
Undedr Device Drivers, ther appears ATA/ATAPI/MFM/RLL support AND Serial ATA and Parallel ATA drivers - this is similar to the one of the documents you referred me to, but not exactly the same.
Looking at a terminal snippit from a working system included in an early email from Robin it shows:
> regs_base@ffc00500, dma channel@7 bfin_cf_pcmcia bfin_cf_pcmcia: Blackfin
> CompactFlash/PCMCIA Socket Driver bfin_cf_pcmcia bfin_cf_pcmcia: : on irq
> 54
and then when userspace takes over...
> pcmcia_socket pcmcia_socket0: pccard: PCMCIA card inserted into slot 0
> pcmcia 0.0: pcmcia: registering new device pcmcia0.0
> scsi0 : pata_pcmcia
> ata1: PATA max PIO0 cmd 0x20310000 ctl 0x2031000e irq 54
> ata1.00: CFA: CF2GHS, 20080116, max MWDMA4
> ata1.00: 3980592 sectors, multi 0: LBA
> ata1.00: Drive reports diagnostics failure. This may indicate a drive
> ata1.00: fault or invalid emulation. Contact drive vendor for information.
> ata1.00: configured for PIO0
> scsi 0:0:0:0: Direct-Access ATA CF2GHS 2008 PQ: 0 ANSI:
> 5 sd 0:0:0:0: [sda] 3980592 512-byte hardware sectors: (2.03 GB/1.89 GiB)
> sd 0:0:0:0: [sda] Write Protect is off
> sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't
> support DPO or FUA sd 0:0:0:0: [sda] 3980592 512-byte hardware sectors:
> (2.03 GB/1.89 GiB) sd 0:0:0:0: [sda] Write Protect is off
> sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't
> support DPO or FUA sda: sda1
> sd 0:0:0:0: [sda] Attached SCSI removable disk
> sd 0:0:0:0: Attached scsi generic sg0 type 0
So it appears that the scsi0 interface is somehow involved?
I'll keep shotgunning this, but any advice to help me save some time and sanity wold be appreciated.
thanks,
JC
QuoteReplyEditDelete
2009-05-05 13:08:19 Re: "Unable to open..." error
Jim Carstensen (UNITED STATES)
Message: 73676
A bit more info...
Following the guidelines in this doc
docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:pata_platform
Results in the following complaints while booting:
Uniform Multi-Platform E-IDE driver
Driver 'sd' needs updating - please use bus_type methods
Driver 'sr' needs updating - please use bus_type methods
scsi0 : pata_platform
ata1: PATA max PIO0 mmio cmd 0x20314020 ctl 0x2031401c irq 55
irq 55: nobody cared (try booting with the "irqpoll" option)
Hardware Trace:
0 Target : <0x00004938> { _dump_stack + 0x0 }
Source : <0x0002c274> { ___report_bad_irq + 0x1c } CALL pcrel
1 Target : <0x0002c274> { ___report_bad_irq + 0x1c }
.....
handlers:
[<000e74c0>] (_ata_sff_interrupt+0x0/0x190)
Disabling IRQ #55
bfin-spi bfin-spi.0: Blackfin on-chip SPI Controller Driver, Version 1.0, regs_base@ffc00500, dma channel@7
JC
QuoteReplyEditDelete
2009-05-05 16:29:20 Re: "Unable to open..." error
Mike Frysinger (UNITED STATES)
Message: 73702
your kernel output now shows /dev/sda1 being found, so what's the problem ?
QuoteReplyEditDelete
2009-05-05 17:00:49 Re: "Unable to open..." error
Jim Carstensen (UNITED STATES)
Message: 73707
Using the guidelines outlined in the documents you referenced (or as close as I can get, because the menuconfig selections have changed significantly since those docs were originally composed), and trying about 9 different permutations, I've had no luck whatsoever getting the system to recognize the CF card.
This is also true for the true ide mode document you refer to. The menuconfig selections for the trunk release I'm using (checked out 5/1) does not match up very well with what is shown in the document. Specifically, the 'Serial ATA (prod) and Parallel ATA (experimental) selectons are way different.
Trying:
root:/> mount /dev/sda1 /mnt/
mount: mounting /dev/sda1 on /mnt/ failed: No such file or directory
root:/>
root:/dev> ls
console pcmC0D0c ram15 snd
controlC0 pcmC0D0p ram2 stderr
cpu_dma_latency ptmx ram3 stdin
fd pts ram4 stdout
full ram0 ram5 tgt
kmsg ram1 ram6 timer
log ram10 ram7 tty
mem ram11 ram8 ttyBF0
network_latency ram12 ram9 urandom
network_throughput ram13 random watchdog
null ram14 rtc0 zero
So I'm sort of stuck. I know Robin got this to work, but perhaps the trunk I'm using has broken the CF/PATA driver stuff? It seems like it shouldn't be that big of a deal to get this to work using some of the basic menuconfig selections, etc.
thanks,
JC
QuoteReplyEditDelete
2009-05-05 17:11:38 Re: "Unable to open..." error
Michael Hennerich (GERMANY)
Message: 73710 Can you detail the HW you are using?
-Michael
QuoteReplyEditDelete
2009-05-05 17:13:38 Re: "Unable to open..." error
Jim Carstensen (UNITED STATES)
Message: 73711
Regarding your last post about the sda1 Mike, are sure you weren't looking at the terminal snippet of the working system that Robin emailed to me a few weeks ago which I had pasted into my post for reference?
JC
QuoteReplyEditDelete
2009-05-05 17:18:06 Re: "Unable to open..." error
Jim Carstensen (UNITED STATES)
Message: 73712
Yes. Here's my HW setup.
BF537 Stamp V2.1
CF/IDE-ATA/NAND BF537 Stamp Extender
Stamp/Sport AD1836A V0.9
CF Extender has a CF card that is known good, and was working in the system with an image that Robin built a few weeks ago.
thanks.
QuoteReplyEditDelete
2009-05-05 17:37:18 Re: "Unable to open..." error
Michael Hennerich (GERMANY)
Message: 73715 There are at least three different interfaces on CF cards allowing you
to interface with current Linux kernels.
1) TRUE IDE MODE (Requires ATA_SEL asserted Low during card reset) not
the default case for the CF-IDE-NAND Card
2) Common Memory Mode
3) PC-CARD IO Mode (using the PCMICA bus and Card Service Drivers)
If you use svn trunk -
Take a look here:
docs.blackfin.uclinux.org/doku.php?id=hw:cards:cf-ide-nand
and you need to define -
#define CF_IDE_NAND_CARD_USE_CF_IN_COMMON_MEMORY_MODE
This will use this pata_platfrom config:
static struct pata_platform_info bfin_pata_platform_data = {
.ioport_shift = 0,
};
/* CompactFlash Storage Card Memory Mapped Adressing
* /REG = A11 = 1
*/
static struct resource bfin_pata_resources[] = {
{
.start = 0x20211800,
.end = 0x20211807,
.flags = IORESOURCE_MEM,
},
{
.start = 0x2021180E, /* Device Ctl */
.end = 0x2021180E,
.flags = IORESOURCE_MEM,
},
};
#endif
static struct platform_device bfin_pata_device = {
.name = "pata_platform",
.id = -1,
.num_resources = ARRAY_SIZE(bfin_pata_resources),
.resource = bfin_pata_resources,
.dev = {
.platform_data = &bfin_pata_platform_data,
}
};
-Michael
QuoteReplyEditDelete
2009-05-06 09:16:51 Re: "Unable to open..." error
Jim Carstensen (UNITED STATES)
Message: 73757
Thanks, Michael.
Hey Robin - Do you remember how you originally set up this interface? True IDE, Common Memory, or IO?
JC
QuoteReplyEditDelete
2009-05-06 09:27:51 Re: "Unable to open..." error
Robin Getz (UNITED STATES)
Message: 73758
Jim:
This is the config I was using (although I think I may have tweaked it for some other things I was working on at the same time). - If it works great - if it doesn't let me know, and I'll try it out on some hardware I have here.
-Robin
config
QuoteReplyEditDelete
2009-05-06 10:45:06 Re: "Unable to open..." error
Jim Carstensen (UNITED STATES)
Message: 73764
Thanks, Robin.
I tried the config. Attached is a log of the terminal output during boot. Looks like it crashed.
Unless I did something wrong loading it. I ran menuconfig, selected 'Load an Alternate Configuration File' and pointed it to the file you sent. Then saved it. The system digested for awhile and did it's own make clean, etc. (which I would normally run ahead of make, but it did it) Then I just did a make. No errors. Rebooted.
thanks.
JC
log
QuoteReplyEditDelete
2009-05-06 11:03:01 Re: "Unable to open..." error
Robin Getz (UNITED STATES)
Message: 73765
Jim:
You must of done something wrong . Your log shows:
Compiled for ADSP-BF518 Rev 0.0
And my .config had : CONFIG_BF537=y
Just replace your linux-2.6.x/.config file with the one I sent.
-Robin
QuoteReplyEditDelete
2009-05-06 11:06:23 Re: "Unable to open..." error
Jim Carstensen (UNITED STATES)
Message: 73766
Hmmmm...
Don't see any .config file here:
alcorn@alcorn-linux:~/blackfin-sources/uclinux-dist/linux-2.6.x$ ls
arch fs localversion-adi net usr
block include MAINTAINERS README virt
COPYING init MAKEALL REPORTING-BUGS vmlinux
CREDITS ipc Makefile samples vmlinux.o
crypto Kbuild mm scripts
Documentation kernel modules security
drivers lib modules.order sound
firmware linux Module.symvers System.map
QuoteReplyEditDelete
2009-05-06 11:24:33 Re: "Unable to open..." error
Michael Hennerich (GERMANY)
Message: 73769 >Don't see any .config file here:
Try: alcorn@alcorn-linux:~/blackfin-sources/uclinux-dist/linux-2.6.x$ ls -al
-Michael
QuoteReplyEditDelete
2009-05-06 11:26:44 Re: "Unable to open..." error
Jim Carstensen (UNITED STATES)
Message: 73770
DOH!
QuoteReplyEditDelete
2009-05-06 11:35:48 Re: "Unable to open..." error
Jim Carstensen (UNITED STATES)
Message: 73772
Please see attached log.
Did make clean prior.
log2
QuoteReplyEditDelete
2009-05-06 16:33:42 Re: "Unable to open..." error
Robin Getz (UNITED STATES)
Message: 73781
Jim:
/home/alcorn/blackfin-sources/uclinux-dist/linux-2.6.x/arch/blackfin/mach-bf537/include/mach/bf537.h:136:2: error: #error "Unknown CPU type - This kernel doesn't seem to be configured properly"
try "make oldconfig"
-Robin
QuoteReplyEditDelete
2009-05-07 15:27:29 Re: "Unable to open..." error
Adam Rosenberg (UNITED STATES)
Message: 73834
Robin,
I am now working on this project with Jim. "make oldconfig" does not work. However, I was able to gain access to the CF card by compiling a basic kernel using "make xconfig" and then loading the following kernel modules at runtime:
nls_iso8859_1, nls_cp437, nls_base,
vfat, msdos, fat,
ide_gd_mod, ide_cs, ide_core,
pcmcia, bfin_cf_pcmcia, pcmcia_core
This detects the flash card as hda and the partition as hda1 which I can then mount and view files. If this is not the correct way to access the CF card, please let me know. If it is ok, then I will switch gears and try to get the sound working as well (which I had to remove because the AD1836 seemed to be conflicting with the CF card in the way we had it configured)
Thanks,
Adam
-
Adam Rosenberg
Software Engineer
Alcorn McBride Inc.
QuoteReplyEditDelete
2009-05-07 16:05:03 Re: "Unable to open..." error
Adam Rosenberg (UNITED STATES)
Message: 73835
Robin,
I was able to get the common memory mode to work by changing stamp.c
Instead of #define CF_IDE_NAND_CARD_USE_HDD_INTERFACE, I changed it to
#define CF_IDE_NAND_CARD_USE_CF_IN_COMMON_MEMORY_MODE
This fixed the problem I was having when trying to load the pata_pcmcia module
I can now mount the CF card from /dev/sda1
-Adam
QuoteReplyEditDelete
2009-05-08 12:12:59 Re: "Unable to open..." error
Robin Getz (UNITED STATES)
Message: 73892
Adam:
The trick of getting audio working - is just making sure you use an unused SPI select pin for the AD1836.
-Robin
QuoteReplyEditDelete
2009-05-08 16:35:38 Re: "Unable to open..." error
Adam Rosenberg (UNITED STATES)
Message: 73901
Robin,
Thank you for the tip, our config file was set to the wrong SPI value. I have the audio and compact flash card working now. I had the audio related drivers build into the kernel and the CF card related drivers build as modules. At some point I will try to build everything into the kernel but for the moment, this works. The next step is to find out how multiple instances of mp3play are able to select between the 3 stereo outputs so that we can explicitly select the channels to use for playback.
Thanks,
Adam
QuoteReplyEditDelete
2009-05-11 15:21:33 Re: "Unable to open..." error
Robin Getz (UNITED STATES)
Message: 73961
Adam:
I don't have a setup infront of me to test, but I think there should be seperate /dev/dspn (n=0,1,2), -- from looking at the source, mp3play takes an option -d device - so " -d /dev/dsp2 " should always play from that channel.
-Robin