build your own cross-compiler !!!

Sorry for the confusion. It is the first time I use gitorious, and I just uploaded my working tree there. I have the intention of getting my modifications piece by piece into the official dfu-util release, so I keep my master branch in sync with upstream and have my dfuse stuff in the dfuse branch. I realize now that when someone clones from gitorious they will be checked out in the master (upstream) branch. Use git checkout dfuse after cloning. I will add this information to the gitorious page :blush:

My dfuse code verifies the target addresses and will do everything to avoid overwriting the original boot loader. My experience is that the original dfu-util is not able to set target address, so the device itself applies the default target address which is the correct one and should also not overwrite any boot loader. So I think and hope that Rich’s bootloader has not been messed up.

I want to add a “–dry-run” option to the loader, so that target addresses can be verified before a real transfer. For now there is the possibility to make a dry-run build:

make clean; make CFLAGS="-g -O0 -DDEBUG_DRY"

I am glad you are testing it out on MacOSX. If the original dfu-util code (master branch) does not build out-of-the-box, we should try to get it fixed in the official dfu-util project as well.

If echo -e is not supported on mac we should use printf instead. You have printf on mac, right?

Rich, (as I indeed have written in previous examples) you have to use the “–dfuse default” option. That would also catch any attempt to use the original code…

Sure, printf is available. Btw OS X echo always interprets backspaces.

Which “echo” is this? My experience on MacOSX (Darwin 8.11.0) is that the built-in echo in bash does the same as on Linux, and same with the sh builtin. BTW sh is emulated by bash (same binary). /bin/echo ignores both backslashes and -e.

Well, all that I know is that -e is ignored when echo is called from the command line (running bash) but when run through the generation phase the -e is outputted to the dfu version header file.

You really mean ignored and not honored? If I try in bash: echo “a\nb\nb” it returns a\nb\nb, but with -e I get three lines. Can you please attach your src/Makefile? make will run each tabbed line in the Makefile with $SHELL, the question is what did configure set SHELL to. Which OS and bash version do you have?

SHELL was set to /bin/sh and when I changed that to /bin/bash everything compiled fine. Running in bash echo honours the -e -E parameters bun in sh it doesn’t. Running 10.6.

Thanks. SHELL is set to /bin/bash on Linux, I wonder why configure chooses sh on osx. And they must have changed the sh emulation from 10.4 to 10.6.

Finally I got home and could test the new binary on my Mac and… it failed :confused:

Opening USB Device 0x0000:0x0000... Claiming USB DFU Runtime Interface... Determining device status: state = dfuERROR, status = 10 dfuERROR, clearing status not at least 2 device changes found ?!? Opening USB Device... Found Runtime: [0x0483:0xdf11] devnum=3, cfg=0, intf=0, alt=0, name="@Internal Flash /0x08000000/12*001Ka,116*001Kg" Claiming USB DFU Interface... Cannot claim interface: Permission denied

Thought what the hell, tried again and… [size=150]SUCCESS![/size]
After a bit of testing I found that the first run after the DSO nano is connected fails but all following runs works just fine.

It is the same on Linux, always have to try twice after connecting it.

Happy to hear it works on mac!

I tried running git checkout dfuse to switch the branch, but now I can’t compile. I get Undefined symbols:
“_dfuse_do_raw_dnload”, referenced from:
_main in main.o
“_dfuse_set_address_pointer”, referenced from:
_main in main.o
“_dfuse_do_upload”, referenced from:
_main in main.o
“_dfuse_do_dfuse_dnload”, referenced from:
_main in main.o
ld: symbol(s) not found

So git has foiled me again. me to send anything tell me where to send it.

From what I am hearing I maybe able to use the tarball to reprogram my device. (Hope the bootloader is still in place.)
I did not have time to find a machine that would run the dfu demo.

Using the binary I built from the tarball it is still claiming to download the full firmware, so I think the bootloader is still there. Can someone send me the full set of commands I need to use to download the firmware to get up again? The device says it is a DSO Nano v1.1
DS0201 Device Firmware Upgrade Ver 2.0

I have only tried downloading the lib and app, both the 2.1, 2.5, and 3 versions. One of the times I must have done it okay, but now I am not hitting on the right version to be functional again.

Had the same issue but the following solved it: make clean && ./autogen.sh && ./configure
Basically the file set have changed but the makefiles didn’t know about it.

Attaching my binary if you want to try it, built and tested under 10.6 only.
dfu-util.zip (14.1 KB)

If you did not use the “–dfuse default” option you have in practice been using the original dfu-util software, just with some bug fixes added. This code does not send erase requests to the Nano, so nothing will be written. So I think your bootloader should be untouched. Since you have more than one DFU device connected you have to use the command line that I used, plus “-d vid:pid”.

okay using the --dfuse default I was able to upload both the lib and app and I am running again.

That is good. I am willing to do any more testing that is helpful. I really want to get this whole tool chain up and stable for myself. Great work!

Thanks for pointing me straight. I have recovered my device and can now compile the correct branch of firmware. I did not have the USB failure on the config, but I did have to manually edit the Makefile to use the right version of libusb. I do not know how hard it is to specify that on the configure command line.

Okay some commented that I had an other device connected, and I have always seen that print out, but if I do it is builtin to this Mac.

If I unplug everything I still see the line

Found Runtime: [0x05ac:0x8216] devnum=4, cfg=0, intf=3, alt=0, name=“UNDEFINED”

I had assumed this was normal. If I connect the DSO it appears as two devices the

Found Runtime: [0x0483:0xdf11] devnum=4, cfg=0, intf=0, alt=0, name="@Internal Flash /0x08000000/12001Ka,116001Kg"
Found Runtime: [0x0483:0xdf11] devnum=4, cfg=0, intf=0, alt=1, name="@SPI Flash : M25P64/0x00000000/64064Kg,64064Kg"

both of which I see on a PC. Am I confused, highly likely. or is something else going on?

So I did a git clone of your gitorious project, but I am failing on the iar2gas with

/bin/sh ./iar2gas < ASM_Funtion.s |
arm-none-eabi-as -mcpu=cortex-m3 -mthumb -o ASM_Function-gcc.o
{standard input}: Assembler messages:
{standard input}:564: Error: bad instruction `end’
make: *** [ASM_Function-gcc.o] Error 1

Is this expected, or did I miss a git mother may I command again?

Trying to catch up and understand where things stand.

It should be “.end”. Does the mac sed swallow the dot? Can you please check or attach the output from “./iar2gas < ASM_Funtion.s”?