Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flashing fails with this compiled version while 1.7 is doing fine. #96

Open
pjalocha opened this issue Apr 13, 2019 · 7 comments
Open

Comments

@pjalocha
Copy link

No description provided.

@pjalocha
Copy link
Author

1.7 supplied with Arduino 1.8.9 works just fine, but when I compile and run this version here it fails as below.

The command given is like this:

bossac --port=ttyACM0 -i -U -e -w -R -v .bin

and the relevant part of the reply:

Done in 0.740 seconds
Write 49716 bytes to flash (777 pages)
[==============================] 100% (777/777 pages)
Done in 0.255 seconds
Verify 49716 bytes of flash
[==============================] 100% (777/777 pages)
Verify failed
Page errors: 128
Byte errors: 7956

@RatGit
Copy link

RatGit commented May 1, 2019

I have the same issue I think...

I've compiled versions 1.7.0, 1.8 and 1.9.1 on a Raspberry Pi 3B+ which I use to program a SparkFun SAMD21 Mini Breakout board, (ie. an Arduino Zero clone).

Both 1.8 and 1.9.1 fail in the same way, (see below), whereas 1.7.0 works? One thing I've noticed is that 1.7.0 successfully detects the USB port and connects at the higher speed, (Connected at 921600 baud), whereas the later versions don't:

sudo bossac -i -d --port=ttyACM0 --usb-port=true -e -w -v -R '/home/programmer/Sampler_Controller.bin'
Send auto-baud
Set binary mode
version()=v2.0 [Arduino:XYZ] Dec 20 2016 15:36:39
Connected at 115200 baud
readWord(addr=0)=0x20007ffc
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
write(addr=0x20004000,size=0x34)

SAM-BA operation failed

I also find that I have to run the following command beforehand to ensure that bossac will work. (The SAMD21 board also occasionally needs to be unplugged and re-inserted).

sudo stty -F /dev/ttyACM0 speed 1200 cs8 -cstopb -parenb

If I don't do this I get the following error:

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

@galak
Copy link

galak commented May 1, 2019

Did some bisecting and got this commit causing issues:

commit ee5a651 (refs/bisect/bad)
Author: Scott Shumate [email protected]
Date: Sun May 21 09:58:01 2017 -0500

Refactored to encapsulate all device-specific knowledge into the Device
class including flash creation to prevent Samba from being a dumping
ground for miscellaneous device features.

galak added a commit to galak/sdk-ng that referenced this issue May 1, 2019
This reverts commit 005cdc7.

Revert back to 1.7 bossa as that version works, the appears to be a
known issue with newer version not flashing:

shumatech/BOSSA#96

Signed-off-by: Kumar Gala <[email protected]>
galak added a commit to galak/sdk-ng that referenced this issue May 1, 2019
This reverts commit 005cdc7.

Revert back to 1.7 bossa as that version works, the appears to be a
known issue with newer version not flashing:

shumatech/BOSSA#96

Signed-off-by: Kumar Gala <[email protected]>
galak added a commit to galak/sdk-ng that referenced this issue May 1, 2019
This reverts commit 005cdc7.

Revert back to 1.7 bossa as that version works, the appears to be a
known issue with newer version not flashing:

shumatech/BOSSA#96

Fixes: zephyrproject-rtos#59

Signed-off-by: Kumar Gala <[email protected]>
galak added a commit to zephyrproject-rtos/sdk-ng that referenced this issue May 2, 2019
This reverts commit 005cdc7.

Revert back to 1.7 bossa as that version works, the appears to be a
known issue with newer version not flashing:

shumatech/BOSSA#96

Fixes: #59

Signed-off-by: Kumar Gala <[email protected]>
@cmaglie
Copy link
Collaborator

cmaglie commented Jul 10, 2019

@RatGit
the semantic of -U parameter has been changed from 1.7.
You may want to try to replace --usb-port=true or -U true to just -U

@cmaglie
Copy link
Collaborator

cmaglie commented Jul 10, 2019

@pjalocha @RatGit
try also to add -o 0x2000 to the command line (I suppose you're running a SAMD21 based board), previously the offset to skip the bootloader size was built-in in bossac, now you must specify it via command line.

@nzmichaelh
Copy link

@RatGit re: the board needing to be unplugged and then plugged back in, I see the same due to a race between the 'stty' call, the board detaching, and Bossa attaching. If the board hasn't finished restarting then Linux puts the board on ttyACM1 instead of ttyACM0

@rzr
Copy link

rzr commented Aug 22, 2022

I confirm zephyr's version is working fine on arduino_nano_33_ble

I can provide some traces if it helps

/usr/local/bin/bossac-1.9.1-14-g3532de8  --version # KO
Basic Open Source SAM-BA Application (BOSSA) Version 1.9.1-14-g3532de8

/usr/local/bin/bossac-1.9.1-17-g89f3556 --version # OK
Basic Open Source SAM-BA Application (BOSSA) Version 1.9.1-17-g89f3556

Relate-to: https://gitlab.eclipse.org/eclipse/oniro-core/docs/-/issues/141#notes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants