Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython
Commits
ed5e3598
Commit
ed5e3598
authored
Feb 28, 2023
by
iabdalkader
Committed by
Damien George
Apr 11, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mimxrt/Makefile: Fix internal flash configuration and build.
parent
a22136a7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
34 deletions
+41
-34
ports/mimxrt/Makefile
ports/mimxrt/Makefile
+31
-23
ports/mimxrt/boards/MIMXRT1064.ld
ports/mimxrt/boards/MIMXRT1064.ld
+1
-9
ports/mimxrt/hal/flexspi_hyper_flash.h
ports/mimxrt/hal/flexspi_hyper_flash.h
+4
-1
ports/mimxrt/hal/flexspi_nor_flash.h
ports/mimxrt/hal/flexspi_nor_flash.h
+5
-1
No files found.
ports/mimxrt/Makefile
View file @
ed5e3598
...
...
@@ -228,21 +228,33 @@ SHARED_SRC_C += \
shared/runtime/sys_stdio_mphal.c
\
shared/timeutils/timeutils.c
\
# Add sources for respective board flash type
ifeq
($(MICROPY_HW_FLASH_TYPE),$(filter $(MICROPY_HW_FLASH_TYPE),qspi_nor_flash qspi_hyper_flash))
# Add hal/flexspi_nor_flash.c or hal/flashspi_hyper_flash.c respectively
SRC_HAL_C
+=
hal/flexspi_
$(
subst
qspi_,,
$(MICROPY_HW_FLASH_TYPE)
)
.c
#
# Add custom (board specific) or default configuration
ifeq
($(MICROPY_HW_BOARD_FLASH_FILES),1)
SRC_HAL_C
+=
$(BOARD_DIR)
/
$(MICROPY_HW_FLASH_TYPE)
_config.c
else
SRC_HAL_C
+=
hal/
$(MICROPY_HW_FLASH_TYPE)
_config.c
endif
# Set flash driver name, base address and internal flash flag, based on the flash type.
ifeq
($(MICROPY_HW_FLASH_TYPE),$(filter $(MICROPY_HW_FLASH_TYPE),qspi_nor_flash))
MICROPY_HW_FLASH_BASE
=
0x60000000
FLEXSPI_FLASH_TYPE
=
$(MICROPY_HW_FLASH_TYPE)
else
ifeq
($(MICROPY_HW_FLASH_TYPE),$(filter $(MICROPY_HW_FLASH_TYPE),qspi_hyper_flash))
MICROPY_HW_FLASH_BASE
=
0x60000000
FLEXSPI_FLASH_TYPE
=
$(MICROPY_HW_FLASH_TYPE)
else
ifeq
($(MICROPY_HW_FLASH_TYPE),$(filter $(MICROPY_HW_FLASH_TYPE),internal))
# The internal flash is an SPI NOR Flash.
MICROPY_HW_FLASH_BASE
=
0x70000000
FLEXSPI_FLASH_TYPE
=
qspi_nor_flash
CFLAGS
+=
-DMICROPY_HW_FLASH_INTERNAL
else
$(error Error
:
Unknown board flash type $(MICROPY_HW_FLASH_TYPE))
endif
# Add sources for respective board flash type
# Add hal/flexspi_nor_flash.c or hal/flashspi_hyper_flash.c respectively
SRC_HAL_C
+=
hal/flexspi_
$(
subst
qspi_,,
$(FLEXSPI_FLASH_TYPE)
)
.c
#
# Add custom (board specific) or default configuration
ifeq
($(MICROPY_HW_BOARD_FLASH_FILES),1)
SRC_HAL_C
+=
$(BOARD_DIR)
/
$(FLEXSPI_FLASH_TYPE)
_config.c
else
SRC_HAL_C
+=
hal/
$(FLEXSPI_FLASH_TYPE)
_config.c
endif
# Math library source files
ifeq
($(MICROPY_FLOAT_IMPL),double)
LIBM_SRC_C
+=
$(
addprefix
lib/libm_dbl/,
\
...
...
@@ -341,18 +353,14 @@ CFLAGS += \
-Wno-error
=
unused-parameter
# Configure respective board flash type
ifeq
($(MICROPY_HW_FLASH_TYPE),$(filter $(MICROPY_HW_FLASH_TYPE),qspi_nor_flash qspi_hyper_flash))
# Add hal/flexspi_nor_flash.h or hal/flexspi_hyper_flash.h respectively
CFLAGS
+=
-DBOARD_FLASH_OPS_HEADER_H
=
\"
hal/flexspi_
$(
subst
qspi_,,
$(MICROPY_HW_FLASH_TYPE)
)
.h
\"
#
# Add custom (board specific) or default configuration
ifeq
($(MICROPY_HW_BOARD_FLASH_FILES),1)
CFLAGS
+=
-DBOARD_FLASH_CONFIG_HEADER_H
=
\"
$(BOARD)
_flexspi_flash_config.h
\"
else
CFLAGS
+=
-DBOARD_FLASH_CONFIG_HEADER_H
=
\"
hal/flexspi_flash_config.h
\"
endif
# Add hal/flexspi_nor_flash.h or hal/flexspi_hyper_flash.h respectively
CFLAGS
+=
-DBOARD_FLASH_OPS_HEADER_H
=
\"
hal/flexspi_
$(
subst
qspi_,,
$(FLEXSPI_FLASH_TYPE)
)
.h
\"
#
# Add custom (board specific) or default configuration
ifeq
($(MICROPY_HW_BOARD_FLASH_FILES),1)
CFLAGS
+=
-DBOARD_FLASH_CONFIG_HEADER_H
=
\"
$(BOARD)
_flexspi_flash_config.h
\"
else
$(error Error
:
Unknown board flash type $(MICROPY_HW_FLASH_TYPE))
CFLAGS
+=
-DBOARD_FLASH_CONFIG_HEADER_H
=
\"
hal/flexspi_flash_config.h
\"
endif
# Configure floating point support
...
...
@@ -399,7 +407,7 @@ LDFLAGS += \
# the C preprocessor. Therefore keep LDDEFINES separated from LDFLAGS!
LDDEFINES
=
\
-DMICROPY_HW_FLASH_
TYPE
=
$(MICROPY_HW_FLASH_TYP
E)
\
-DMICROPY_HW_FLASH_
BASE
=
$(MICROPY_HW_FLASH_BAS
E)
\
-DMICROPY_HW_FLASH_SIZE
=
$(MICROPY_HW_FLASH_SIZE)
ifdef
MICROPY_HW_FLASH_RESERVED
...
...
ports/mimxrt/boards/MIMXRT1064.ld
View file @
ed5e3598
...
...
@@ -3,15 +3,7 @@
reserved_size = MICROPY_HW_FLASH_RESERVED;
#endif
#if MICROPY_HW_FLASH_TYPE == qspi_nor_flash
flash_start = 0x60000000;
#elif MICROPY_HW_FLASH_TYPE == qspi_hyper_flash
flash_start = 0x60000000;
#elif MICROPY_HW_FLASH_TYPE == internal
flash_start = 0x70000000;
#else
#error Unknown MICROPY_HW_FLASH_TYPE
#endif
flash_start = MICROPY_HW_FLASH_BASE;
flash_size = MICROPY_HW_FLASH_SIZE;
flash_end = DEFINED(reserved_size) ? ((flash_start) + (flash_size - reserved_size)) : ((flash_start) + (flash_size));
flash_config_start = flash_start;
...
...
ports/mimxrt/hal/flexspi_hyper_flash.h
View file @
ed5e3598
...
...
@@ -31,7 +31,10 @@
#include "fsl_flexspi.h"
// #include BOARD_FLASH_CONFIG_HEADER_H
#if defined MIMXRT117x_SERIES
#if defined MICROPY_HW_FLASH_INTERNAL
#define BOARD_FLEX_SPI FLEXSPI2
#define BOARD_FLEX_SPI_ADDR_BASE FlexSPI2_AMBA_BASE
#elif defined MIMXRT117x_SERIES
#define BOARD_FLEX_SPI FLEXSPI1
#define BOARD_FLEX_SPI_ADDR_BASE FlexSPI1_AMBA_BASE
#else
...
...
ports/mimxrt/hal/flexspi_nor_flash.h
View file @
ed5e3598
...
...
@@ -27,9 +27,13 @@
#define MICROPY_INCLUDED_MIMXRT_HAL_FLEXSPI_NOR_FLASH_H
#include "fsl_flexspi.h"
#include "mpconfigboard.h"
#include BOARD_FLASH_CONFIG_HEADER_H
#if defined MIMXRT117x_SERIES
#if defined MICROPY_HW_FLASH_INTERNAL
#define BOARD_FLEX_SPI FLEXSPI2
#define BOARD_FLEX_SPI_ADDR_BASE FlexSPI2_AMBA_BASE
#elif defined MIMXRT117x_SERIES
#define BOARD_FLEX_SPI FLEXSPI1
#define BOARD_FLEX_SPI_ADDR_BASE FlexSPI1_AMBA_BASE
#else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment