Giter VIP home page Giter VIP logo

shumatech / bossa Goto Github PK

View Code? Open in Web Editor NEW
359.0 39.0 248.0 1.15 MB

BOSSA is a flash programming utility for Atmel's SAM family of flash-based ARM microcontrollers. The motivation behind BOSSA is to create a simple, easy-to-use, open source utility to replace Atmel's SAM-BA software. BOSSA is an acronym for Basic Open Source SAM-BA Application to reflect that goal.

Home Page: http://www.shumatech.com/web/products/bossa

License: BSD 3-Clause "New" or "Revised" License

Shell 0.22% C++ 97.77% C 0.06% Assembly 0.19% Makefile 1.76%
bossa c-plus-plus atmel-sam-family flash arm-microcontrollers development-board

bossa's People

Contributors

aethaniel avatar alexwhittemore avatar arjunak234 avatar aswild avatar cchaloin avatar chrishamm avatar cmaglie avatar dj3vande avatar giedriusm avatar haata avatar kevans91 avatar laf0rge avatar logos-electromechanical avatar m-bab avatar mantas-p avatar mfm24 avatar shumatech avatar smasher816 avatar zrecore avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bossa's Issues

File Dialog is not shown on GUI

I am using windows 10 and attempting to flash with the BOSSA GUI. I am unable to select a file. The file dialog box is collapsed and I can't find any way of selecting it or opening it.
I am installing with bossa-x64-1.8.msi

Build with OpenWRT

Hi guys

BOSSA is an awesome tool. However I'm trying to rebuild Makefile to be able to compile BOSSA as typical OpenWRT package. The problem is I need only command-line tool.

How can I compile it under OpenWRT as minimal subset?

Chris

Wrong Bootloader Size for SAM R21!

@cmaglie @shumatech See pull request #25

The SAM R21 patch I submitted a while back was the wrong value, it should have been 0x2000

Additionally, the README page needs a quick mention on compiling BOSSA from source.

If there's anyway we can have this fix included with the next release of Arduino, I and a ton of other makers would greatly appreciate it. Thanks!

Bossa 1.2.1 64-bit "Not Responding" on Windows 7

I have a fresh install of Bossa 1.2.1 on 64-bit Windows 7 (Windows 7 Enterprise, Service Pack 1, Core i5, 12 GB RAM). With no SAM device attached, switching to a serial port listed in the popup, or choosing "Auto-Scan," puts the program immediately into "(Not Responding)" state with the cursor spinning. The program never recovers from this state (no timeout, error message, etc.)

BOSSA not finding board based on SAMD21J17 (128k/16k) variant

Hi, I have a custom board based on the Arduino zero, but with smaller SAMD21J17A (128k/16k) device instead of the 18A used in the zero. I've cloned the zero bootloader andand made all the relevant device specific settings as well as the board config files, the makefile and the linker script but can't get BOSSA to detect the device.

I can confirm that the device enumerates as USB device and appears as Arduino Zero bootloader on COM port.

It's very frustrating since I figure if the BOSSA can detect a zero (samd12x18) it must be able to detect the smaller memory variant. I've tried BOSSA versions from 1.5 - 1.8 but all give same error. If someone can help I'd be truly grateful.

No device found on /dev/ttyACM0 Arduino Due.

Hello,
I'm having an arduino due, I'm trying to upload zephyr RTOS onto it.
when I do

./bossac -i -d -p /dev/ttyACM0 -U true -e -w -v -b  ~/git/zephyr/samples/hello_world/outdir/arduino_due/zephyr.bin -R

I'm getting the output as

Set binary mode
Send auto-baud
Set binary mode
No device found on /dev/ttyACM0

Am I missing something?
can anyone help me with this?

XXXX_BOOTLOADER_SIZE as a parameter

Hi,
Working on the SAMD/R chip series, it is possible to make bootloaders bigger/smaller than 8kB. Would it be possible to pass the bootloader size or application start address as a parameter?
Something like this for example :
bossac -e0x8000 -w0x8000 -v0x8000 -b image.bin
or
bossac --startaddr=0x8000 -e -w -v -b image.bin

Unable to flash SAMD21 via UART

Hello!

