Comments (32)
Still no luck with debugging the Arduino zero. So, I made a video to clarify the issue.
Arduino Zero (sam-ba) upload session erases bootloader
zeroUSB is working
from platform-atmelsam.
I have the same problem as described above.
Bootloader needs to be re-burned from arduino IDE for the board to work again.
from platform-atmelsam.
It's already fixed on my local machine. I'll deploy fix this week. We are working on the very interesting feature for Arduino Zero/M0 Pro :)
from platform-atmelsam.
Cool! :) Was it a big fix? Possible to describe it, so I can get the environment up and running sooner? :P
from platform-atmelsam.
Ok, will try to deploy changes today :)
from platform-atmelsam.
Thank you so much! :D
from platform-atmelsam.
Please re-test current development branch:
- Uninstall existing development platform
pio platform uninstall atmelsam
- Install development version
pio platform install https://github.com/platformio/platform-atmelsam.git
from platform-atmelsam.
Followed the steps you mentioned and initialized a new project. Sadly, the fix is not working. Output of the last lines uploading in verbose mode:
Error: at91samd21g18.cpu -- clearing lockup after double fault
target halted due to debug-request, current mode: Handler HardFault
xPSR: 0x61000003 pc: 0xfffffffe msp: 0xffffffd8
shutdown command invoked
So, after uploading, the bootloader will be wiped. The Arduino Zero .cc version is using the SAM-BA bootloader (for USB and UART interfaces). To use SAM-BA together with an application, we need to link the application starting at 0x2000.
Tried this in boards.txt, location SAMD package. But, no luck:
arduino_zero_edbg.bootloader.size=0x2000
from platform-atmelsam.
- Please note that we have 2 different configuration profiles for Arduino Zero:
zero
- you have to use Programming/Debug portzeroUSB
- you have to use USB port to program a board
- Please share on http://pastebin.com a full output of build+upload process from Arduino IDE. You can enable it via
Arduino IDE > Settings > Verbose mode for build/upload
- Process project with PIO in verbose mode via
pio run -t upload -v
and share these results on http://pastebin.com too.
We will compare both outputs and check what is wrong. Thanks!
from platform-atmelsam.
Arduino IDE:
https://pastebin.com/60cDtrtM
PlatformIO:
https://pastebin.com/5m3BnmLr
from platform-atmelsam.
Could you run PIO with --verbose
flag?
If you use PIO IDE, please open src/blink.ino
, then PIo IDE Terminal and run
pio run -t upload -v
from platform-atmelsam.
platformio run -e zero -t upload -v
https://pastebin.com/qtrMcJsr
from platform-atmelsam.
Could you try again to flash board using Arduino IDE and then PIO?
Take a look at 22 line here. We don't erase your bootloader now.
from platform-atmelsam.
pio run -t upload -v
https://pastebin.com/3zkv66bh
from platform-atmelsam.
I copied the complete SAMD package version 1.6.14 from Arduino in the right locations of ~/.platformio/packages/framework-arduinosam and still the same issue.
This looks different from the Arduino output.
Warn : Adding extra erase range, 00000000 to 0x00001fff
from platform-atmelsam.
Any resolution to this? I'm having this issue as well. I can support debugging if anyone is still available to help resolve this.
from platform-atmelsam.
No, I haven't fixed it with PlatformIO so used the Arduino IDE build and upload paths in Eclipse: https://www.youtube.com/watch?v=FRecvWhprhs&t=30s
http://forum.arduino.cc/index.php?topic=477415.0
from platform-atmelsam.
So after digging more, I think this is a change in the OpenOCD. I had this process working back in December of 2016, but it looks like there was a new version of openocd in January. The root cause of this seems to be that openocd is erasing the 0-0x1fff block of flash in addition to the 0x2000 and above area where the program is expecting to be placed. We may be able to solve this with a linker command to place the compiled code at address 0. I'll keep digging into how we can fix this.
from platform-atmelsam.
Could someone provide VERBOSE output of
pio run --verbose -t upload
Thanks!
from platform-atmelsam.
sure ivankravets. Do you need the whole run or just the last few lines? Here are the relevant compile and flash lines:
https://pastebin.com/mQgYFpEL
Note the following:
line 4: verify reset 0x2000; shutdown"
line 29: Warn : Adding extra erase range, 00000000 to 0x00001fff
from platform-atmelsam.
Also, I just confirmed that if I program with PIO, then reprogram the bootloader with the arduino IDE, the program works as expected.
from platform-atmelsam.
- Please restore bootloader with Arduino IDE
- Try to edit
~/.platformio/packages/framework-arduinosam/variants/arduino_zero/openocd_scripts/arduino_zero.cfg
source [find interface/cmsis-dap.cfg]
# chip name
set CHIPNAME at91samd21g18
set ENDIAN little
# choose a port here
set telnet_port 0
at91samd bootloader 8192
source [find target/at91samdXX.cfg]
- Upload firmware with PIO.
Does it work?
from platform-atmelsam.
openocd doesn't seem to recognize the at91samd command:
GNU ARM Eclipse 64-bits Open On-Chip Debugger 0.10.0-00114-g84195369 (2017-04-19-00:49)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
/Users/user/.platformio/packages/framework-arduinosam/variants/arduino_zero/openocd_scripts/arduino_zero.cfg:30: Error: invalid command name "at91samd"
in procedure 'script'
at file "embedded:startup.tcl", line 60
at file "/Users/user/.platformio/packages/framework-arduinosam/variants/arduino_zero/openocd_scripts/arduino_zero.cfg", line 30
*** [upload] Error 1
Also on pastebin:
https://pastebin.com/caqKB5Py
from platform-atmelsam.
Hi @perception-aweichman !
Could you please try to restore your board to the default state (with bootloader) and then upload the blink sketch with this environment:
[env:zero]
platform = atmelsam
board = zero
framework = arduino
upload_flags = -d3 --log_output log.txt
And after programming please upload log.txt to pastebin.com. Thanks!
from platform-atmelsam.
Sorry for the delay. Here is the log (I removed some PII from it before uploading).
It appears to be too large for pastebin... I'll just attach it here instead....
log.txt
from platform-atmelsam.
Also, as a side note, I have a MKRZero (which is based on the same ATMELSAM framework) that doesn't have this same issue. It flashes with PIO and runs just fine afterward. It may not have the same bootloader structure as the Zero though.
from platform-atmelsam.
Any progress on this? Anything I can do to assist the debugging?
from platform-atmelsam.
@perception-aweichman please mail [email protected] for further details
from platform-atmelsam.
Please update development platform to v2.2.0 (pio update
). Does it work now?
from platform-atmelsam.
Please create a new issue if you have a problem.
from platform-atmelsam.
Finally! We have fixed all issues with Arduino Zero. Please update to 2.6.0:
from platform-atmelsam.
Guys, we have made a huge update to Atmel SAM dev/platform. Integrated popular debuggers, custom upload tools/protocols, etc.
Could you re-test the latest UPSTREAM version with Arduino Zero?
We don't have this board and see that it is very specific. We updated openOCD to 0.10.0 and maybe it will not work with Arduino Zero. Please try both ports: USB Native and Programming.
Thanks!
/cc @chrise96 @perception-aweichman @PatrikSB
from platform-atmelsam.
Related Issues (20)
- Adafruit's TinyUSB does not compile on XIAO (Anniversary Edition) HOT 4
- SAMD21 Max SPI should be 12MHz
- Add support for Microchip SAME51 Curiosity nano (EV76S68A)
- ATSAME51G19A board
- Arduino IDE and Platform.io define issue FEATHER M0
- Add support for lowpowerlab's moteino_m4
- Canβt flash Arduino on WSL2: No device found on ttyACM0
- Bump tool-bossac version to 1.9.1 to support offset for erase
- Programming ATSAME51J19A HOT 7
- EEPROM useage like ESPs do HOT 3
- add board WeMos SAMD21 M0
- Mysensors (sensebender) gateway
- Can't debug without preinstalled tool-openocd package
- Add board openrb150
- FR: Option verbose when installing platforms and packages HOT 1
- PlatformIO uses framework-arduino-samd-seeed version 1.8.4 by default
- Feature request: add option to not pass --erase to bossac HOT 1
- SAME51J20A: HW-registers not editable through debug HOT 1
- [email protected] fails with a segmentation fault on Asahi Linux
- Feature Request: please add support for P1AM-100 board
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 platform-atmelsam.