Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
drivers: flash_sam: fix flash_sam_write_page
According to Atmel SAM datasheet when writing data to the latch buffer "32-bit words must be written continuously, in either ascending or descending order. Writing the latch buffer in a random order is not permitted." To enforce the requirement we need to call a memory barrier instruction after copying every word of data to the latch buffer. In the absensce of __DSB() call the ARM processor is free to change order of AHB transfers. This has caused the driver to occasionally corrupt data programmed in the flash. Fixes zephyrproject-rtos#37515 Signed-off-by: Piotr Mienkowski <[email protected]>
- Loading branch information