mattairtech / SAMD-MSD-Bootloader

USB MSD (Mass Storage Device) bootloader for Atmel SAMD chips
Other
36 stars 10 forks source link

Program start #3

Open Soth-Eng opened 8 years ago

Soth-Eng commented 8 years ago

I have loaded the bootloader into a arduino m0 and when i use pin D3 to low state and press and release reset button it shows up in my pc. but when i write the new bin file to it and reset the program does not execute.

mattairtech commented 8 years ago

Can you read the whole flash and see your program starting at 0x00004000 (16KB)? If there is 0xFFFFFFFF at address 0x00004000 (stack pointer) then the program will enter a while(1) loop. If you re-enabled the NVM BOOTPROT fuses, be sure they are set to 16KB.

Soth-Eng commented 8 years ago

when i read the bin files in atmel studio the bin file on the device starts at 0x00000000 FF and ends at 003c000

when the new bin file also starts at 0x00000000 to 0x00002160 this is just an export binairy from arduino with a blink sample

NVM BOOTPROT fuse is set to 0x01 16KB

mattairtech commented 8 years ago

Remember that you must re-compile the program so that it starts at 0x00004000, which is after the bootloader. This is different than say, AVR's, which place the bootloader at the end of flash, thus allowing execution beginning from 0x00000000. See the readme for details on how to add the appropriate linker parameters.