-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
mimxrt: Rework flash configuration. #7767
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mimxrt: Rework flash configuration. #7767
Conversation
cc1a1f3
to
a88b94d
Compare
Just a few additional notes on that PR: |
a88b94d
to
13e9a27
Compare
@@ -0,0 +1,194 @@ | |||
#!/usr/bin/env python | |||
"""Evaluate FlexRAM configuration and generate startup code.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the license/copyright of this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was written by @alphaFred, so I assume it's MIT, and Philipp will add the appropriate License.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes - I will add the license
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please make the style of the license/copyright match existing files, eg tools/pyboard.py
and tools/mpy_ld.py
(use #
at the start of the line)
Regarding the startup_MIMXRTxxx.S files: in the HAL versions of these files the Reset_Handler function is defined as a weak symbol. So that means you can reimplement just this function in your own code, which is exactly what you need. This is how stm32 works, it uses the HAL's startup code to get the IRQ table, but reimplements Reset_Handler in Also, why exactly does the |
Hi @dpgeorge. Thanks for your review. Regarding your first point - I will give it a try and check if it works for us. Regarding On a side note: |
That is indeed the case. I just tested that (and compared the files) and it works for all MCU's I have here. |
13e9a27
to
b59a909
Compare
@dpgeorge I pushed an update with fixes. Tbh I was not sure about the format of the license statement for the Python script since I could not find a single other Python file in the project which had one. So let me know if it is ok for you 😄 |
b59a909
to
27ecec4
Compare
Codecov Report
@@ Coverage Diff @@
## master #7767 +/- ##
=======================================
Coverage 98.24% 98.25%
=======================================
Files 154 154
Lines 20040 20042 +2
=======================================
+ Hits 19689 19692 +3
+ Misses 351 350 -1
Continue to review full report at Codecov.
|
@@ -0,0 +1,194 @@ | |||
#!/usr/bin/env python | |||
"""Evaluate FlexRAM configuration and generate startup code.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please make the style of the license/copyright match existing files, eg tools/pyboard.py
and tools/mpy_ld.py
(use #
at the start of the line)
ldr r2, =__data_start__ | ||
ldr r3, =__data_end__ | ||
|
||
#ifdef __PERFORMANCE_IMPLEMENTATION |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The difference in code size between __PERFORMANCE_IMPLEMENTATION
enabled and disabled is very small, and these chips have a huge amount of flash, so I think it's simpler/cleaner to just unconditionally use the performance version of the code (ie remove the other code).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, I tried it out now but it does not work. Even when just compiling with __PERFORMANCE_IMPLEMENTATION
defined, MicroPython crashes.
If you are ok with it, let us merge it as it is and we will look into it later and fix it.
27ecec4
to
45f22f8
Compare
@dpgeorge I pushed an update with the required fixes (:smile: ) |
c1c76b7
to
f8bdfad
Compare
@dpgeorge @robert-hh Btw. whenever I execute
|
It's not showing on the CI here, so could be your local uncrustify version. |
Ok, then never mind :-) |
@alphaFred at this stage I'd still need to rebase it and reword the commit message (to something like `mimxrt: Rework flash configuration." to get the tense correct). But feel free to do that yourself if you like. |
Ok. I hope I get the tense right the next time at first try 😂. |
- Moves definition of BOARD_FLASH_SIZE and other header files related to flash configuration into the Makefile. - Adds board specific clock_config.h. - Adds board.h, pin_mux.h, and peripherals.h as they are required by NXP MCU SDK in order to use our own clock_config.h. - Renames board specific FlexSPI configuration files. - Updates flash frequency of MIMXRT1020_EVK - Creates separated flash_config files for QSPI NOR and QSPI Hyper flash. - Unifies VFS start address to be @ 1M for 1010 and 1020 boards. - Unifies 1050EVK boards - Adds support to both NOR and HyperFlash on boards with both capabilities. - Adds automatic FlexRAM initialization to start-up code based on linker script and NXP HAL. - Applies code formatting to all files in mimxrt port. With this change the flash configuration is restructured and organized. This simplifies the configuration process and provides a better overview of each board's settings. With the integration of clock_config.h, board.h, pin_mux.h, and peripherals.h we gain better control of the settings and clock configurations. Furthermore the implementation of an explicit FlexRAM setup improves the system performance and allows for performance tuning. Signed-off-by: Philipp Ebensberger
f8bdfad
to
0d7366c
Compare
@dpgeorge |
Merged! |
Make set_stack_limit respect fixed stack
flash configuration into the Makefile.
required by NXP MCU SDK in order to use our own clock_config.h.
QSPI Hyper flash.
both capabilities.
linker script and NXP HAL.
With this change the flash configuration is restructured.
This simplifies the configuration process and
provides a better overview of each board's settings. With the integration
of clock_config.h, board.h, pin_mux.h, and peripherals.h we gain better
control of the settings and clock configurations. Furthermore the
implementation of an explicit FlexRAM setup improves the system
performance and allows for performance tuning.
Signed-off-by: Philipp Ebensberger