I'm attempting to flash firmware (compiled via platformio) onto an ATSAMD21G18 via UART on Raspberry Pi 3. The Pi is connected to the following ATSAM's pins:

  • PA15 (for SAM-BA bootloader monitor mode) [rpi pin 11]
  • PA22 (UART TXD for SAM-BA UART programming) [rpi pin 10]
  • PA23 (UART RXD for SAM-BA UART programming) [rpi pin 8]
  • RESET pin [rpi pin 7]
  • SWDIO (for writing bootloader/debugging via openocd) [rpi pin 18]
  • SWCLK (for writing bootloader/debugging via openocd) [rpi pin 22]
  • GND
  • 3V3 for power (Pi powering ATSAM)

I tested and was able to program the ATSAM over USB using bossac, but am not able to do so over UART. UART is enabled on the Pi3 as I have /boot/config.txt contain enable_uart=1 and core_freq=250.

I can use openocd to successfully write the bootloader, and I've tried using three different SAM-BA bootloaders (first two from the ZIP file https://github.com/femtoduino/femto-usb/blob/master/Atmel_files/SAM-BA_Bootloader_and_Programmer-revision_A-Updated_10-2014/Atmel-42366-SAM-BA-Bootloader-for-SAM-D21_ApplicationNote_AT07175.zip): samd21g18a/samd21_sam_ba_uart.hex, samd21g18a/samd21_sam_ba_both_interfaces.hex and https://github.com/arduino/ArduinoCore-samd/blob/master/bootloaders/zero/samd21_sam_ba.bin.

Here's an example (output changes over time):

# currently using samd21_sam_ba_uart.hex
pi@rpidev:~/bootloader $ alias gp='gpio write'
pi@rpidev:~/bootloader $ alias slp='sleep 0.3'
pi@rpidev:~/bootloader $ # on pi, reset atsam (pull RESET pin low)
pi@rpidev:~/bootloader $ alias atreset='gp 7 0 ; slp ; gp 7 1'
pi@rpidev:~/bootloader $ atreset
pi@rpidev:~/bootloader $ sudo bossac --info --debug --port ttyS0 --erase --write --verify --reset -U false blinkfirmware.bin
Send auto-baud
Set binary mode
readWord(addr=0)=0x20000280
readWord(addr=0x400e0740)=0x170000
chipId=0x170000
Unsupported processor
No device found on ttyS0

Any thoughts or suggestions?

PS, I'm happy to create a board for the chip I'm using and contribute it for the project! Thanks!

compilation error: 'unique_ptr' in namespace 'std'

With gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4), I'm getting the compiler error below. Fix is to add '-std=c++11' to COMMON_CXFLAGS in Makefile. I'll submit a pull request shortly.

CPP APPLET src/WordCopyArm.cpp
In file included from src/Samba.h:38:0,
from src/Applet.h:34,
from src/WordCopyApplet.h:32,
from src/WordCopyArm.cpp:3:
src/SerialPort.h:74:18: error: ‘unique_ptr’ in namespace ‘std’ does not name a template type
typedef std::unique_ptr Ptr;
^
In file included from src/Applet.h:34:0,
from src/WordCopyApplet.h:32,
from src/WordCopyArm.cpp:3:
src/Samba.h:54:30: error: ‘SerialPort::Ptr’ has not been declared
bool connect(SerialPort::Ptr port, int bps = 115200);
^
src/Samba.h:97:17: error: ‘Ptr’ in ‘class SerialPort’ does not name a type
SerialPort::Ptr _port;
^
src/Samba.h: In member function ‘const SerialPort& Samba::getSerialPort()’:
src/Samba.h:74:49: error: ‘_port’ was not declared in this scope
const SerialPort& getSerialPort() { return *_port; }
^

Build Setup

Is there documentation on how to build on windows?

I have tried to decipher the make file but I am about to the point where it is easier to create a new project than to try and use this project as I can find no documentation on how to build source.

bossac is crashing when uploading or downloading small binaries

Using bossac 1.5-arduino on Windows 8.1 64Bit.

When up- or downloading binaries that are to small in size (less than 2305Bytes) bossac is crashing.

Working example:

bossac.exe -r0x901 test.bin
Device found on COM4
Atmel SMART device 0x28900960 found

Read 2305 bytes from flash
[==============================] 100% (10/10 pages)
done in 0.284 seconds

Crashing example:

bossac.exe -r0x900 test.bin
Device found on COM4
Atmel SMART device 0x28900960 found

Read 2304 bytes from flash
[at this point Windows is telling me that bossac is not working correctly anymore]

Build setup on windows10

