...
Currently, the OpenWSN Zigduino fork (available at https://github.com/SvenAkk/openwsn-fw ) contains the adjusted Sconstruct and Sconscript files that allow working with this toolchain for AVRDUDE based programming of a Zigduino (an Arduino board) using a JTAGICE3 on a configured Windows Machine. These files are also included to this page but the most recent versions are always on the fork.
...
Using this guide allows a Windows 8.1
...
Windows is not de-facto fully compatible with the AVR toolchain and requires special configurationmachine, using a jtagice3 programmer, to flash the Zigduino platform with the OpenWSN Zigduino port firmware.
AVR-GCC for Windows
There are no official easy-to-use recent avr-gcc versions available. The easiest to do for Windows is using Atmel Studio, but which forces using their software, or using the outdated WinAVR tools, which is incompatible with more recent JTAG devices such as jtagice3. In addition, most online resources are (partly) outdated, though still useful . (See also: http://m8051.blogspot.be/2015/01/avrdude-on-windows-long-time-after.html ).First off, you need
There is a recent avr-gcc version compiled for Windows . A pre-compiled, recent version which can be found here: http://andybrown.me.uk/downloads/ .
- Extract the zip file to a location on your hard disk. These command-line tools are not happy to see pathnames with spaces in them so I recommend that you extract to the root directory of your C: drive. That will result in everything being installed into
c:\avr-gcc
. - It’ll be most convenient to add
c:\avr-gcc\bin
to yourPATH
environment variable.
The AVR toolchain itself should now be working on your computer. Test it out by opening the command line terminal and doing and seeing the following:
Code Block |
---|
> avrdude -v
avrdude: Version 6.1-svn-20131205, compiled on Dec 5 2013 at 17:34:22
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch
System wide configuration file is "C:\avr-gcc\bin\avrdude.conf"
|
JTAGICE3 with Windows
Unfortunately, AVRDUDE relies on the JTAGICE3 programmer to be connected to a Linux USB port such as LibUSB (source). In addition, depending on the firmware of the JTAGICE3 the USB descriptors might be totally different (source and source).
First, if needed, downgrade the firmware of your JTAGICE3 device to a v2. To do so follow this guide.
Second, connect your JTAGICE3 device to your computer. It should be recognized and automatically install some USB drivers. At this point, avrdude will most likely not work.
To fix this, download Zadig and run it. Select your JTAGICE3 from the list of devices and install the libusbK driver.
Normally, now you should be able to use avrdude to flash your firmware using a JTAGICE3.
Tying it together – integrating it all and flashing the Zigduino firmware
As a reference on how you can use this toolchain for your own port, we describe how to do it for the Zigduino platform.
Download the openwsn-fw code as found on https://github.com/SvenAkk/openwsn-fw.
Using a terminal, navigate to the openwsn-fw directory and do and see the following to flash the openwsn project:
Code Block |
---|
Sven@S-WORK-LAPTOP C:\Users\Sven\Desktop\OpenWSN_Sven\openwsn-fw > scons board=zigduino toolchain=avr jtag=com8 oos_openwsn scons: Reading SConscript files .. ___ _ _ _ ___ _ _ | . | ___ ___ ._ _ | | | |/ __>| \ | | | || . \/ ._>| ' || | | |\__ \| | `___'| _/\___.|_|_||__/_/ <___/|_\_| |_| openwsn.org scons: done reading SConscript files. scons: Building targets ... Dynifying build\zigduino_avr\openapps\openapps_dyn.c avr-size build\zigduino_avr\projects\common\03oos_openwsn_prog.exe text data bss dec hex filename 94658 4918 4511 104087 19697 build\zigduino_avr\projects\common\03oos_openwsn_prog.exe avrdude -c jtag3isp -p m128rfa1 -B 1 -U flash:w:build\zigduino_avr\projects\common\03oos_openwsn_prog.ihex avrdude: AVR device initialized and ready to accept instructions Reading | ################################################## | 100% 0.25s avrdude: Device signature = 0x1ea701 avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed To disable this feature, specify the -D option. avrdude: erasing chip avrdude: reading input file "build\zigduino_avr\projects\common\03oos_openwsn_prog.ihex" avrdude: input file build\zigduino_avr\projects\common\03oos_openwsn_prog.ihex auto detected as Intel Hex avrdude: writing flash (99576 bytes): Writing | ################################################## | 100% 11.00s avrdude: 99576 bytes of flash written avrdude: verifying flash memory against build\zigduino_avr\projects\common\03oos_openwsn_prog.ihex: avrdude: load data flash data from input file build\zigduino_avr\projects\common\03oos_openwsn_prog.ihex: avrdude: input file build\zigduino_avr\projects\common\03oos_openwsn_prog.ihex auto detected as Intel Hex avrdude: input file build\zigduino_avr\projects\common\03oos_openwsn_prog.ihex contains 99576 bytes avrdude: reading on-chip flash data: Reading | ################################################## | 100% 9.25s avrdude: verifying ... avrdude: 99576 bytes of flash verified avrdude: safemode: Fuses OK (E:F5, H:D7, L:F7) avrdude done. Thank you. scons: done building targets. |
If you see this, your Zigduino has been correctly flashed with the OpenWSN firmware.
View file | ||||
---|---|---|---|---|
|
View file | ||||
---|---|---|---|---|
|
Sven@S-WORK-LAPTOP C:\Users\Sven\Desktop\OpenWSN_Sven\openwsn-fw> scons board=zigduino toolchain=avr jtag=com8 verbose=1 oos_openwsn scons: Reading SConscript files ...
___ _ _ _ ___ _ _| . | ___ ___ ._ _ | | | |/ __>| \ || | || . \/ ._>| ' || | | |\__ \| |`___'| _/\___.|_|_||__/_/ <___/|_\_| |_| openwsn.org
scons: done reading SConscript files.scons: Building targets ...Dynifying build\zigduino_avr\openapps\openapps_dyn.cavr-size build\zigduino_avr\projects\common\03oos_openwsn_prog.exe text data bss dec hex filename 94658 4918 4511 104087 19697 build\zigduino_avr\projects\common\03oos_openwsn_prog.exeavrdude -c jtag3isp -p m128rfa1 -B 1 -U flash:w:build\zigduino_avr\projects\common\03oos_openwsn_prog.ihex
avrdude: AVR device initialized and ready to accept instructions
Reading | | 0% 0.0Reading | ################# | 33% 0.Reading | ################################# | 66% 0.Reading | ################################################## | 100% 0.24s
avrdude: Device signature = 0x1ea701avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed To disable this feature, specify the -D option.avrdude: erasing chipavrdude: reading input file "build\zigduino_avr\projects\common\03oos_openwsn_prog.ihex"avrdude: input file build\zigduino_avr\projects\common\03oos_openwsn_prog.ihex auto detected as Intel Hexavrdude: writing flash (99576 bytes):
Writing | | 0% 0.0Writing | # | 1% 0.1Writing | # | 2% 0.2Writing | ## | 3% 0.3Writing | ## | 4% 0.4Writing | ### | 5% 0.5Writing | ### | 6% 0.6Writing | #### | 7% 0.7Writing | #### | 8% 0.8Writing | ##### | 9% 0.9Writing | ##### | 10% 1.Writing | ###### | 11% 1.Writing | ###### | 12% 1.Writing | ####### | 13% 1.Writing | ####### | 14% 1.Writing | ######## | 15% 1.Writing | ######## | 16% 1.Writing | ######### | 17% 1.Writing | ######### | 18% 1.Writing | ########## | 19% 2.Writing | ########## | 20% 2.Writing | ########### | 21% 2.Writing | ########### | 22% 2.Writing | ############ | 23% 2.Writing | ############ | 24% 2.Writing | ############# | 25% 2.Writing | ############# | 26% 2.Writing | ############## | 27% 2.Writing | ############## | 28% 3.Writing | ############### | 29% 3.Writing | ############### | 30% 3.Writing | ################ | 31% 3.Writing | ################ | 32% 3.Writing | ################# | 33% 3.Writing | ################# | 34% 3.Writing | ################## | 35% 3.Writing | ################## | 36% 3.Writing | ################### | 37% 3.Writing | ################### | 38% 4.Writing | #################### | 39% 4.Writing | #################### | 40% 4.Writing | ##################### | 41% 4.Writing | ##################### | 42% 4.Writing | ###################### | 43% 4.Writing | ###################### | 44% 4.Writing | ####################### | 45% 4.Writing | ####################### | 46% 4.Writing | ######################## | 47% 5.Writing | ######################## | 48% 5.Writing | ######################### | 49% 5.Writing | ######################### | 50% 5.Writing | ########################## | 51% 5.Writing | ########################## | 52% 5.Writing | ########################### | 53% 5.Writing | ########################### | 54% 5.Writing | ############################ | 55% 5.Writing | ############################ | 56% 6.Writing | ############################# | 57% 6.Writing | ############################# | 58% 6.Writing | ############################## | 59% 6.Writing | ############################## | 60% 6.Writing | ############################### | 61% 6.Writing | ############################### | 62% 6.Writing | ################################ | 63% 6.Writing | ################################ | 64% 6.Writing | ################################# | 65% 6.Writing | ################################# | 66% 7.Writing | ################################## | 67% 7.Writing | ################################## | 68% 7.Writing | ################################### | 69% 7.Writing | ################################### | 70% 7.Writing | #################################### | 71% 7.Writing | #################################### | 72% 7.Writing | ##################################### | 73% 7.Writing | ##################################### | 74% 7.Writing | ###################################### | 75% 8.Writing | ###################################### | 76% 8.Writing | ####################################### | 77% 8.Writing | ####################################### | 78% 8.Writing | ######################################## | 79% 8.Writing | ######################################## | 80% 8.Writing | ######################################### | 81% 8.Writing | ######################################### | 82% 8.Writing | ########################################## | 83% 8.Writing | ########################################## | 84% 9.Writing | ########################################### | 85% 9.Writing | ########################################### | 86% 9.Writing | ############################################ | 87% 9.Writing | ############################################ | 88% 9.Writing | ############################################# | 89% 9.Writing | ############################################# | 90% 9.Writing | ############################################## | 91% 9.Writing | ############################################## | 92% 9.Writing | ############################################### | 93% 10Writing | ############################################### | 94% 10Writing | ################################################ | 95% 10Writing | ################################################ | 96% 10Writing | ################################################# | 97% 10Writing | ################################################# | 98% 10Writing | ################################################## | 99% 10Writing | ################################################## | 100% 10.81s
avrdude: 99576 bytes of flash writtenavrdude: verifying flash memory against build\zigduino_avr\projects\common\03oos_openwsn_prog.ihex:avrdude: load data flash data from input file build\zigduino_avr\projects\common\03oos_openwsn_prog.ihex:avrdude: input file build\zigduino_avr\projects\common\03oos_openwsn_prog.ihex auto detected as Intel Hexavrdude: input file build\zigduino_avr\projects\common\03oos_openwsn_prog.ihex contains 99576 bytesavrdude: reading on-chip flash data:
Reading | | 0% 0.0Reading | # | 1% 0.1Reading | # | 2% 0.2Reading | ## | 3% 0.2Reading | ## | 4% 0.3Reading | ### | 5% 0.4Reading | ### | 6% 0.5Reading | #### | 7% 0.6Reading | #### | 8% 0.7Reading | ##### | 9% 0.8Reading | ##### | 10% 0.Reading | ###### | 11% 1.Reading | ###### | 12% 1.Reading | ####### | 13% 1.Reading | ####### | 14% 1.Reading | ######## | 15% 1.Reading | ######## | 16% 1.Reading | ######### | 17% 1.Reading | ######### | 18% 1.Reading | ########## | 19% 1.Reading | ########## | 20% 1.Reading | ########### | 21% 1.Reading | ########### | 22% 2.Reading | ############ | 23% 2.Reading | ############ | 24% 2.Reading | ############# | 25% 2.Reading | ############# | 26% 2.Reading | ############## | 27% 2.Reading | ############## | 28% 2.Reading | ############### | 29% 2.Reading | ############### | 30% 2.Reading | ################ | 31% 2.Reading | ################ | 32% 3.Reading | ################# | 33% 3.Reading | ################# | 34% 3.Reading | ################## | 35% 3.Reading | ################## | 36% 3.Reading | ################### | 37% 3.Reading | ################### | 38% 3.Reading | #################### | 39% 3.Reading | #################### | 40% 3.Reading | ##################### | 41% 3.Reading | ##################### | 42% 4.Reading | ###################### | 43% 4.Reading | ###################### | 44% 4.Reading | ####################### | 45% 4.Reading | ####################### | 46% 4.Reading | ######################## | 47% 4.Reading | ######################## | 48% 4.Reading | ######################### | 49% 4.Reading | ######################### | 50% 4.Reading | ########################## | 51% 4.Reading | ########################## | 52% 4.Reading | ########################### | 53% 5.Reading | ########################### | 54% 5.Reading | ############################ | 55% 5.Reading | ############################ | 56% 5.Reading | ############################# | 57% 5.Reading | ############################# | 58% 5.Reading | ############################## | 59% 5.Reading | ############################## | 60% 5.Reading | ############################### | 61% 5.Reading | ############################### | 62% 5.Reading | ################################ | 63% 6.Reading | ################################ | 64% 6.Reading | ################################# | 65% 6.Reading | ################################# | 66% 6.Reading | ################################## | 67% 6.Reading | ################################## | 68% 6.Reading | ################################### | 69% 6.Reading | ################################### | 70% 6.Reading | #################################### | 71% 6.Reading | #################################### | 72% 6.Reading | ##################################### | 73% 7.Reading | ##################################### | 74% 7.Reading | ###################################### | 75% 7.Reading | ###################################### | 76% 7.Reading | ####################################### | 77% 7.Reading | ####################################### | 78% 7.Reading | ######################################## | 79% 7.Reading | ######################################## | 80% 7.Reading | ######################################### | 81% 7.Reading | ######################################### | 82% 7.Reading | ########################################## | 83% 7.Reading | ########################################## | 84% 8.Reading | ########################################### | 85% 8.Reading | ########################################### | 86% 8.Reading | ############################################ | 87% 8.Reading | ############################################ | 88% 8.Reading | ############################################# | 89% 8.Reading | ############################################# | 90% 8.Reading | ############################################## | 91% 8.Reading | ############################################## | 92% 8.Reading | ############################################### | 93% 8.Reading | ############################################### | 94% 9.Reading | ################################################ | 95% 9.Reading | ################################################ | 96% 9.Reading | ################################################# | 97% 9.Reading | ################################################# | 98% 9.Reading | ################################################## | 99% 9.Reading | ################################################## | 100% 9.59s
avrdude: verifying ...avrdude: 99576 bytes of flash verified
avrdude: safemode: Fuses OK (E:F5, H:D7, L:F7)
avrdude done. Thank you.
scons: done building targets.