Ticket #1835 (closed defect: fixed)

Opened 11 years ago

Last modified 2 years ago

A better fix for host endianness of dfu-util

Reported by: wiml Owned by: openmoko-devel
Priority: normal Milestone:
Component: host utilities Version:
Severity: normal Keywords: HasPatch
Cc: Blocked By:
Blocking: Estimated Completion (week):
HasPatchForReview: PatchReviewResult:
Reproducible: always

Description

The byte-swapping code in dfu-util depends on some nonportable system headers. Rather than extend autoconf to check more and more systems' headers, I just wrote a portable byteswap routine. (Since the routine is only called once per run of dfu-util, it hardly needs an optimized assembly implementation.) A patch is attached. I can upload and download updates fine from my (big-endian ppc) host.

Attachments

byteorder.patch (1.5 KB) - added by wiml 11 years ago.
A patch to make dfu-util more portable

Change History

Changed 11 years ago by wiml

A patch to make dfu-util more portable

comment:1 Changed 11 years ago by wiml

See also: #684 (original endianness bug report), the change in r2770 (when the code my patch changes was added), and r3830 / r3831 (when said code was made more portable but still unnecessarily system-dependent).

comment:2 follow-ups: ↓ 3 ↓ 5 Changed 11 years ago by RuiSeabra

Although my backup did go on for about 50MB longer than previously, the proposed patch isn't a full fix, unfortunately.

It failed with the same error:

dfu-util - (C) 2007 by OpenMoko Inc.
This program is Free Software and has ABSOLUTELY NO WARRANTY

Opening USB Device 0x0000:0x0000...
Found Runtime: [0x1d50:0x5119] devnum=6, cfg=0, intf=0, alt=6, name="rootfs"
Claiming USB DFU Interface...
Setting Alternate Setting ...
Determining device status: state = dfuERROR, status = 14
dfuERROR, clearing status
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
Transfer Size = 0x1000
dfu_upload error -62

comment:3 in reply to: ↑ 2 Changed 11 years ago by wiml

Replying to RuiSeabra:

dfu_upload error -62

I don't 100% understand the DFU mechanism, but looking at dfu-util it doesn't look to me like your error -62 is an endianness problem. (I don't know what it is, though. Applying the patch I attached to #1842 might produce more informative output. It should probably go in another trac ticket though.)

comment:4 Changed 11 years ago by RuiSeabra

Of two laptops with the same Ubuntu version (8.04, Heron), only fails on the AMD64.

I read somewhere in the wiki that it would fail with that 62 error... but maybe the other report was wrong... I'll check 1842 later on.

comment:5 in reply to: ↑ 2 Changed 11 years ago by roh

Replying to RuiSeabra:

Although my backup did go on for about 50MB longer than previously, the proposed patch isn't a full fix, unfortunately.

please do not confuse this issue (endian problems) with dfu-util upload (device->computer) 'backup' problems.
that is bug #676 / #1843

means your problems in comment:2 and comment:4 have probably nothing do to with this ticket.

comment:6 Changed 11 years ago by zecke

  • Keywords HasPatch added

comment:7 Changed 11 years ago by RuiSeabra

I just retested, and it works for me on the following CPU:

rms@roque:/media/disk/moko/2008.8.26$  cat /proc/cpuinfo 
processor	: 0
vendor_id	: AuthenticAMD
cpu family	: 15
model		: 72
model name	: AMD Turion(tm) 64 X2 Mobile Technology TL-60
stepping	: 2
cpu MHz		: 800.000
cache size	: 512 KB
physical id	: 0
siblings	: 2
core id		: 0
cpu cores	: 2
fpu		: yes
fpu_exception	: yes
cpuid level	: 1
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow rep_good pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy
bogomips	: 1600.03
TLB size	: 1024 4K pages
clflush size	: 64
cache_alignment	: 64
address sizes	: 40 bits physical, 48 bits virtual
power management: ts fid vid ttp tm stc

processor	: 1
vendor_id	: AuthenticAMD
cpu family	: 15
model		: 72
model name	: AMD Turion(tm) 64 X2 Mobile Technology TL-60
stepping	: 2
cpu MHz		: 800.000
cache size	: 512 KB
physical id	: 0
siblings	: 2
core id		: 1
cpu cores	: 2
fpu		: yes
fpu_exception	: yes
cpuid level	: 1
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow rep_good pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy
bogomips	: 1600.03
TLB size	: 1024 4K pages
clflush size	: 64
cache_alignment	: 64
address sizes	: 40 bits physical, 48 bits virtual
power management: ts fid vid ttp tm stc

(which previously didn't, so it worksforme now).

comment:8 Changed 11 years ago by laforge

  • Status changed from new to closed
  • Resolution set to fixed

Thanks, I've applied the patch to subversion (Rev. 4696)

comment:9 Changed 2 years ago by RoberMync

Does Keflex Interfere With Depro Provera <a href=http://cial5mg.xyz/low-price-cialis.php>Low Price Cialis</a> Precio Levitra 20 Mg Can I Get Cymbalta In Mexico <a href=http://cial5mg.xyz/buying-cialis-online.php>Buying Cialis Online</a> Descargar Kamagra En Espana Amoxicillin Dosage Dental <a href=http://zol1.xyz/zoloft-free-trial.php>Zoloft Free Trial</a> Buy Lasix Cheap Legitimate Propecia Depression Sperm <a href=http://zol1.xyz/zoloft-pills.php>Zoloft Pills</a> Finasteride Where Can I Buy Buy Brand Name Accutane <a href=http://nolvadex.ccrpdc.com/order-nolvadex-no-prescription.php>Order Nolvadex No Prescription</a> Dental Infection Keflex Erythromycin Noble Drug Store Reviews <a href=http://cial1.xyz/order-cialis-in-usa.php>Order Cialis In Usa</a> Dutasteride Dutas Store Generique Priligy Inde <a href=http://zol1.xyz/zoloft-no-prescription-fast.php>Zoloft No Prescription Fast</a> Venta De Kamagra Por Internet Finasteride Farmaco Propecia <a href=http://cial1.xyz/buy-cheap-cialis-site.php>Buy Cheap Cialis Site</a> Where To Buy Levitra Without Prescription Cerco Levitra <a href=http://accutane.ccrpdc.com/accutane-pills-online.php>Accutane Pills Online</a> Buy Viagra Greece

Note: See TracTickets for help on using tickets.