Comments (7)
Okay, I've resolved the issue regarding flashing via USB on the Pi and have that working now, however I am still not able to flash via UART (I was using the Pi's version of bossac which is outdated [1.3a], now upgraded to 1.7.0)
Any suggestions? Thanks!
pi@rpidev:~/bootloader $ sudo stty -F /dev/ttyS0 1200
pi@rpidev:~/bootloader $ sudo ~/bossac --info --debug --port ttyS0 --erase --write --verify --reset -U false blinkfirmware.bin
Send auto-baud
Set binary mode
No device found on ttyS0
pi@rpidev:~/bootloader $ sudo stty -F /dev/ttyS0 115200
pi@rpidev:~/bootloader $ sudo ~/bossac --info --debug --port ttyS0 --erase --write --verify --reset -U false blinkfirmware.bin
Send auto-baud
Set binary mode
No device found on ttyS0
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
No device found on ttyS0
I can get into SAM-BA monitor mode
from bossa.
Some notes I left myself in case it helps others (doing this from a Raspberry Pi):
- You must first disable BLE on Pi (dtoverlay=pi3-disable-bt enable_uart=1).
- I've also had to run this twice in some cases.
- You may need to adjust
serial0
toserial1
or greater if there are multiple serial devices - You may need to adjust the
serial
inserial0
tottyAMA
- You may need to remove
console=
section and setcore_freq=250
in /boot/config.txt, then runsudo systemctl stop [email protected]
sudo systemctl disable [email protected]
First you must get the chip in bootloader mode by holding PA15 low and pulling the reset low.
"The bootloader will check PA15 on reset to determine if the bootloader monitor shall start. This feature allows the end user to reprogram the device even if the application is corrupted or una- ble to start the SAM-BA monitor"
alias gp='gpio write'
gpio mode 1 out
gpio mode 7 out
gp 1 1
gp 7 1
alias slp='sleep 0.3'
# on pi, reset atsam (pull RESET pin low)
alias atreset='gp 1 0 ; slp ; gp 1 1'
# on pi, go into atsam bootloader (pull PA15 low during reset)
alias atbootloader='gp 7 0 ; slp ; atreset ; slp ; gp 7 1'
# go into sam-ba monitor mode when using arduino sam-ba bootloader
atreset ; atreset
# go into bootloader mode when using femto (real) sam-ba bootloader
atbootloader # doesn't always work?
sleep 1
sudo bossac --info --debug --port serial0 --erase --write --verify --reset -U false blinkfirmware.bin
from bossa.
This is interesting. I mentioned I was able to use bossac over USB -- that was from another machine (macOS) but onto the same board (ATSAM). When I attempt to use bossac on the Pi, I get the following:
pi@rpidev:~/bootloader $ ls /dev/ttyA*
/dev/ttyAMA0
pi@rpidev:~/bootloader $ atreset
pi@rpidev:~/bootloader $ ls /dev/ttyA*
/dev/ttyACM0 /dev/ttyAMA0
pi@rpidev:~/bootloader $ sudo stty -F /dev/ttyACM0 1200
pi@rpidev:~/bootloader $ sudo bossac --info --debug --port ttyACM0 --erase --write --verify --reset -U true blinkfirmware.bin
Set binary mode
readWord(addr=0)=0x20007ffc
readWord(addr=0x400e0740)=0x60000
chipId=0x060000
Unsupported processor
Send auto-baud
Set binary mode
readWord(addr=0)=0x20007ffc
readWord(addr=0x400e0740)=0
readWord(addr=0x400e0940)=0
chipId=00000000
Unsupported processor
No device found on ttyACM0
from bossa.
Some more progress, now actually able to communicate with the chip. I was able to do this by changing the bootloader to samd21g18a/samd21_sam_ba_both_interfaces.hex
root@rpidev:/home/pi/bootloader# alias gp='gpio write'
root@rpidev:/home/pi/bootloader# alias slp='sleep 0.3'
root@rpidev:/home/pi/bootloader# # on pi, reset atsam (pull RESET pin low)
root@rpidev:/home/pi/bootloader# alias atreset='gp 7 0 ; slp ; gp 7 1'
root@rpidev:/home/pi/bootloader# # on pi, go into atsam bootloader (pull PA15 low during reset)
root@rpidev:/home/pi/bootloader# alias atbootloader='gp 0 0 ; slp ; atreset ; slp ; gp 0 1'
root@rpidev:/home/pi/bootloader#
root@rpidev:/home/pi/bootloader# atreset
root@rpidev:/home/pi/bootloader# ../bossac --info --debug --port ttyS0 --erase --write --verify --reset -U true blinkfirmware.bin
Set binary mode
Send auto-baud
Set binary mode
readWord(addr=0)=0x20000470
readWord(addr=0xe000ed00)=0x410cc601
No device found on ttyS0
root@rpidev:/home/pi/bootloader# ../bossac --info --debug --port ttyS0 --erase --write --verify --reset -U true blinkfirmware.bin
Set binary mode
Send auto-baud
Set binary mode
readWord(addr=0)=0x20000470
No device found on ttyS0
root@rpidev:/home/pi/bootloader# ../bossac --info --debug --port ttyS0 --erase --write --verify --reset -U true blinkfirmware.bin
Set binary mode
Send auto-baud
Set binary mode
readWord(addr=0)=0x20000470
No device found on ttyS0
root@rpidev:/home/pi/bootloader# atbootloader
root@rpidev:/home/pi/bootloader# ../bossac --info --debug --port ttyS0 --erase --write --verify --reset -U true blinkfirmware.bin
Set binary mode
Send auto-baud
Set binary mode
readWord(addr=0)=0x20000470
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
SAM-BA operation failed
root@rpidev:/home/pi/bootloader# ../bossac --info --debug --port ttyS0 --erase --write --verify --reset -U true blinkfirmware.bin
Set binary mode
Send auto-baud
Set binary mode
readWord(addr=0)=0x20000470
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
version()=v1.1 Aug 11 2014 20:42:19
chipId=0x10010005
Connected at 115200 baud
readWord(addr=0)=0x20000470
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
Atmel SMART device 0x10010005 found
write(addr=0x20004000,size=0x34)
SAM-BA operation failed
from bossa.
SAMD21 is not officially supported since I do not have a dev board to test it with. If anyone wants to donate a SAMD21 board to the BOSSA project, I'll officially support it and add it to my regression tests done prior to release.
from bossa.
I'd be happy to donate a board to support the project. Let me know where you'd like it sent. You can reach me at [email protected].
from bossa.
I would appreciate the support for the SAMD21 as well.
I've been using this very accessible dev board:
https://www.aliexpress.com/item/Crowduino-M0-SD-Board-for-Arduino-UNO-Micro-Controller-Board-DIY-Kit-Free-Shipping/32712839065.html?spm=2114.13010608.0.0.ViAqDC
from bossa.
Related Issues (20)
- Request for new release HOT 1
- Security Flag HOT 1
- License clarification HOT 1
- How can I install bossa under the newest Mac version? HOT 2
- Steps to build and install BOSSA HOT 6
- setting `Boot Flash` flag on ATSAM4SD32 does not always work HOT 3
- Add reset CPU to GUI
- Thanks! HOT 3
- Support for Flutter [os]
- bossac with tinygo flash: `bossac: extra arguments found`
- Broken installer in Windows 11 HOT 1
- Need support for SAMD21G17A CHIP ID 0x10010093
- bossac --offset option missing from man page
- Problems with Mac Big Sur
- Support for Adafruit's ATSAMD21G18 used on Feather M0 Lora board
- Incorrect chip ID's for ATSAM4SD16 HOT 1
- SAM-BA operation failed
- BOSSA Fork (with cxx rust)
- Understanding source code (virtual void)
- Distribute Apple ARM builds HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bossa.