mattairtech / BOSSA

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.
http://www.shumatech.com/web/products/bossa
BSD 3-Clause "New" or "Revised" License
7 stars 12 forks source link

Hangs/stuck when flashing ATSAMD21E15B #4

Open tinkerBOY-git opened 4 years ago

tinkerBOY-git commented 4 years ago

Bootloader works fine on ATSAMD21E15B but I cannot get BOSSA 1.7.0-mattairtech-3 to upload a binary file. It hangs/stuck on when it's time to "write".

D:\BOOTLOADERS\BOSSA 1.7.0-mattairtech-3>bossac -i -d --port=COM27 -U true -i -e -w -v Blink.ino.ATSAMD21E15B.bin -R
Set binary mode
readWord(addr=0)=0x20000ffc
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10011527
version()=v2.0 [Arduino:XYZ] Dec 11 2019 22:16:43
chipId=0x10010027
Connected at 921600 baud
readWord(addr=0)=0x20000ffc
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10011527
Atmel SMART device 0x10010027 found
write(addr=0x20000800,size=0x34)
writeWord(addr=0x20000830,value=0x10)
writeWord(addr=0x20000820,value=0x20001000)
Device       : ATSAMD21E15B
readWord(addr=0)=0x20000ffc
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10011527
Chip ID      : 10010027
version()=v2.0 [Arduino:XYZ] Dec 11 2019 22:16:43
Version      : v2.0 [Arduino:XYZ] Dec 11 2019 22:16:43
Address      : 8192
Pages        : 384
Page Size    : 64 bytes
Total Size   : 24KB
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.113 seconds

Write 11040 bytes to flash (173 pages)
write(addr=0x20000c00,size=0x1000)
mfvmx commented 1 year ago

@tinkerBOY-git did you ever find a fix for this?

mfvmx commented 1 year ago

Bootloader works fine on ATSAMD21E15B but I cannot get BOSSA 1.7.0-mattairtech-3 to upload a binary file. It hangs/stuck on when it's time to "write".

/* If ARDUINO_EXTENDED_CAPABILITIES is defined and set to 1, 3 additional commands
 * will become available which will speed up programming when using the Arduino
 * IDE or the bossac tool standalone. Set to 0 with 4KB bootloaders.
 * Size: ~904B. This is defined and set to 1 by default (except with 4KB).
 */
//For SAMC21E16
#define ARDUINO_EXTENDED_CAPABILITIES   0

I was able to get the write to work by turning off extended capabilities in the board_definitions_x.h file which disables multipage fast write mode. I'm guessing the reduced RAM doesn't allow for this write mode? Everything works after building the bootloader with this option off only it take s~80sec vs ~5sec to upload the FW and it seem to not want to verify unless I separate out the command.