Browse Source

samd/boards: Move mcu-specific settings into a mpconfig_samdXX.h file.

Located at the boards directory. That way, the mpconfigboard.h files are
almost empty, just setting the board name and the MCU name.
pull/9534/head
robert-hh 2 years ago
committed by Damien George
parent
commit
a5d5ecbf84
  1. 3
      ports/samd/Makefile
  2. 10
      ports/samd/boards/ADAFRUIT_FEATHER_M0_EXPRESS/mpconfigboard.h
  3. 15
      ports/samd/boards/ADAFRUIT_ITSYBITSY_M4_EXPRESS/mpconfigboard.h
  4. 10
      ports/samd/boards/ADAFRUIT_TRINKET_M0/mpconfigboard.h
  5. 15
      ports/samd/boards/MINISAM_M4/mpconfigboard.h
  6. 10
      ports/samd/boards/SAMD21_XPLAINED_PRO/mpconfigboard.h
  7. 15
      ports/samd/boards/SEEED_WIO_TERMINAL/mpconfigboard.h
  8. 10
      ports/samd/boards/SEEED_XIAO/mpconfigboard.h
  9. 9
      ports/samd/boards/mpconfig_samd21.h
  10. 21
      ports/samd/boards/mpconfig_samd51.h
  11. 2
      ports/samd/mpconfigport.h

3
ports/samd/Makefile

@ -50,6 +50,9 @@ CFLAGS_MCU_SAMD51 = -mtune=cortex-m4 -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-a
CFLAGS = $(INC) -Wall -Werror -std=c99 -nostdlib -mthumb $(CFLAGS_MCU_$(MCU_SERIES)) -fsingle-precision-constant -Wdouble-promotion
CFLAGS += -DMCU_$(MCU_SERIES) -D__$(CMSIS_MCU)__
CFLAGS += $(CFLAGS_MOD) $(CFLAGS_EXTRA)
CFLAGS += -DMPCONFIG_MCU_H='<boards/mpconfig_$(MCU_SERIES_LOWER).h>'
QSTR_GLOBAL_DEPENDENCIES += boards/mpconfig_$(MCU_SERIES_LOWER).h
LDFLAGS = -nostdlib $(addprefix -T,$(LD_FILES)) -Map=$@.map --cref
LDFLAGS += $(LDFLAGS_MOD)

10
ports/samd/boards/ADAFRUIT_FEATHER_M0_EXPRESS/mpconfigboard.h

@ -1,12 +1,2 @@
#define MICROPY_HW_BOARD_NAME "Feather M0 Express"
#define MICROPY_HW_MCU_NAME "SAMD21G18A"
// MicroPython configs
// samd_flash.c flash parameters
// Build a 64k Flash storage at top. 256k-64k=196k
// 256*1024=262144 minus 64*1024=65536 = 196608 = 0x30000
#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 CPU_FREQ (48000000) // For selecting Baud from clock.

15
ports/samd/boards/ADAFRUIT_ITSYBITSY_M4_EXPRESS/mpconfigboard.h

@ -1,17 +1,2 @@
#define MICROPY_HW_BOARD_NAME "ItsyBitsy M4 Express"
#define MICROPY_HW_MCU_NAME "SAMD51G19A"
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
#define MICROPY_PY_BUILTINS_COMPLEX (0)
#define MICROPY_PY_MATH (0)
#define MICROPY_PY_CMATH (0)
// 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 CPU_FREQ (48000000) // For selecting Baud from clock.

10
ports/samd/boards/ADAFRUIT_TRINKET_M0/mpconfigboard.h

@ -1,12 +1,2 @@
#define MICROPY_HW_BOARD_NAME "Trinket M0"
#define MICROPY_HW_MCU_NAME "SAMD21E18A"
// MicroPython configs
// samd_flash.c flash parameters
// Build a 64k Flash storage at top. 256k-64k=196k
// 256*1024=262144 minus 64*1024=65536 = 196608 = 0x30000
#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 CPU_FREQ (48000000) // For selecting Baud from clock.

15
ports/samd/boards/MINISAM_M4/mpconfigboard.h

@ -1,17 +1,2 @@
#define MICROPY_HW_BOARD_NAME "Mini SAM M4"
#define MICROPY_HW_MCU_NAME "SAMD51G19A"
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
#define MICROPY_PY_BUILTINS_COMPLEX (0)
#define MICROPY_PY_MATH (0)
#define MICROPY_PY_CMATH (0)
// 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 CPU_FREQ (48000000) // For selecting Baud from clock.

10
ports/samd/boards/SAMD21_XPLAINED_PRO/mpconfigboard.h

@ -1,12 +1,2 @@
#define MICROPY_HW_BOARD_NAME "SAMD21-XPLAINED-PRO"
#define MICROPY_HW_MCU_NAME "SAMD21J18A"
// MicroPython configs
// samd_flash.c flash parameters
// Build a 64k Flash storage at top. 256k-64k=196k
// 256*1024=262144 minus 64*1024=65536 = 196608 = 0x30000
#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 CPU_FREQ (48000000) // For selecting Baud from clock.

15
ports/samd/boards/SEEED_WIO_TERMINAL/mpconfigboard.h

@ -1,17 +1,2 @@
#define MICROPY_HW_BOARD_NAME "Wio Terminal D51R"
#define MICROPY_HW_MCU_NAME "SAMD51P19A"
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
#define MICROPY_PY_BUILTINS_COMPLEX (0)
#define MICROPY_PY_MATH (0)
#define MICROPY_PY_CMATH (0)
// 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) // 24x 64B flash pages;
#define CPU_FREQ (48000000) // For selecting Baud from clock.

10
ports/samd/boards/SEEED_XIAO/mpconfigboard.h

@ -1,12 +1,2 @@
#define MICROPY_HW_BOARD_NAME "Seeed Xiao"
#define MICROPY_HW_MCU_NAME "SAMD21G18A"
// MicroPython configs
// samd_flash.c flash parameters
// Build a 64k Flash storage at top. 256k-64k=196k
// 256*1024=262144 minus 64*1024=65536 = 196608 = 0x30000
#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 CPU_FREQ (48000000) // For selecting Baud from clock.

9
ports/samd/boards/mpconfig_samd21.h

@ -0,0 +1,9 @@
// Deinitions common to all SAMD21 boards
#include "samd21.h"
#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 CPU_FREQ (48000000)
#define APB_FREQ (48000000)

21
ports/samd/boards/mpconfig_samd51.h

@ -0,0 +1,21 @@
// Deinitions common to all SAMD51 boards
#include "samd51.h"
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
#define MICROPY_PY_BUILTINS_COMPLEX (0)
#define MICROPY_PY_MATH (0)
#define MICROPY_PY_CMATH (0)
// 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 CPU_FREQ (120000000)
#define APB_FREQ (48000000)
#define DPLLx_REF_FREQ (32768)

2
ports/samd/mpconfigport.h

@ -28,6 +28,8 @@
// Board specific definitions
#include "mpconfigboard.h"
// MCU-Specific definitions
#include MPCONFIG_MCU_H
// Memory allocation policies
#define MICROPY_GC_STACK_ENTRY_TYPE uint16_t

Loading…
Cancel
Save