I love the libmaple design but i love virtualization too.
My installation look like this:
- ubuntu 11.04 64-bit
- vmware and as guest ubuntu 32bit
and the maple specific stuff
- toolchain with this instructions http://leaflabs.com/docs/unix-toolchain.html#toolchain-udev
- eclipse with the instruction from http://forums.leaflabs.com/topic.php?id=681
The problem is, i never could upload a file. In the full package from the maple-IDE the upload works fine.
The problem was in the make file :
$(SUPPORT_PATH)/scripts/reset.py && \
sleep 1 && \
$(DFU) -a1 -d $(VENDOR_ID):$(PRODUCT_ID) -D $(BUILD_PATH)/$(BOARD).bin -R
The timing between "reset.py" and "dfu-util" is wrong. Maybe a problem from virtualization. Never mind i did the following for a solution.
I wrote a little wrapper around the DFU-UTIL.
1) update the file "libmaple/support/make/build-rules.mk"
original: "DFU := dfu-util"
my one : "DFU := dfu-util-wrap.sh"
2) After that copy the following bash script into the directory "libmaple/arm/bin"
bash-script "dfu-util.wrap.sh"
Copy only the source between the dashes.
Do not forget and make the file executable.
Hope it helps.
If you like, you can reduce the "sleep 1" to "sleep 0" in the make file.
--------------------------------
#!/bin/bash
#title: wraper for dfu-util
#autor: josef koller (vienna)
#date : Dec. 2011
#reason: the dfu-util ist not synchroniced by firmeware uploads
# so a simple retry mechanism is built in
#parms: all parms are passsed to "dfu-util"
rc=""
count=0
while [ "$rc" == "" ]
do
count=$((count+1))
if [ $count -gt 399 ]; then
echo "Could not upload the file after $count retries"
break
fi
echo -n -e "Try the upload. Lap $count.\r"
res=dfu-util $1 $2 $3 $4 $5 $6 $7 $8 $9 2> /dev/null
rc=echo $res | grep 'Done!'
done
echo $res
--------------------------------