I am using the Adafruit_DAP "flash_from_SD" example to burn MKR bootloader using another MKR with ETH shield as a programmer, hooked to target's SWD pads. It works well every time, however, using the same method to burn a sketch is not successful.
The sketch is something I wrote and saved as a bin file using IDE, so no bootloader here, and I know my bin is good as I use it to update the board Over The Air which also works well.
Is there a difference between burning a bootloader vs. other programs, for instance, are they burned to the same Flash address (normally 0 I assume), maybe something else?
pert:
What do you mean by "is not successful"? If you're getting an error message, please post the full text of it.
No error message, the burning completed as expected, it is just the board that bricks after the matter (reflashing the bootloader brings it back alive).
ninora:
No error message, the burning completed as expected, it is just the board that bricks after the matter (reflashing the bootloader brings it back alive).
is the bin build for start address without bootloader? in SAMD the execution starts at address 0. the bootloader is there usually. the DAP erases the flash. so if your bin starts at address 2000 and is flashed at address 0, it will not work
why did you put it in arduino/avr folder?
Using board 'mzero_no_bl' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
Using core 'arduino' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
Based on the good advices here I was able to burn a bootloader and afterwards use Serial to upload a sketch, which works, I can also burn a Blink bin compiled for address 0, works as well.
However, when I try to burn a bootloader and afterwards burn a Blink bin compiled with default address 2000, the board bricks.
You may ask why burn a BL and then burn the program when I can use Serial in the first place?
Because the target is to burn the program without a bootloader, and where Blinks works well off address 0, I am having troubles running more complex programs with communication libraries straight off address 0, it simply won't run and I am trying to isolate the cause.
ninora:
Because the target is to burn the program without a bootloader, and where Blinks works well off address 0, I am having troubles running more complex programs with communication libraries straight off address 0, it simply won't run and I am trying to isolate the cause.
I run my 100 kB bin with Ethernet and SD card without problems from address 0.