Hello,

I need add new deviced Atsamd21j17d in bossac for custom board.
Can someone send me a folder that I can compile in windows for me to modify the device?
I can not compile bossac in windows.

Thanks a lot

Read size not retrieved from text box

It seems there is a bug in BossaWindow::OnRead(wxCommandEvent& event) line 437:

        offset = strtol(_sizeTextCtrl->GetValue().mb_str(), &end, 0);

where the resulting number should be stored in size variable and not offset.

"Removed knowledge of the bootloader size from BOSSA" commit is dangerously compatibility-breaking

dbdd088 is great, but also dangerous to Arduino SAMx21 users who don't understand its implications.

The first time I ran my "make upload" target, which doesn't specify --offset and worked on v1.8, I bricked my chip by erasing the bootloader code. I have an SWD programmer so it was easy enough to re-flash the bootloader, but others users may not be so fortunate.

There's also a flags incompatibility issue:

Version --offset=0x0000 (default) --offset=0x2000
1.8 Correct, writes to 0x2000 Incorrect, writes to 0x4000 (but bootloader still works)
1.9 Dangerous, writes to 0x0000 and kills the bootloader Correct, writes to 0x2000

I don't have any great ideas for handling the changes to --offset, but I think it could be beneficial to print a warning and require confirmation (or an explicit --offset=0 argument) before erasing/writing anything at address 0.

Which is the canonical version?

Hi,

Could you please let me know which BOSSA repository out there is the canonical one?

I found the original one via the website which points to
http://sourceforge.net/p/b-o-s-s-a/code/ref/master~/

And that repo has some commits from April 2012 that don't appear in this github version. However the version on github has newer commits from September, although those just change the license to BSD.

(To make matters more confusing, I've just forked this repository on github but am about to push commits that came from the sourceforge repo. But that's my fault for being difficult I think. ;).)

Thanks so much for bossa, btw. Adding ATSAM4L support to bossac is infinitely more preferable than having to use Windows for every upload, which is the only other option as Atmel haven't updated the Linux version of SAM-BA for some time!

Cheers,

Angus

-d debugging is too verbose...

Add levels to -d debug option

