Home‎ > ‎

Uploading Code to Due

Now that we have compiled the code we want to upload it to the Arduino Due board.

This can be done using the Arduino Due bootloader. The tool to use seems to be bossac.exe
http://arduino.cc/forum/index.php?topic=132688.0

Bossac is : Basic Open Source SAM-BA Application.


Windows Command Prompt

C:\work\Apps\arduino-1.5.1r2\hardware\tools>mode com12:1200,n,8,1

Status for device COM12:
------------------------
    Baud:            1200
    Parity:          None
    Data Bits:       8
    Stop Bits:       1
    Timeout:         ON
    XON/XOFF:        OFF
    CTS handshaking: OFF
    DSR handshaking: OFF
    DSR sensitivity: OFF
    DTR circuit:     ON
    RTS circuit:     ON


C:\work\Apps\arduino-1.5.1r2\hardware\tools>bossac.exe --port=COM12 -U false -i
Device       : ATSAM3X8
Chip ID      : 285e0a60
Version      : v1.1 Dec 15 2010 19:25:04
Address      : 524288
Pages        : 2048
Page Size    : 256 bytes
Total Size   : 512KB
Planes       : 2
Lock Regions : 32
Locked       : none
Security     : false
Boot Flash   : false

C:\work\Apps\arduino-1.5.1r2\hardware\tools>


We have connection with our Arduino Due using the Bossac tool.
Now we try to program some code using Bossac:

Windows Command Prompt , programming using bossac

C:\Temp>bossac.exe --port=COM12 -U false -e -w -v -b PWM_PWM_LED_EXAMPLE1.bin -R
No device found on COM12
                                                                <- No connection , there is code running on the Due already , bootloader cannot connect.
                                                                <- Pressing reset and trying again
C:\Temp>bossac.exe --port=COM12 -U false -e -w -v -b PWM_PWM_LED_EXAMPLE1.bin -R
No device found on COM12
                                                                <- Pressed Reset , still No connection, Duo does not jump to bootloader after reset.
                        <- Pressing ERASE button. and try again
C:\Temp>bossac.exe --port=COM12 -U false -e -w -v -b PWM_PWM_LED_EXAMPLE1.bin -R
Erase flash
Write 12772 bytes to flash
[==============================] 100% (50/50 pages)
Verify 12772 bytes of flash
[==============================] 100% (50/50 pages)
Verify successful
Set boot flash true
CPU reset.

C:\Temp>


So we need to Erase the device to be able to connect to the Bootloader in the Arduino Due.


Next step is to integrate this into the Atmel Studio enviroment.

I have not tested this yet ... more to follow
Comments