[#6314] bfin-elf-ldr hangs during load on Windows systems

Document created by Aaronwu Employee on Oct 17, 2013
Version 1Show Document
  • View in full screen mode

[#6314] bfin-elf-ldr hangs during load on Windows systems

Submitted By: Ben Hastings

Open Date

2010-10-25 18:17:36    


Medium     Assignee:

Mingquan Pan

Stuart Henderson


Custom     Silicon Revision:

bf518 v0.1


Duplicate     Fixed In Release:




Host Operating System:

Windows x64

toolchain rev.:

SVN-20101024     kernel rev.:


Open     Found In Release:


Is this bug repeatable?:


Summary: bfin-elf-ldr hangs during load on Windows systems



The bfin-elf-ldr in recent windows SVN snapshots doesn't appear to work in windows 7 x64.  After synchronizing the baudrate correctly, it just hangs when trying to load the first block.  The bfin-elf-ldr utility from the 2009R1 release works fine.




--- Mike Frysinger                                           2010-10-25 20:35:44

post the console output


--- Ben Hastings                                             2010-11-01 10:03:51

*** console ouput ***


$ bfin-elf-ldr --version

ldr-utils-svn-3936: /usr/local/src/blackfin/git/toolchain/ldr-utils/ldr.c

compiled Oct 24 2010


$ bfin-elf-ldr --target bf518 --debug --verbose --load bin/localization_3p0.ldr

com1 --baud 9600

Loading LDR bin/localization_3p0.ldr ... LDR block 1: [off:0x00000000]

[header(0x10): 015050ad 0000a0ff 00000000 48b90200] [data(0x00000000)]

LDR block 2: [off:0x00000010] [header(0x10): 0108e8ad 0000a0ff 30010000

efbeadde] [data(0x00000130)]

LDR block 3: [off:0x00000150] [header(0x10): 0100ddad 0000a0ff 0c000000

efbeadde] [data(0x0000000c)]

LDR block 4: [off:0x0000016c] [header(0x10): 01000ead 00000000 00800000

efbeadde] [data(0x00008000)]

LDR block 5: [off:0x0000817c] [header(0x10): 01008ead 00800000 00800000

efbeadde] [data(0x00008000)]

LDR block 6: [off:0x0001018c] [header(0x10): 01000fad 00000100 00800000

efbeadde] [data(0x00008000)]

LDR block 7: [off:0x0001819c] [header(0x10): 01008fad 00800100 00800000

efbeadde] [data(0x00008000)]

LDR block 8: [off:0x000201ac] [header(0x10): 01000cad 00000200 00800000

efbeadde] [data(0x00008000)]

LDR block 9: [off:0x000281bc] [header(0x10): 010067ad 00800200 5c370000

efbeadde] [data(0x0000375c)]

LDR block 10: [off:0x0002b928] [header(0x10): 01013ead 5cb70200 0c760000

00000000] [data(0x0000760c)]

LDR block 11: [off:0x0002b938] [header(0x10): 0101c6ad 0000c001 00ae0400

00000000] [data(0x0004ae00)]

LDR block 12: [off:0x0002b948] [header(0x10): 018073ad 0000a0ff 00000000

00000000] [data(0x00000000)]


Opening com1 ... OK!

Configuring terminal I/O ... OK!

Trying to send autobaud ... OK!

Trying to read autobaud ... OK!

Checking autobaud ... OK!

Autobaud result: 9600bps 31.180mhz (header:0xBF DLL:0xCB DLH:0x00 fin:0x00)

Sending blocks of DXE 1 ... [16:0 bytes] [1/


*** program hangs ***


--- Ben Hastings                                             2010-12-07 01:10:36

I just tried the latest snapshot (Nov 28th) on a 32-bit windows XP machine and

it appears to have the same issue.  Using the ldr utility from the 2009

toolchain works on both windows xp (x86) and windows 7 (x64), so it doesn't

appear that the version of windows has anything to do with it.


--- Stuart Henderson                                         2011-03-16 07:30:53

Problem present in 2010R1-RC4 kit.

Not present in 09r1.1 kit.

Not present in a clean build of the 2010R1-RC4 tag.


Still investigating.


--- Ben Hastings                                             2011-03-16 12:30:44

Bug #6439 looks very similar to this bug (Duplicate?) and suggests it has to do

with the serial port timeout setup on windows.


--- Mike Frysinger                                           2011-03-16 16:22:59

the code hasnt changed between 2010R1 and 2009R1.  the build system however has.

i built 2009R1 on a Debian system, but i dont know where 2010R1 was built.


--- Stuart Henderson                                         2011-03-18 13:18:50

the problem only occurs when bfin-ldr is built with pthreads linked in.  i can't

see how pthreads was built for 09r1.1, could you shine any light on that?

There's nothing obvious in the build scripts and pthreadGC2.dll isn't in the

09r1.1 release.  did we use pthreads in the previous release?


the current build machine is running Suse 8, although i've replicated this

behaviour on a couple of machines now, suggesting it isn't environmental.


--- Mike Frysinger                                           2011-03-18 15:20:00

pthreads was statically linked in before 2010R1 and was provided by the host

toolchain.  it was switched to dynamic linking for 2010R1.


--- Mike Frysinger                                           2011-03-21 14:39:00

pthread functionality in ldr-utils isnt critical.  it's simply a nice debug

feature to grab output from the serial while the ldr is being loaded into it.

since the next libusb wont need pthreads, that leaves only ldr-utils, and we can

punt it too to make our lives easier.


--- Stuart Henderson                                         2011-03-22 12:25:56

Seems reasonable to me.  fyi, the proposed patch in #6439 resolves this issue.


I was going to propose some form of "hot-fix" for the windows 2010R1

release.  something along the lines of a zip file that could be unzipped in the

install dir that would just replace the 6 bfin*-ldr.exes with a version that

doesn't use pthreads.  or is a 2010R1.1 release preferable for such a situation?

a whole release seems a tad excessive considering all that needs replacing is 6



--- Stuart Henderson                                         2011-05-11 06:29:13

This is a duplicate of [#6439].  The fix has been checked in and a hotfix will

be made available shortly.












File Name     File Type     File Size     Posted By

No Files Were Found