flash_spi_uboot
Last modified by Microchip on 2025/07/17 12:45
Run SAM-BA with USB connection (equivalent to serial) and erase the U-Boot section in the SPI flash memory map and then write U-Boot binary:
# sam-ba -p serial -b sama5d2-xplained -a serialflash -c erase:0x8000:0x70000 -c write:u-boot-sama5d2-xplained.bin:0x8000
Opening serial port 'ttyACM0'
Connection opened.
Detected memory size is 4194304 bytes.
Page size is 256 bytes.
Buffer is 93952 bytes (367 pages) at address 0x002290c0.
Supported erase block sizes: 4KB, 32KB, 64KB
Executing command 'erase:0x8000:0x70000'
Erased 32768 bytes at address 0x00008000 (7.14%)
Erased 65536 bytes at address 0x00010000 (21.43%)
Erased 65536 bytes at address 0x00020000 (35.71%)
Erased 65536 bytes at address 0x00030000 (50.00%)
Erased 65536 bytes at address 0x00040000 (64.29%)
Erased 65536 bytes at address 0x00050000 (78.57%)
Erased 65536 bytes at address 0x00060000 (92.86%)
Erased 32768 bytes at address 0x00070000 (100.00%)
Executing command 'write:u-boot-sama5d2-xplained.bin:0x8000'
Appending 118 bytes of padding to fill the last written page
Wrote 93952 bytes at address 0x00008000 (23.30%)
Wrote 93952 bytes at address 0x0001ef00 (46.60%)
Wrote 93952 bytes at address 0x00035e00 (69.90%)
Wrote 93952 bytes at address 0x0004cd00 (93.21%)
Wrote 27392 bytes at address 0x00063c00 (100.00%)
Connection closed.
Opening serial port 'ttyACM0'
Connection opened.
Detected memory size is 4194304 bytes.
Page size is 256 bytes.
Buffer is 93952 bytes (367 pages) at address 0x002290c0.
Supported erase block sizes: 4KB, 32KB, 64KB
Executing command 'erase:0x8000:0x70000'
Erased 32768 bytes at address 0x00008000 (7.14%)
Erased 65536 bytes at address 0x00010000 (21.43%)
Erased 65536 bytes at address 0x00020000 (35.71%)
Erased 65536 bytes at address 0x00030000 (50.00%)
Erased 65536 bytes at address 0x00040000 (64.29%)
Erased 65536 bytes at address 0x00050000 (78.57%)
Erased 65536 bytes at address 0x00060000 (92.86%)
Erased 32768 bytes at address 0x00070000 (100.00%)
Executing command 'write:u-boot-sama5d2-xplained.bin:0x8000'
Appending 118 bytes of padding to fill the last written page
Wrote 93952 bytes at address 0x00008000 (23.30%)
Wrote 93952 bytes at address 0x0001ef00 (46.60%)
Wrote 93952 bytes at address 0x00035e00 (69.90%)
Wrote 93952 bytes at address 0x0004cd00 (93.21%)
Wrote 27392 bytes at address 0x00063c00 (100.00%)
Connection closed.