Re: LPC1343 USB ISP trouble

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jul 27, 2010 at 03:13:59AM +0200, Peter Stuge wrote:
> I'm working with the NXP LPC1343 ARM Cortex-M3 microcontroller. This
> is a small one, it doesn't run Linux at all. It does however have a
> full speed USB 2.0 peripheral built-in.

> --8<-- me blindly trying a few sg commands
> # sg_ident /dev/sdb
> Report identifying information command, device not ready
> # sg_get_config -v /dev/sdb
>     inquiry cdb: 12 00 00 00 24 00 
>   NXP       LPC134X IFLASH    1.0 
>   Peripheral device type: disk
>     Get Configuration cdb: 46 00 00 00 00 00 00 20 00 00 
> <hangs here for ~60 seconds, followed by usb 3-2: reset in dmesg>
> get configuration: transport: Host_status=0x05 [DID_ABORT]
> Driver_status=0x00 [DRIVER_OK, SUGGEST_OK]
> 
> Get Configuration command failed
> # 

It is pretty common for USB devices to not support the full suite of SCSI
commands.  In fact, the vast majority of USB storage devices support a very
limited set of commands; they only support the commands they are likely to
see from one of the "popular" OSes.

> I don't quite understand why it needs to be limited to Windows only,
> but it seems that Linux does *something* different enough that it
> doesn't quite work for me.

My guess is that if you tried the equivalent commands under Windows via a
special utility, it would fail there too.  This isn't really a Linux vs.
Windows issue as much as it is a "device doesn't support all the commands"
issue.

> sdb mounts fine as vfat. In the mounted directory there's a single
> 32kb firmware.bin file, which contains the current flash memory
> contents.

> Resetting again, into the USB ISP mode I can copy the firmware.bin
> file, and it reads back *almost* the same as what I copied there,
> except that it now has 1024 bytes of 0 prepended to it.
> 
> Any ideas about why the device might get the impression that Linux
> wants to write two empty sectors before the real data?

It would seem very improbable that this was caused by a USB storage issue.
I would check a few things:

1) Try fat instead of vfat
2) Are you mounting the whole device or a partition of the device?
Partition detection of x86 partitioning can be problematic; I've seen
devices which are not partitioned fool linux into thinking there is a
partition on the device.

Matt

-- 
Matthew Dharm                              Home: mdharm-usb@xxxxxxxxxxxxxxxxxx 
Maintainer, Linux USB Mass Storage Driver

Now payink attention, please.  This is mouse.  Click-click. Easy to 
use, da? Now you try...
					-- Pitr to Miranda
User Friendly, 10/11/1998

Attachment: pgpY9B9eLHimS.pgp
Description: PGP signature


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux