Browse Source

samd/boards: Move the flash filesystem definitions to the linker files.

They used to be in mpconfigmcu.h, but have to be different for different
chip variants, like the SAMD51x20.
pull/9534/head
robert-hh 2 years ago
committed by Damien George
parent
commit
9f4df86016
  1. 3
      ports/samd/boards/samd21x18a.ld
  2. 3
      ports/samd/boards/samd51g19a.ld
  3. 3
      ports/samd/boards/samd51j19a.ld
  4. 3
      ports/samd/boards/samd51p19a.ld
  5. 2
      ports/samd/mcu/samd21/mpconfigmcu.h
  6. 7
      ports/samd/mcu/samd51/mpconfigmcu.h
  7. 6
      ports/samd/samd_flash.c

3
ports/samd/boards/samd21x18a.ld

@ -13,5 +13,8 @@ MEMORY
_estack = ORIGIN(RAM) + LENGTH(RAM) - 8;
_sstack = _estack - 8K;
_oflash_fs = ORIGIN(FLASH) + 192K - 8K;
_sflash_fs = LENGTH(FLASH) - 192K + 8K - 1;
_sheap = _ebss;
_eheap = _sstack;

3
ports/samd/boards/samd51g19a.ld

@ -13,5 +13,8 @@ MEMORY
_estack = ORIGIN(RAM) + LENGTH(RAM) - 8;
_sstack = _estack - 16K;
_oflash_fs = ORIGIN(FLASH) + 384K - 16K;
_sflash_fs = LENGTH(FLASH) - 384K + 16K - 1;
_sheap = _ebss;
_eheap = _sstack;

3
ports/samd/boards/samd51j19a.ld

@ -13,5 +13,8 @@ MEMORY
_estack = ORIGIN(RAM) + LENGTH(RAM) - 8;
_sstack = _estack - 16K;
_oflash_fs = ORIGIN(FLASH) + 384K - 16K;
_sflash_fs = LENGTH(FLASH) - 384K + 16K - 1;
_sheap = _ebss;
_eheap = _sstack;

3
ports/samd/boards/samd51p19a.ld

@ -13,5 +13,8 @@ MEMORY
_estack = ORIGIN(RAM) + LENGTH(RAM) - 8;
_sstack = _estack - 16K;
_oflash_fs = ORIGIN(FLASH) + 384K - 16K;
_sflash_fs = LENGTH(FLASH) - 384K + 16K - 1;
_sheap = _ebss;
_eheap = _sstack;

2
ports/samd/mcu/samd21/mpconfigmcu.h

@ -12,8 +12,6 @@
#define MICROPY_PY_MATH (0)
#define MICROPY_PY_CMATH (0)
#define MICROPY_HW_FLASH_STORAGE_BASE (0x30000)
#define MICROPY_HW_FLASH_STORAGE_BYTES (0xFFFF)
#define VFS_BLOCK_SIZE_BYTES (1536) // 24x 64B flash pages;
#define MICROPY_HW_UART_TXBUF (1)

7
ports/samd/mcu/samd51/mpconfigmcu.h

@ -19,12 +19,7 @@ unsigned long trng_random_u32(void);
// Due to a limitation in the TC counter for us, the ticks period is 2**29
#define MICROPY_PY_UTIME_TICKS_PERIOD (0x20000000)
// MicroPython configs
// samd_flash.c flash parameters
// Build a 128k Flash storage at top. 512k-128k=384k=0x60000
// 512*1024= 0x80000 minus 128*1024= 0x20000 = 0x60000
#define MICROPY_HW_FLASH_STORAGE_BASE (0x60000)
#define MICROPY_HW_FLASH_STORAGE_BYTES (0x1FFFF)
#define VFS_BLOCK_SIZE_BYTES (1536) //
#define MICROPY_HW_UART_TXBUF (1)

6
ports/samd/samd_flash.c

@ -53,11 +53,13 @@ typedef struct _samd_flash_obj_t {
uint32_t flash_size;
} samd_flash_obj_t;
extern uint8_t _oflash_fs, _sflash_fs;
// Build a Flash storage at top.
STATIC samd_flash_obj_t samd_flash_obj = {
.base = { &samd_flash_type },
.flash_base = MICROPY_HW_FLASH_STORAGE_BASE, // Board specific: mpconfigboard.h
.flash_size = MICROPY_HW_FLASH_STORAGE_BYTES, // Board specific: mpconfigboard.h
.flash_base = (uint32_t)&_oflash_fs, // Get from MCU-Specific loader script.
.flash_size = (uint32_t)&_sflash_fs, // Get from MCU-Specific loader script.
};
// FLASH stuff

Loading…
Cancel
Save