THe default debugging caused by -d is MUCH too verbose to be useful
under normal circumstances.  This patch lets you specify "-d1" to
"-d4" (and "debug level" in addition to "debug enable" in the shell
version.)  The default (-d1, at the moment) supresses the debug from
the read/write byte/word functions in samba.cpp (arguably this leaves
the dbeugging "not verbose enough", since there's no indication of
things like "erasing one row" other than the WriteWord() debug output
associated with it, but that's a separate problem...

diffs.txt

Arduino Due Port Issue Revisited

I know this issue keeps cropping up. I used my Due's a couple years ago and initially had problems. For some reason it went away. I'm returning to them and the issue is back again. I have two boards both doing the same thing.

Running Ubunutn 16.04.

  1. Yes, I'm accessing the correct port. They appear in /dev, lsusb, etc.
  2. The Arduino 1.8.5 IDE seems to do the upload properly now but I don't know why. It didn't when I first tried it.
  3. I'm using the Eclipse Sloeber plugin because my programs exceed the capacity of the IDE. It doesn't want to upload.

But I've found something interesting. If you omit the port (-p) it works every time from the command line. If you specify the port it fails.

Run this and it uploads:
stty -F /dev/ttyACM0 speed 1200
/home/rmerriam/.arduino15/packages/arduino/tools/bossac/1.6.1-arduino/bossac -d -U false -e -w -b /home/rmerriam/development/Arduino/StrandDev/Due/StrandDev.bin -R
Run this and it doesn't:
stty -F /dev/ttyACM0 speed 1200
/home/rmerriam/.arduino15/packages/arduino/tools/bossac/1.6.1-arduino/bossac -d -U false -e -w -b -p /dev/ttyACM0 /home/rmerriam/development/Arduino/StrandDev/Due/StrandDev.bin -R
No device found on /dev/ttyACM0`

It does the same with bossac installed using the package manager.

Adding support to ATSAMD21E15A

Hello,

I'm using an ATSAMD21E15A, with 32k of Flash and 4k RAM - less than the usual 256k/32k combo seen on Arduinos. I've made some slight modifications on the Arduino Zero bootloader to fit my current setup, and it seems to be working correctly.

I'm compiling bossac from source successfully, and since there seems to be no out-of-the box support for the particular device I'm using, I've added the proper entry to Device.cpp, under the No CHIPID devices section:

    case 0x1001020d:
        _family = FAMILY_SAMD21;
        flashPtr = new NvmFlash( _samba, "ATSAMD21x15", 0x2000,  512, 64, 1, 16, 0x20000000, 0x20001000, 0x41004000, true ) ;
        break;

I can sucessfully connect to the device, fetch its ID, and perform erase operations. However, when I try to write to it, the operation hangs, as shown below:

$ bossac.exe -i -d -p COM7 -e -w blinky.bin --reset
Set binary mode
version()=v2.0 [Arduino:XYZ] Nov 22 2017 02:32:26
Connected at 921600 baud
readWord(addr=0)=0x20001000
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x1001020d
write(addr=0x20000000,size=0x34)
writeWord(addr=0x20000030,value=0x10)
writeWord(addr=0x20000020,value=0x20001000)
version()=v2.0 [Arduino:XYZ] Nov 22 2017 02:32:26
readWord(addr=0x41004018)=0
readWord(addr=0x40000834)=0x7000a
readWord(addr=0x40000834)=0x7000a
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
Device       : ATSAMD21x15
Version      : v2.0 [Arduino:XYZ] Nov 22 2017 02:32:26
Address      : 0x2000
Pages        : 384
Page Size    : 64 bytes
Total Size   : 24KB
Planes       : 1
Lock Regions : 16
Locked       : none
Security     : false
Boot Flash   : true
BOD          : true
BOR          : true
Chip Erase   : true
Fast Write   : true
Fast Verify  : true
Erase flash
chipErase(addr=0x2000)

Done in 0.084 seconds
Write 6432 bytes to flash (101 pages)
[                              ] 0% (0/101 pages)write(addr=0x20000034,size=0x1000)

I'm pretty sure that the values for user and stack (respectively set as 0x20000000 and 0x20001000) are incorrect, but I'm unsure about what to use. If I set them both to be 0x00002000, the write operation is completed, but the verification fails, and the device crashes on reboot.

I feel like I'm missing something fairly obvious. Could somebody point me in any direction?

Thanks!

Cannot compile with mingw in Windows 10

I designed a board with the ATSAME54N20A and I like to use the latest BOSSA 1.9. Unfortunately no binary is created yet, and I am stuck with compiling it with mingw. Do you have any instructions on how to compile this. Currently the following messages appear:

C:\msys32\home\BOSSA>mingw32-make
wx-config Warning: Multiple compiled configurations of wxWidgets have been detected.
Using first detected version by default.

Please use the --wxcfg flag (as in wx-config --wxcfg=gcc_dll\mswud)
or set the environment variable WXCFG (as in WXCFG=gcc_dll\mswud)
to specify which configuration exactly you want to use.
wx-config Warning: Multiple compiled configurations of wxWidgets have been detected.
Using first detected version by default.

Please use the --wxcfg flag (as in wx-config --wxcfg=gcc_dll\mswud)
or set the environment variable WXCFG (as in WXCFG=gcc_dll\mswud)
to specify which configuration exactly you want to use.
CPP APPLET src/WordCopyArm.cpp
In file included from src/Samba.h:38:0,
from src/Applet.h:34,
from src/WordCopyApplet.h:32,
from src/WordCopyArm.cpp:3:
src/SerialPort.h:76:18: error: 'unique_ptr' in namespace 'std' does not name a template type
typedef std::unique_ptr Ptr;
^
In file included from src/Applet.h:34:0,
from src/WordCopyApplet.h:32,
from src/WordCopyArm.cpp:3:
src/Samba.h:55:30: error: 'SerialPort::Ptr' has not been declared
bool connect(SerialPort::Ptr port, int bps = 115200);
^
src/Samba.h:99:17: error: 'Ptr' in 'class SerialPort' does not name a type
SerialPort::Ptr _port;
^
src/Samba.h: In member function 'const SerialPort& Samba::getSerialPort()':
src/Samba.h:75:49: error: '_port' was not declared in this scope
const SerialPort& getSerialPort() { return *_port; }
^
Makefile:248: recipe for target 'obj/WordCopyArm.o' failed
mingw32-make: *** [obj/WordCopyArm.o] Error 1

Flashing to SAM4S2 sometimes fails if the firmware is over 16kB

I am making a firmware flashing tool using bossac but I encountered a problem. Sometimes, but not always, the flashing fails if the firmware exceeds 16kB. It then looks like this:

Device found on COM4
Atmel SMART device 0x289b07e0 found

Write 16588 bytes to flash (33 pages)
[==============================] 100% (33/33 pages)
done in 0.500 seconds

Verify 16588 bytes of flash
[==============================] 100% (33/33 pages)
Verify failed
Page errors: 1
Byte errors: 204

However if I try any other file below 16kB, it works fine. The SAM4S2 has way more than 16kB program flash memory so it's not a physical limit. I was able to get the firmware size just below 16kB with some optimizations like -mno-long-calls so it's not an urgent bug for me but it should be investigated and fixed.

verbose log is here (except it's missing the first part of the flashing, sorry):
http://pastebin.com/UEzrNTK2

Installing 1.8 on Debian?

No configure script in the tarball nor instructions for installing.

Binaries would be equivalently good :)

Problem programming with USB-3 on Win7

While programming an Atmel M0 device through the Arduino IDE, the following error is noted (noted various places on the internet).

See SAM-BA operation failed below

During the programming cycle, I can hear the Windows OS thu-dunk sounds while the USB un-initializes and re-initializes. I believe that the bossa script should provide some pause while the USB port is stabilizing. I think this might solve several problems the Atmel SAM community are seeing with programming.

(Note, I was able to get past the problem by going into the BIOS and disabling USB3 capability, but I lost other peripheral functionality I need).

Set binary mode
readWord(addr=0)=0x20007ffc
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
version()=v2.0 [Arduino:XYZ] Mar 5 2016 17:46:52
chipId=0x10010005
Connected at 921600 baud
readWord(addr=0)=0x20007ffc
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
Atmel SMART device 0x10010005 found
write(addr=0x20004000,size=0x34)
writeWord(addr=0x20004030,value=0x10)
writeWord(addr=0x20004020,value=0x20008000)
Device : ATSAMD21G18A
readWord(addr=0)=0x20007ffc
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
Chip ID : 10010005
version()=v2.0 [Arduino:XYZ] Mar 5 2016 17:46:52
Version : v2.0 [Arduino:XYZ] Mar 5 2016 17:46:52
Address : 8192
Pages : 3968
Page Size : 64 bytes
Total Size : 248KB
Planes : 1
Lock Regions : 16
Locked : readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
none
readWord(addr=0x41004018)=0
Security : false
Boot Flash : true
readWord(addr=0x40000834)=0x7000a
BOD : true
readWord(addr=0x40000834)=0x7000a
BOR : true
Arduino : FAST_CHIP_ERASE
Arduino : FAST_MULTI_PAGE_WRITE
Arduino : CAN_CHECKSUM_MEMORY_BUFFER
Erase flash
chipErase(addr=0x2000)
done in 0.856 seconds

Write 8548 bytes to flash (134 pages)
write(addr=0x20005000,size=0x1000)
writeBuffer(scr_addr=0x20005000, dst_addr=0x2000, size=0x1000)

[============== ] 47% (64/134 pages)write(addr=0x20005000,size=0x1000)
writeBuffer(scr_addr=0x20005000, dst_addr=0x3000, size=0x1000)

[============================ ] 95% (128/134 pages)write(addr=0x20005000,size=0x180)
writeBuffer(scr_addr=0x20005000, dst_addr=0x4000, size=0x180)

SAM-BA operation failed
An error occurred while uploading the sketch

[==============================] 100% (134/134 pages)
done in 0.056 seconds

Verify 8548 bytes of flash with checksum.
checksumBuffer(start_addr=0x2000, size=0x1000) = caf8
checksumBuffer(start_addr=0x3000, size=0x1000) = 9654
checksumBuffer(start_addr=0x4000, size=0x164) = ab4
Verify successful
done in 0.013 seconds
CPU reset.
readWord(addr=0)=0x20007ffc
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
writeWord(addr=0xe000ed0c,value=0x5fa0004)

Running on Mac 10.13.3 hangs

I can compile without errors but running stops
Running bossa 1.9 shows

/Users/**/Downloads/BOSSA-master/bin/bossa ; exit;
17:41:35: Debug: Adding duplicate image handler for 'Windows bitmap file'
*** Caught unhandled unknown exception; terminating
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

Arduino due can't exit from bootloader mode often

Hello! PC is connected to Arduino Due by Native USB. Often after sketch uploading through Native USB or when I plug usb cable or after OS restarted (power restart), Arduino Due still keep in Bootloader mode and usb communication with PC doesn't work and sketch doesn't work.
After hardware reset of Arduino Due it become normal.

lsusb | grep boot
Bus 001 Device 020: ID 03eb:6124 Atmel Corp. at91sam SAMBA bootloader

I run manually bossac's command to reset Arduino Due but it doesn't help:

~/.arduino15/packages/arduino/tools/bossac/1.6.1-arduino$ ./bossac -p ttyACM0 -R

lsusb | grep boot
Bus 001 Device 020: ID 03eb:6124 Atmel Corp. at91sam SAMBA bootloader

Why can't Bossac reset CPU? Is this bug or need send some additional command to CPU to reset?

BTW: Arduino Due can recieve new sketches but can't be reseted by Bossac.

Forcing Bootloader mode on SAMD21 to avoid having to press the reset button

I am using BOSSA 1.8 on Mac
It works greats but it needs the board to be placed in bootloader mode by pressing the reset button twice. My board is placed in an enclosure with no direct access to the reset button.
Could you add a line like
stty -f /dev/cu.usbmodemfa121 1200;stty stop /dev/cu.usbmodemfa121
just before the bossac command.
This would force the board to enter into bootloader mode. I have tried the command from the terminal and it allows BOSSA to detect the board.
This is also the trick (opening closing the port at 1200 bps)used by the Arduino IDE to enter into bootloader mode (I found this trick here: [https://arduino.stackexchange.com/questions/1160/why-does-command-line-bossa-not-recognize-arduino-due]

BOSSA not working in MacOS Sierra

MacOS Sierra 10.12.5, BOSSA GUI looks like it starts but then just exits without doing anything. this is with the supplied version 1.8 DMG from the releases.

Hardware is Early 2015 MacBook 12 using external hub to Duet Wifi

Not sure what is needed to recompile on MacOS so have not tried that option.

Better info

When running BOSSA, it would be nice if the code was to display a version number.

Takes ages to find the com port and program

I dunno if it should take this long to find the com port and program, but it does seem rather weird. This happens on multiple PCs but not every time.

Device found on COM4
Atmel SMART device 0x1001000b found
Erase flash
done in 14.961 seconds

Write 27784 bytes to flash (435 pages)
[==============================] 100% (435/435 pages)
done in 33.045 seconds

Verify 27784 bytes of flash
[==============================] 100% (435/435 pages)
Verify successful
done in 0.239 seconds
CPU reset.
Press any key to continue . . .

Upload broken on Arduino SAMD boards on master

I bisected the problem and it started with with ee5a651

Before that commit:

.../bossac -i -d --port=ttyACM0 -U true -i -e -w -v /tmp/arduino_build_89865/Blink.ino.bin -R 

readWord(addr=0)=0x20007ffc
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
version()=v2.0 [Arduino:XYZ] Mar 10 2017 12:20:17
chipId=0x10010005 extChipId=00000000
Connected at 921600 baud
readWord(addr=0)=0x20007ffc
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
write(addr=0x20004000,size=0x34)
writeWord(addr=0x20004030,value=0x10)
writeWord(addr=0x20004020,value=0x20008000)
readWord(addr=0)=0x20007ffc
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
version()=v2.0 [Arduino:XYZ] Mar 10 2017 12:20:17
readWord(addr=0x41004018)=0
readWord(addr=0x40000834)=0x7000a
readWord(addr=0x40000834)=0x7000a

After a62710e (which restores samd21x18 signatures):

.../bossac -i -d --port=ttyACM0 -U=true -i -e -w -v /tmp/arduino_build_299169/Blink.ino.bin -R 

Send auto-baud
Set binary mode
SAM-BA operation failed
An error occurred while uploading the sketch
version()=v2.0 [Arduino:XYZ] Mar 10 2017 12:20:17
Connected at 115200 baud
readWord(addr=0)=0x20007ffc
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
write(addr=0x20004000,size=0x34)

Any hint/way we can help in debugging the issue? Thanks!

OS X 10.10 build issues

Getting errors below when compiling current master, after changing the Darwin build params to (because target issues up to at least OSX version 10.7):

COMMON_CXXFLAGS= -arch x86_64 -mmacosx-version-min=10.10 -std=gnu++11 -stdlib=libc++
COMMON_LDFLAGS= -arch x86_64 -mmacosx-version-min=10.10

The errors:

src/Command.cpp:719:23: error: comparison between pointer and integer ('char *' and 'int')
            if (input == '\0' ||
                ~~~~~ ^  ~~~~
src/Command.cpp:822:23: error: comparison between pointer and integer ('char *' and 'int')
            if (input == '\0' ||

Looks like a genuine bug where the pointer is compared to 0 instead of the data the pointer points to (as the pointer is rejected when NULL a line earlier anyway) changing to *input == ... apparently fixes things and it compiles and works

Improvements in Bossa

I have used bossa’s fork ( https://github.com/NorthboundNetworks/Bossa.git/trunk ) for a SAM4E16E CPU and I discovered some problems. My connection to the target was serial 115200baud. I have some suggestion for bossa. The same issues applies for http://www.shumatech.com/web/products/bossa ,

1.) Increase in EefcFlash::waitFSR() usleep from 100 to 100000. Reason: erase would fail otherwise since it takes a long time. The same can be achieved by increasing tries to 500000.
An alternative would be the use of EWP (Erase page and write page). But it does not work for SAM4E, because EWP is just for a few pages ( More precisely: For the first 32 pages ).

2.) In the same function (EefcFlash::waitFSR()) add
if (fsr0 & 0x2)
throw FlashCmdError();

3.) Class EefcFlash could be improved if constructor reads properties of flash by using GETD. See details in http://www.atmel.com/Images/Atmel-11157-32-bit-Cortex-M4-Microcontroller-SAM4E16-SAM4E8_Datasheet.pdf Chapter 20.4.3.1 Get Flash Descriptor Command. Here some example code:

waitFSR();
writeFCR0(EEFC_FCMD_GETD, 0);
waitFSR();
uint32_t descriptor = readFRR0();
uint32_t sizeFlash = readFRR0():
uint32_t sizePage = readFRR0();
uint32_t numOfPlanes = readFRR0();

Since I have just one hardware (as mentioned above SAM4E16E) for testing I could not implement and commit the changes to your repositories.

lock region documentation to avoid overwriting the last 16kB or so.

I have problems to understand the lock option. I like to use BOSSA in an Arduino Zero D21 environment. When Downloading the sketch it erases the entire flash (after the bootloader).

I like to protect (or not to erase) the last remaining 16 kB (of the 256kB D21 flash). I removed already the -e option in the platforms.txt but BOSSA ist still erasing the entire Flash.

Will the lock region be of any help?
Do I need to add this feature to BOSSA?

Thank you for your advise.

Pages to erase

Hi,
it could be very useful to have an additional parameter for the erase command: the total pages to erase. Indeed, it can be used to keep data stored in NVM with the EEPROM emulation driver.

cannot build 0146132868e7060179b55ff36809f6aa698b10a1 on Mac 10.13.3

Here is the output of the make command

CPP APPLET src/WordCopyArm.cpp
CPP COMMON src/Samba.cpp
CPP COMMON src/Flash.cpp
CPP COMMON src/D5xNvmFlash.cpp
src/D5xNvmFlash.cpp:172:12: error: calling a private constructor of class
      'std::__1::unique_ptr<unsigned char [], std::__1::default_delete<unsigned
      char []> >'
    return userPage;
           ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:2621:5: note: 
      declared private here
    unique_ptr(unique_ptr&);
    ^
1 error generated.
make: *** [obj/D5xNvmFlash.o] Error 1

GUI

Where did the windows GUI go? I cannot find any link to it.

SAMD51 dual banks

The DAMD51 provides dual banks to upload firmware. E.g., the current firmware is located in BankA and the new firmware is saved in BankB. After uploading the new firmware to BankB switch to start firmware from BankB.

Is this integrated in BOSSA or how to do this?

Binaries for v1.9

Would it be possible to provide the (Windows) binaries for version 1.9?
Thanks!

mrf bug

There's a bug in mrf in bossash such that it reads the same 1k over and over.
I think you want something like 'addr += fbytes' in the loop.

Fast-forward master branch into arduino branch

Hi @shumatech

I'm wondering if it still makes sense to have two different branches, one from the original bossac (master branch) and the other the arduino version (arduino branch)?

From the git log I see that the master branch could be fast-forwarded to the current arduino branch, would you mind if I do that, and let everyone continue to work on the master branch?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.