abcminiuser / sam-ba-loader

Python programming client for Atmel SAM devices running the Atmel SAM-BA bootloader.
Other
10 stars 5 forks source link

Add SAM-BA block transfers #5

Open abcminiuser opened 8 years ago

abcminiuser commented 8 years ago

The SAM-BA protocol supports block transfers to reduce the protocol overhead which is important for serial connected devices running at 115200 baud. This should be implemented and used in the flash controllers for bulk flash read and write operations.

Note that serial connected devices use XModem protocol encoding for blocks.

abcminiuser commented 8 years ago

Block read/write APIs added, and partially wired into the NVMCTRL flash controller for reads only (see 9ee7207298f001a132fea2bb922d55c698540941). Writes still need work to use block writes, chunked to the appropriate flash page boundaries.

abcminiuser commented 8 years ago

The block write function is byte-wise in the SAM-BA bootloader, which hardfaults when writing into the NVM address space. Looks like it's inevitable; I need to make a shim applet that receives the data chunk then copies it word-wise into the required destination.