mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-11-17 07:05:31 +08:00
[BSP][NXP] Add new features of multicore, hyperram, cherryUSB, NETC and etherCAT (#11672)
* updated template files, conifg files and script files to support hypperram, multicore kickoff, rpmsg-lite, netc, cherryusb and ethercat. * updated different link files of GCC, IAR and KEIL, for supporting multicore kick-off and different loading methods * Updated .ini files to support debugging in keil. And updeated .mac files to support deugging in iar. * Updated template files, conifg files and script files of CM7 to support hypperram, multicore kickoff, rpmsg-lite, netc, cherryusb and ethercat. * Updated different link files of GCC, IAR and KEIL of CM7 project, for supporting multicore kick-off and different loading methods. * Modify LittleFS to use the last 1 MB of flash and update CM7 support for LittleFS on QSPI flash. * Updated different link files of loading to hyperram. * Updated .ini files of CM7 to support debugging in keil. And updeated .mac files of CM7 to support deugging in iar. * Remove Keil projects and keep templates only. * Remove RAMFUNC due to IAR compilation issues, and use linker configuration to place all flash operation code in RAM. * Add related code to support kick-offing CM7 and rpmsg-lite. * Add codes to support cherryUSB for CM33 and CM7. * Add mnt.c to support littleFS for CM7. * Add codes to support etherCAT for CM7. * Add codes to support USART12 for RT1180. * Modify the drv_uart_v2.c to fix some bug to make it can work in CM33, but still cannot work in CM7. Will continue to update in next version. * Updated README with both Chinese and English versions. * Move the EtherCAT code into the packages\nxp-imxrt-sdk-latest. * Remove EtherCAT-related sources, keep only SConscript. * updated ci.attachconfig.yml for cm33 and cm7 projects. * Fixed BSP_ROOT path error in rtconfig.py. * Added drv_netc.c and updated SConscript for netc. * Updated cherryusb_port.c to avoid worning. * Updated sconscript to locate multicore directory in packages for header inclusion. * Updated cm33/board/board.c to avoid worning when enable cm33_kickoff_cm7. * Deleted peripheral.ethercat, because the related protocol stack has not been uploaded. And added CONFIG_BSP_USING_GPIO=y for Peripheral.netc.: * Removed the SConscript of multicore and ethercat to packages. * Added CONFIG_BSP_USING_GPIO=y to Peripheral.hyperflash_dma. * Added CONFIG_BSP_USING_GPIO=y for Peripheral.hyperflash. * Reformat code according to coding standards. * Reformat code according to coding standards.
This commit is contained in:
1 parent
9d04b6baab
commit
bdd050fb5b
94 files changed
+32292
-9701
No files matched your search
@@ -0,0 +1,126 @@
|
||||
# i.MX RT1180 EVK Board BSP Guide
|
||||
|
||||
## Introduction
|
||||
|
||||
This document provides an initial BSP (Board Support Package) guide for the NXP i.MX RT1180 EVK development board.
|
||||
|
||||
The BSP currently supports independent compilation for CM33 and CM7, with CM33 as the primary core and CM7 as the secondary core. It is also possible to use the MCUXpresso Secure Provisioning Tool to generate a bootable dual-core image.
|
||||
|
||||
Main content includes:
|
||||
|
||||
- Development board resource overview
|
||||
- BSP quick start guide
|
||||
- Advanced usage instructions
|
||||
|
||||
By following the quick start guide, developers can quickly get this BSP running and bring RT-Thread up on the board. The advanced usage section introduces more features and helps developers use additional onboard resources with RT-Thread.
|
||||
|
||||
## Development Board Overview
|
||||
|
||||
The dual-core i.MX RT1180 combines an 800 MHz Cortex-M7 core with a 240 MHz Arm Cortex-M33 core, offering strong security and extensive networking capabilities, including dual gigabit Ethernet and multiple industrial communication interfaces. The i.MX RT1180 MCU supports a wide temperature range, making it suitable for industrial control, motor drive, and other applications.
|
||||
|
||||
## Peripheral Support
|
||||
|
||||
This BSP currently provides peripheral support:
|
||||
|
||||
| **Onboard Peripheral** | **Support Status** | **Notes** |
|
||||
| :--------------------- | :---------------: | :-------- |
|
||||
| QSPI Flash XIP | Supported | |
|
||||
| Flash driver(flexspi) | supported | |
|
||||
| CherryUSB | Supported | |
|
||||
| NETC | Supported | |
|
||||
| EtherCAT | Supported | |
|
||||
| **On-chip Peripheral** | **Support Status** | **Notes** |
|
||||
| Multicore kick-off | Supported | |
|
||||
| Rpmsg-lite | Supported | |
|
||||
| GPIO | supported | |
|
||||
| UART | Supported | |
|
||||
| SPI | Not yet supported | |
|
||||
| I2C | supported | |
|
||||
| ADC | supported | |
|
||||
| Timer | supported | |
|
||||
| SDIO | Not yet supported | |
|
||||
| RTC | Not yet supported | |
|
||||
| PWM | Not yet supported | |
|
||||
| CAN | Not yet supported | |
|
||||
|
||||
## Usage Instructions
|
||||
|
||||
Usage instructions are divided into two sections:
|
||||
|
||||
- Quick Start
|
||||
|
||||
This section is aimed at beginners new to RT-Thread. Following the simple steps here will get the RT-Thread operating system running on the development board.
|
||||
|
||||
- Advanced Usage
|
||||
|
||||
This section is for developers who want to use more board resources with RT-Thread. Using the ENV tool to configure the BSP enables additional onboard features and more advanced functionality.
|
||||
|
||||
### Quick Start
|
||||
|
||||
This BSP provides MDK5, IAR, and GCC projects. The following example uses the IAR development environment to describe how to run the system.
|
||||
|
||||
**Please note:**
|
||||
|
||||
Before compiling, open the ENV tool and run the following command to pull required packages (otherwise compilation may fail):
|
||||
|
||||
```bash
|
||||
pkgs --update
|
||||
```
|
||||
|
||||
Generate the IAR project:
|
||||
|
||||
```bash
|
||||
scons --target=iar
|
||||
```
|
||||
|
||||
Generate the KEIL MDK5 project:
|
||||
|
||||
```bash
|
||||
scons --target=mdk5
|
||||
```
|
||||
|
||||
Or compile the GCC project directly:
|
||||
|
||||
```bash
|
||||
scons -j8
|
||||
```
|
||||
|
||||
#### Hardware Connection
|
||||
|
||||
Connect the development board to the PC using a data cable, then turn on the power switch.
|
||||
|
||||
#### Build and Download
|
||||
|
||||
Double-click the `project.eww` file to open the IAR project, then build and download the program to the development board.
|
||||
|
||||
> The project is configured by default to use CMSIS-DAP for downloading. With CMSIS-DAP connected to the board, click the download button to program the board.
|
||||
|
||||
#### Run Result
|
||||
|
||||
After the program is downloaded successfully, the system starts automatically.
|
||||
|
||||
Connect the board's serial port to the PC and open the corresponding serial port in a terminal tool with settings `115200-8-1-N`. After resetting the device, you should see RT-Thread output like:
|
||||
|
||||
```
|
||||
\ | /
|
||||
- RT - Thread Operating System
|
||||
/ | \ 5.2.2 build May 15 2026 17:19:35
|
||||
2006 - 2024 Copyright by RT-Thread team
|
||||
```
|
||||
|
||||
### Advanced Usage
|
||||
|
||||
This BSP enables only UART1 by default. To use additional advanced peripherals, configure the BSP with the ENV tool as follows:
|
||||
|
||||
1. Open the env tool in the BSP directory.
|
||||
2. Enter `menuconfig` to configure the project, then save and exit.
|
||||
3. Run `pkgs --update` to update the packages.
|
||||
4. Run `scons --target=mdk5` or `scons --target=iar` to regenerate the project.
|
||||
|
||||
## Notes
|
||||
|
||||
None at this time.
|
||||
|
||||
## Contact
|
||||
|
||||
Maintainer:
|
||||
@@ -22,22 +22,28 @@ CM33对CM7的kick off将在后续版本中支持。
|
||||
|
||||
## 外设支持
|
||||
|
||||
本 BSP 目前对外设仅支持UART,作为第一次push的测试,之后会逐步完善。外设支持情况如下:
|
||||
本 BSP 外设支持情况如下:
|
||||
|
||||
| **板载外设** | **支持情况** | **备注** |
|
||||
| :----------------- | :----------: | :------------------------------------|
|
||||
| USB 转串口 | 暂不支持 | |
|
||||
| SPI Flash | 支持 | |
|
||||
| 以太网 | 暂不支持 | |
|
||||
| **片上外设** | **支持情况** | **备注** |
|
||||
| GPIO | 暂不支持 | |
|
||||
| UART | 支持 | |
|
||||
| SPI | 暂不支持 | |
|
||||
| I2C | 暂不支持 | |
|
||||
| SDIO | 暂不支持 | |
|
||||
| RTC | 暂不支持 | |
|
||||
| PWM | 暂不支持 | |
|
||||
| CAN | 暂不支持 | |
|
||||
| **板载外设** | **支持情况** | **备注** |
|
||||
| :--------------------- | :----------: | :------- |
|
||||
| QSPI Flash XIP | 支持 | |
|
||||
| Flash 驱动(flexspi) | 支持 | |
|
||||
| CherryUSB | 支持 | |
|
||||
| NETC | 支持 | |
|
||||
| EtherCAT | 支持 | |
|
||||
| **片上外设** | **支持情况** | **备注** |
|
||||
| 多核启动 | 支持 | |
|
||||
| Rpmsg-lite | 支持 | |
|
||||
| GPIO | 支持 | |
|
||||
| UART | 支持 | |
|
||||
| SPI | 暂不支持 | |
|
||||
| I2C | 支持 | |
|
||||
| ADC | 支持 | |
|
||||
| Timer | 支持 | |
|
||||
| SDIO | 暂不支持 | |
|
||||
| RTC | 暂不支持 | |
|
||||
| PWM | 暂不支持 | |
|
||||
| CAN | 暂不支持 | |
|
||||
|
||||
|
||||
## 使用说明
|
||||
|
||||
@@ -5,7 +5,7 @@ scons.args: &scons
|
||||
# ------ component CI ------
|
||||
|
||||
# ------ Peripheral CI ------
|
||||
Peripheral.flash_fs:
|
||||
Peripheral.qspi_flash_FS:
|
||||
<<: *scons
|
||||
kconfig:
|
||||
- CONFIG_BSP_USING_QSPI_FLASH_FS=y
|
||||
@@ -22,4 +22,12 @@ Peripheral.lpadc1:
|
||||
kconfig:
|
||||
- CONFIG_RT_USING_ADC=y
|
||||
- CONFIG_BSP_USING_LPADC=y
|
||||
- CONFIG_BSP_USING_LPADC1=y
|
||||
- CONFIG_BSP_USING_LPADC1=y
|
||||
Peripheral.usb_device:
|
||||
<<: *scons
|
||||
kconfig:
|
||||
- CONFIG_BSP_USING_USB=y
|
||||
Peripheral.multicore:
|
||||
<<: *scons
|
||||
kconfig:
|
||||
- CONFIG_BSP_USE_MULTICORE=y
|
||||
@@ -118,7 +118,7 @@ CONFIG_RT_ALIGN_SIZE=8
|
||||
CONFIG_RT_THREAD_PRIORITY_32=y
|
||||
# CONFIG_RT_THREAD_PRIORITY_256 is not set
|
||||
CONFIG_RT_THREAD_PRIORITY_MAX=32
|
||||
CONFIG_RT_TICK_PER_SECOND=100
|
||||
CONFIG_RT_TICK_PER_SECOND=1000
|
||||
CONFIG_RT_USING_OVERFLOW_CHECK=y
|
||||
CONFIG_RT_USING_HOOK=y
|
||||
CONFIG_RT_HOOK_USING_FUNC_PTR=y
|
||||
@@ -126,7 +126,10 @@ CONFIG_RT_HOOK_USING_FUNC_PTR=y
|
||||
CONFIG_RT_USING_IDLE_HOOK=y
|
||||
CONFIG_RT_IDLE_HOOK_LIST_SIZE=4
|
||||
CONFIG_IDLE_THREAD_STACK_SIZE=4096
|
||||
# CONFIG_RT_USING_TIMER_SOFT is not set
|
||||
CONFIG_RT_USING_TIMER_SOFT=y
|
||||
CONFIG_RT_TIMER_THREAD_PRIO=4
|
||||
CONFIG_RT_TIMER_THREAD_STACK_SIZE=2048
|
||||
# CONFIG_RT_USING_TIMER_ALL_SOFT is not set
|
||||
# CONFIG_RT_USING_CPU_USAGE_TRACER is not set
|
||||
|
||||
#
|
||||
@@ -190,7 +193,6 @@ CONFIG_ARCH_USING_HW_ATOMIC_16=y
|
||||
CONFIG_RT_USING_CPU_FFS=y
|
||||
CONFIG_ARCH_ARM=y
|
||||
CONFIG_ARCH_ARM_CORTEX_M=y
|
||||
CONFIG_ARCH_ARM_CORTEX_FPU=y
|
||||
CONFIG_ARCH_ARM_CORTEX_SECURE=y
|
||||
CONFIG_ARCH_ARM_CORTEX_M33=y
|
||||
|
||||
@@ -587,8 +589,6 @@ CONFIG_RT_LIBC_TZ_DEFAULT_SEC=0
|
||||
# tools packages
|
||||
#
|
||||
# CONFIG_PKG_USING_VECTOR is not set
|
||||
# CONFIG_PKG_USING_SORCH is not set
|
||||
# CONFIG_PKG_USING_DICT is not set
|
||||
# CONFIG_PKG_USING_CMBACKTRACE is not set
|
||||
# CONFIG_PKG_USING_MCOREDUMP is not set
|
||||
# CONFIG_PKG_USING_EASYFLASH is not set
|
||||
@@ -735,8 +735,6 @@ CONFIG_RT_LIBC_TZ_DEFAULT_SEC=0
|
||||
# CONFIG_PKG_USING_HEARTBEAT is not set
|
||||
# CONFIG_PKG_USING_MICRO_ROS_RTTHREAD_PACKAGE is not set
|
||||
# CONFIG_PKG_USING_CHERRYECAT is not set
|
||||
# CONFIG_PKG_USING_EVENT_LOOP is not set
|
||||
# CONFIG_PKG_USING_THREAD_MANAGER is not set
|
||||
# end of system packages
|
||||
|
||||
#
|
||||
@@ -820,21 +818,7 @@ CONFIG_RT_LIBC_TZ_DEFAULT_SEC=0
|
||||
# CONFIG_PKG_USING_NRFX is not set
|
||||
# CONFIG_PKG_USING_RASPBERRYPI_PICO_RP2350_SDK is not set
|
||||
# CONFIG_PKG_USING_RASPBERRYPI_PICO_SDK is not set
|
||||
|
||||
#
|
||||
# MM32 HAL & SDK Drivers
|
||||
#
|
||||
# CONFIG_PKG_USING_MM32F103XX_CMSIS is not set
|
||||
# CONFIG_PKG_USING_MM32F3270X_CMSIS is not set
|
||||
# CONFIG_PKG_USING_MM32F5260X_CMSIS is not set
|
||||
# CONFIG_PKG_USING_MM32L0XX_CMSIS is not set
|
||||
# CONFIG_PKG_USING_MM32L3XX_CMSIS is not set
|
||||
# CONFIG_PKG_USING_MM32F103XX_HAL_DRIVER is not set
|
||||
# CONFIG_PKG_USING_MM32F3270X_HAL_DRIVER is not set
|
||||
# CONFIG_PKG_USING_MM32F5260X_HAL_DRIVER is not set
|
||||
# CONFIG_PKG_USING_MM32L0XX_HAL_DRIVER is not set
|
||||
# CONFIG_PKG_USING_MM32L3XX_HAL_DRIVER is not set
|
||||
# end of MM32 HAL & SDK Drivers
|
||||
# CONFIG_PKG_USING_MM32 is not set
|
||||
|
||||
#
|
||||
# WCH HAL & SDK Drivers
|
||||
@@ -899,7 +883,9 @@ CONFIG_PKG_NXP_IMXRT_DRIVER_VER="latest"
|
||||
#
|
||||
# NUVOTON Drivers
|
||||
#
|
||||
# CONFIG_PKG_USING_NUVOTON_CMSIS_DRIVER is not set
|
||||
# CONFIG_PKG_USING_NUVOTON_SERIES_DRIVER is not set
|
||||
# CONFIG_PKG_USING_NUVOTON_ARM926_LIB is not set
|
||||
# end of NUVOTON Drivers
|
||||
|
||||
#
|
||||
@@ -925,12 +911,6 @@ CONFIG_PKG_NXP_IMXRT_DRIVER_VER="latest"
|
||||
# CONFIG_PKG_USING_FT32F4_STD_DRIVER is not set
|
||||
# CONFIG_PKG_USING_FT32F4_CMSIS_DRIVER is not set
|
||||
# end of FT32 HAL & SDK Drivers
|
||||
|
||||
#
|
||||
# NOVOSNS Drivers
|
||||
#
|
||||
# CONFIG_PKG_USING_NOVOSNS_SERIES_DRIVER is not set
|
||||
# end of NOVOSNS Drivers
|
||||
# end of HAL & SDK Drivers
|
||||
|
||||
#
|
||||
@@ -1111,7 +1091,6 @@ CONFIG_PKG_NXP_IMXRT_DRIVER_VER="latest"
|
||||
# CONFIG_PKG_USING_ISOTP_C is not set
|
||||
# CONFIG_PKG_USING_IKUNLED is not set
|
||||
# CONFIG_PKG_USING_INS5T8025 is not set
|
||||
# CONFIG_PKG_USING_IRUART is not set
|
||||
# CONFIG_PKG_USING_ST7305 is not set
|
||||
# CONFIG_PKG_USING_TM1668 is not set
|
||||
# CONFIG_PKG_USING_SPI_TOOLS is not set
|
||||
@@ -1467,7 +1446,6 @@ CONFIG_SOC_MIMXRT1189CVM8C_CM33=y
|
||||
# On-chip Peripheral Drivers
|
||||
#
|
||||
# CONFIG_BSP_USING_DMA is not set
|
||||
# CONFIG_BSP_USING_LPADC is not set
|
||||
CONFIG_BSP_USING_GPIO=y
|
||||
# CONFIG_BSP_USING_RTC is not set
|
||||
# CONFIG_BSP_USING_USB is not set
|
||||
@@ -1476,18 +1454,26 @@ CONFIG_BSP_USING_LPUART=y
|
||||
CONFIG_BSP_USING_LPUART1=y
|
||||
# CONFIG_BSP_LPUART1_RX_USING_DMA is not set
|
||||
# CONFIG_BSP_LPUART1_TX_USING_DMA is not set
|
||||
# CONFIG_BSP_USING_LPUART2 is not set
|
||||
# CONFIG_BSP_USING_LPUART3 is not set
|
||||
# CONFIG_BSP_USING_LPUART4 is not set
|
||||
# CONFIG_BSP_USING_LPUART5 is not set
|
||||
# CONFIG_BSP_USING_LPUART6 is not set
|
||||
# CONFIG_BSP_USING_LPUART7 is not set
|
||||
# CONFIG_BSP_USING_LPUART8 is not set
|
||||
# CONFIG_BSP_USING_LPUART9 is not set
|
||||
# CONFIG_BSP_USING_LPUART10 is not set
|
||||
# CONFIG_BSP_USING_LPUART11 is not set
|
||||
# CONFIG_BSP_USING_LPUART12 is not set
|
||||
# CONFIG_BSP_USING_I2C is not set
|
||||
# CONFIG_BSP_USING_CAN is not set
|
||||
# CONFIG_BSP_USING_CLOCK_TIMER is not set
|
||||
# CONFIG_BSP_USING_FLEXSPI is not set
|
||||
# end of On-chip Peripheral Drivers
|
||||
|
||||
#
|
||||
# Onboard Peripheral Drivers
|
||||
#
|
||||
# CONFIG_BSP_USING_SDRAM is not set
|
||||
# CONFIG_BSP_USE_HYPERRAM is not set
|
||||
# CONFIG_BSP_USE_MULTICORE is not set
|
||||
# CONFIG_BSP_USING_ETH is not set
|
||||
# CONFIG_BSP_USING_FS is not set
|
||||
# end of Onboard Peripheral Drivers
|
||||
@@ -1495,4 +1481,7 @@ CONFIG_BSP_USING_LPUART1=y
|
||||
#
|
||||
# Board extended module Drivers
|
||||
#
|
||||
# CONFIG_BSP_LINKER_SCRIPT_RAM is not set
|
||||
CONFIG_BSP_LINKER_SCRIPT_FLEXSPI_NOR=y
|
||||
# CONFIG_BSP_LINKER_SCRIPT_FLEXSPI_NOR_HYPERRAM is not set
|
||||
# end of Hardware Drivers Config
|
||||
@@ -13,7 +13,7 @@ MaxNumAPs = 0
|
||||
LowPowerHandlingMode = 0
|
||||
OverrideMemMap = 0
|
||||
AllowSimulation = 1
|
||||
ScriptFile=""
|
||||
ScriptFile="evkmimxrt1180_cm33.jlinkscript"
|
||||
[FLASH]
|
||||
RMWThreshold = 0x400
|
||||
Loaders=""
|
||||
|
||||
@@ -3,7 +3,11 @@ from building import *
|
||||
import os
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
src = Glob('*.c')
|
||||
|
||||
src = Split("""
|
||||
main.c
|
||||
""")
|
||||
|
||||
CPPPATH = [cwd]
|
||||
|
||||
# add for startup script
|
||||
@@ -12,6 +16,17 @@ if rtconfig.PLATFORM in ['gcc']:
|
||||
else:
|
||||
CPPDEFINES = []
|
||||
|
||||
if GetDepend(['BSP_USE_MULTICORE']):
|
||||
src += Split("""
|
||||
multicore_thread.c
|
||||
""")
|
||||
|
||||
if GetDepend(['BSP_USING_FS']):
|
||||
src += Split("""
|
||||
mnt.c
|
||||
""")
|
||||
|
||||
# Create application group
|
||||
group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES=CPPDEFINES)
|
||||
|
||||
Return('group')
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -59,70 +59,116 @@ void BOARD_InitPins(void)
|
||||
CLOCK_EnableClock(kCLOCK_Iomuxc1); /* Turn on LPCG: LPCG is ON. */
|
||||
CLOCK_EnableClock(kCLOCK_Iomuxc2); /* Turn on LPCG: LPCG is ON. */
|
||||
|
||||
#ifdef BSP_USING_LPUART1
|
||||
IOMUXC_SetPinMux(
|
||||
IOMUXC_GPIO_AON_08_LPUART1_TX,
|
||||
0U);
|
||||
IOMUXC_GPIO_AON_08_LPUART1_TX, /* GPIO_AON_08 is configured as LPUART1_TX */
|
||||
0U); /* Software Input On Field: Input Path is determined by functionality */
|
||||
IOMUXC_SetPinMux(
|
||||
IOMUXC_GPIO_AON_09_LPUART1_RX,
|
||||
0U);
|
||||
IOMUXC_GPIO_AON_09_LPUART1_RX, /* GPIO_AON_09 is configured as LPUART1_RX */
|
||||
0U); /* Software Input On Field: Input Path is determined by functionality */
|
||||
IOMUXC_SetPinConfig(
|
||||
IOMUXC_GPIO_AON_08_LPUART1_TX,
|
||||
0x02U);
|
||||
IOMUXC_GPIO_AON_08_LPUART1_TX, /* GPIO_AON_08 PAD functional properties : */
|
||||
0x02U); /* Slew Rate Field: Fast Slew Rate
|
||||
Drive Strength Field: high driver
|
||||
Pull / Keep Select Field: Pull Disable, Highz
|
||||
Pull Up / Down Config. Field: Weak pull down
|
||||
Open Drain Field: Disabled */
|
||||
IOMUXC_SetPinConfig(
|
||||
IOMUXC_GPIO_AON_09_LPUART1_RX,
|
||||
0x02U);
|
||||
IOMUXC_GPIO_AON_09_LPUART1_RX, /* GPIO_AON_09 PAD functional properties : */
|
||||
0x02U); /* Slew Rate Field: Fast Slew Rate
|
||||
Drive Strength Field: high driver
|
||||
Pull / Keep Select Field: Pull Disable, Highz
|
||||
Pull Up / Down Config. Field: Weak pull down
|
||||
Open Drain Field: Disabled */
|
||||
#endif
|
||||
|
||||
#ifdef BSP_USING_LPUART10
|
||||
IOMUXC_SetPinMux(
|
||||
IOMUXC_GPIO_AD_32_LPUART10_TX,
|
||||
0U);
|
||||
IOMUXC_GPIO_AD_32_LPUART10_TX, /* GPIO_AD_32 is configured as LPUART10_TX */
|
||||
0U); /* Software Input On Field: Input Path is determined by functionality */
|
||||
IOMUXC_SetPinMux(
|
||||
IOMUXC_GPIO_AD_33_LPUART10_RX,
|
||||
0U);
|
||||
IOMUXC_GPIO_AD_33_LPUART10_RX, /* GPIO_AD_33 is configured as LPUART10_RX */
|
||||
0U); /* Software Input On Field: Input Path is determined by functionality */
|
||||
IOMUXC_SetPinConfig(
|
||||
IOMUXC_GPIO_AD_32_LPUART10_TX,
|
||||
0x02U);
|
||||
IOMUXC_GPIO_AD_32_LPUART10_TX, /* GPIO_AD_32 PAD functional properties : */
|
||||
0x02U); /* Slew Rate Field: Fast Slew Rate
|
||||
Drive Strength Field: high driver
|
||||
Pull / Keep Select Field: Pull Disable, Highz
|
||||
Pull Up / Down Config. Field: Weak pull down
|
||||
Open Drain Field: Disabled */
|
||||
IOMUXC_SetPinConfig(
|
||||
IOMUXC_GPIO_AD_33_LPUART10_RX,
|
||||
0x02U);
|
||||
IOMUXC_GPIO_AD_33_LPUART10_RX, /* GPIO_AD_33 PAD functional properties : */
|
||||
0x02U); /* Slew Rate Field: Fast Slew Rate
|
||||
Drive Strength Field: high driver
|
||||
Pull / Keep Select Field: Pull Disable, Highz
|
||||
Pull Up / Down Config. Field: Weak pull down
|
||||
Open Drain Field: Disabled */
|
||||
#endif
|
||||
|
||||
#ifdef BSP_USING_LPUART12
|
||||
IOMUXC_SetPinMux(
|
||||
IOMUXC_GPIO_AON_19_LPUART12_TX,
|
||||
0U);
|
||||
IOMUXC_GPIO_AON_19_LPUART12_TX, /* GPIO_AON_19 is configured as LPUART12_TX */
|
||||
0U); /* Software Input On Field: Input Path is determined by functionality */
|
||||
IOMUXC_SetPinMux(
|
||||
IOMUXC_GPIO_AON_20_LPUART12_RX,
|
||||
0U);
|
||||
IOMUXC_GPIO_AON_20_LPUART12_RX, /* GPIO_AON_20 is configured as LPUART12_RX */
|
||||
0U); /* Software Input On Field: Input Path is determined by functionality */
|
||||
IOMUXC_SetPinConfig(
|
||||
IOMUXC_GPIO_AON_19_LPUART12_TX,
|
||||
0x02U);
|
||||
IOMUXC_GPIO_AON_19_LPUART12_TX, /* GPIO_AON_19 PAD functional properties : */
|
||||
0x02U); /* Slew Rate Field: Fast Slew Rate
|
||||
Drive Strength Field: high driver
|
||||
Pull / Keep Select Field: Pull Disable, Highz
|
||||
Pull Up / Down Config. Field: Weak pull down
|
||||
Open Drain Field: Disabled */
|
||||
IOMUXC_SetPinConfig(
|
||||
IOMUXC_GPIO_AON_20_LPUART12_RX,
|
||||
0x02U);
|
||||
IOMUXC_GPIO_AON_20_LPUART12_RX, /* GPIO_AON_20 PAD functional properties : */
|
||||
0x02U); /* Slew Rate Field: Fast Slew Rate
|
||||
Drive Strength Field: high driver
|
||||
Pull / Keep Select Field: Pull Disable, Highz
|
||||
Pull Up / Down Config. Field: Weak pull down
|
||||
Open Drain Field: Disabled */
|
||||
#endif
|
||||
|
||||
#ifdef BSP_USING_I2C2
|
||||
IOMUXC_SetPinMux(
|
||||
IOMUXC_GPIO_AON_16_LPI2C2_SCL,
|
||||
1U);
|
||||
IOMUXC_GPIO_AON_16_LPI2C2_SCL, /* GPIO_AON_16 is configured as LPI2C2_SCL */
|
||||
1U); /* Software Input On Field: Force input path of pad GPIO_AON_16 */
|
||||
IOMUXC_SetPinMux(
|
||||
IOMUXC_GPIO_AON_15_LPI2C2_SDA,
|
||||
1U);
|
||||
IOMUXC_GPIO_AON_15_LPI2C2_SDA, /* GPIO_AON_15 is configured as LPI2C2_SDA */
|
||||
1U); /* Software Input On Field: Force input path of pad GPIO_AON_15 */
|
||||
IOMUXC_SetPinConfig(
|
||||
IOMUXC_GPIO_AON_16_LPI2C2_SCL,
|
||||
0x1DU);
|
||||
IOMUXC_GPIO_AON_16_LPI2C2_SCL, /* GPIO_AON_16 PAD functional properties : */
|
||||
0x1DU); /* Slew Rate Field: Slow Slew Rate
|
||||
Pull Enable Field: Pull Enable
|
||||
Pull Up / Down Config. Field: Weak pull up
|
||||
Open Drain Field: Enabled */
|
||||
IOMUXC_SetPinConfig(
|
||||
IOMUXC_GPIO_AON_15_LPI2C2_SDA,
|
||||
0x1DU);
|
||||
IOMUXC_GPIO_AON_15_LPI2C2_SDA, /* GPIO_AON_15 PAD functional properties : */
|
||||
0x1DU); /* Slew Rate Field: Slow Slew Rate
|
||||
Pull Enable Field: Pull Enable
|
||||
Pull Up / Down Config. Field: Weak pull up
|
||||
Open Drain Field: Enabled */
|
||||
#endif
|
||||
|
||||
#ifdef BSP_USING_I2C3
|
||||
IOMUXC_SetPinMux(
|
||||
IOMUXC_GPIO_AD_18_LPI2C3_SCL,
|
||||
0U);
|
||||
IOMUXC_GPIO_AON_16_LPI2C2_SCL, /* GPIO_AON_16 is configured as LPI2C2_SCL */
|
||||
1U); /* Software Input On Field: Force input path of pad GPIO_AON_16 */
|
||||
IOMUXC_SetPinMux(
|
||||
IOMUXC_GPIO_AD_19_LPI2C3_SDA,
|
||||
0U);
|
||||
IOMUXC_GPIO_AON_15_LPI2C2_SDA, /* GPIO_AON_15 is configured as LPI2C2_SDA */
|
||||
1U); /* Software Input On Field: Force input path of pad GPIO_AON_15 */
|
||||
IOMUXC_SetPinConfig(
|
||||
IOMUXC_GPIO_AD_18_LPI2C3_SCL,
|
||||
0x1DU);
|
||||
IOMUXC_GPIO_AON_16_LPI2C2_SCL, /* GPIO_AON_16 PAD functional properties : */
|
||||
0x1DU); /* Slew Rate Field: Slow Slew Rate
|
||||
Pull Enable Field: Pull Enable
|
||||
Pull Up / Down Config. Field: Weak pull up
|
||||
Open Drain Field: Enabled */
|
||||
IOMUXC_SetPinConfig(
|
||||
IOMUXC_GPIO_AD_19_LPI2C3_SDA,
|
||||
0x1DU);
|
||||
IOMUXC_GPIO_AON_15_LPI2C2_SDA, /* GPIO_AON_15 PAD functional properties : */
|
||||
0x1DU); /* Slew Rate Field: Slow Slew Rate
|
||||
Pull Enable Field: Pull Enable
|
||||
Pull Up / Down Config. Field: Weak pull up
|
||||
Open Drain Field: Enabled */
|
||||
#endif
|
||||
}
|
||||
|
||||
void BOARD_InitLeds(void)
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
#ifndef _PIN_MUX_H_
|
||||
#define _PIN_MUX_H_
|
||||
|
||||
#include <rtthread.h>
|
||||
|
||||
/*!
|
||||
* @addtogroup pin_mux
|
||||
* @{
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
Import('rtconfig')
|
||||
Import('RTT_ROOT')
|
||||
|
||||
from building import *
|
||||
import rtconfig
|
||||
import os
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
|
||||
@@ -30,19 +31,58 @@ if GetDepend(['BSP_USING_LPADC1']):
|
||||
else:
|
||||
CPPPATH = [cwd,cwd + '/MCUX_Config',cwd + '/ports']
|
||||
|
||||
CPPDEFINES = ['CPU_MIMXRT1189CVM8C_cm33', 'MCUXPRESSO_SDK', 'MCUX_META_BUILD', 'MIMXRT1189_cm33_SERIES', 'XIP_BOOT_HEADER_ENABLE=1', 'XIP_BOOT_HEADER_DCD_ENABLE=1', 'XIP_EXTERNAL_FLASH=1', 'ARM_MATH_CM33']
|
||||
CPPDEFINES = ['CPU_MIMXRT1189CVM8C_cm33', 'MCUXPRESSO_SDK', 'MCUX_META_BUILD', 'MIMXRT1189_cm33_SERIES', 'ARM_MATH_CM33']
|
||||
LINKFLAGS = ''
|
||||
|
||||
if rtconfig.PLATFORM in ['gcc']:
|
||||
CPPDEFINES += ['__STARTUP_INITIALIZE_RAMFUNCTION']
|
||||
|
||||
if rtconfig.PLATFORM in ['armcc', 'armclang']:
|
||||
# CPPDEFINES += ['SDK_DEBUGCONSOLE']
|
||||
CPPDEFINES += ['NDEBUG']
|
||||
|
||||
if rtconfig.PLATFORM in ['iccarm']:
|
||||
CPPDEFINES += ['NDEBUG']
|
||||
# CPPDEFINES += ['FSL_SDK_DRIVER_QUICK_ACCESS_ENABLE=1']
|
||||
|
||||
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES=CPPDEFINES)
|
||||
if GetDepend(['BSP_USE_HYPERRAM']):
|
||||
CPPDEFINES += ['USE_HYPERRAM=1']
|
||||
|
||||
if GetDepend(['BSP_USE_MULTICORE']):
|
||||
CPPDEFINES += ['__USE_SHMEM', 'MULTICORE_APP=1']
|
||||
if rtconfig.PLATFORM in ['gcc']:
|
||||
LINKFLAGS += ' -Wl,-defsym,__use_shmem__=1'
|
||||
LINKFLAGS += ' -Wl,-defsym,__multicore__=1'
|
||||
if rtconfig.PLATFORM in ['armcc', 'armclang']:
|
||||
LINKFLAGS += ' --predefine="-D__use_shmem__=1"'
|
||||
LINKFLAGS += ' --predefine="-D__multicore__=1"'
|
||||
if rtconfig.PLATFORM in ['iccarm']:
|
||||
LINKFLAGS += ' __use_shmem__=1'
|
||||
LINKFLAGS += ' __multicore__=1'
|
||||
|
||||
if GetDepend(['BSP_USING_ETH']):
|
||||
CPPDEFINES += ['SDK_NETC_USED=1', 'FSL_ETH_ENABLE_CACHE_CONTROL=1']
|
||||
|
||||
if GetDepend(['RT_USING_CHERRYUSB']):
|
||||
cherryusb_path = os.path.join(RTT_ROOT, 'components', 'drivers', 'usb', 'cherryusb')
|
||||
src += ['cherryusb_port.c']
|
||||
if GetDepend(['RT_CHERRYUSB_DEVICE_TEMPLATE_CDC_ACM']):
|
||||
src += ['cherryusb_cdc_acm.c']
|
||||
if GetDepend(['BSP_CHERRYUSB_HOST_MOUSE_DEMO']):
|
||||
src += ['usbh_mouse_demo.c']
|
||||
CPPPATH += [
|
||||
cherryusb_path,
|
||||
os.path.join(cherryusb_path, 'common'),
|
||||
os.path.join(cherryusb_path, 'core'),
|
||||
os.path.join(cherryusb_path, 'class', 'hub'),
|
||||
os.path.join(cherryusb_path, 'class', 'cdc'),
|
||||
os.path.join(cherryusb_path, 'class', 'hid'),
|
||||
]
|
||||
|
||||
if GetDepend(['BSP_LINKER_SCRIPT_FLEXSPI_NOR']):
|
||||
CPPDEFINES += ['XIP_BOOT_HEADER_ENABLE=1', 'XIP_EXTERNAL_FLASH=1']
|
||||
|
||||
if GetDepend(['BSP_LINKER_SCRIPT_FLEXSPI_NOR_HYPERRAM']):
|
||||
CPPDEFINES += ['XIP_BOOT_HEADER_ENABLE=1', 'XIP_EXTERNAL_FLASH=1']
|
||||
|
||||
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES=CPPDEFINES, LINKFLAGS = LINKFLAGS)
|
||||
|
||||
Return('group')
|
||||
File diff suppressed because it is too large.
Load diff
@@ -161,6 +161,7 @@ void DCDC_SetVoltage(uint8_t core, uint8_t targetVoltage);
|
||||
void BOARD_NETC_Init(void);
|
||||
void BOARD_RequestTRDC(bool bRequestAON, bool bRequestWakeup, bool bReqeustMega);
|
||||
void BOARD_CommonSetting(void);
|
||||
void PHY_Reset(void);
|
||||
|
||||
/* </RDTConfigurator>*/
|
||||
#if defined(__ARMCC_VERSION)
|
||||
@@ -179,11 +180,14 @@ extern int __HeapLimit;
|
||||
#define HEAP_END ((void *)&__HeapLimit)
|
||||
#endif
|
||||
|
||||
/*! @brief The board flash size */
|
||||
#define BOARD_FLASH_SIZE (0x1000000U)
|
||||
|
||||
void rt_hw_board_init(void);
|
||||
|
||||
status_t BOARD_GetCore1ImageAddrSize(uint32_t *pImageSrcAddr,
|
||||
uint32_t *pImageDestAddr,
|
||||
uint32_t *pImageSize,
|
||||
uint32_t *pImageBootAddr);
|
||||
void BOARD_PrepareCore1(uint32_t image_src_addr, uint32_t image_dest_addr, uint32_t image_size, uint32_t boot_addr);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
+2
-2
@@ -74,7 +74,7 @@ if (isdefinedsymbol(__stack_size__)) {
|
||||
if (isdefinedsymbol(__heap_size__)) {
|
||||
define symbol __size_heap__ = __heap_size__;
|
||||
} else {
|
||||
define symbol __size_heap__ = 0x04000;
|
||||
define symbol __size_heap__ = 0x08000;
|
||||
}
|
||||
|
||||
define symbol m_qacode_start = m_code_tcm_start + (isdefinedsymbol(__ram_vector_table__) ? vector_table_size : 0);
|
||||
@@ -155,7 +155,7 @@ define block CORE1_IMAGE_BLOCK with alignment = 16, maximum size = m_core1_imag
|
||||
|
||||
define block RO with fixed order { readonly section .intvec, readonly, block CORE1_IMAGE_BLOCK };
|
||||
|
||||
initialize by copy { readwrite, section .textrw, section DataQuickAccess, section CodeQuickAccess };
|
||||
initialize by copy { readwrite, section .textrw, section DataQuickAccess, section CodeQuickAccess, ro code object fsl_flexspi.o, ro code object drv_flexspi_nor_flash.o, ro code object drv_flexspi.o };
|
||||
do not initialize { section .noinit };
|
||||
if (isdefinedsymbol(__use_shmem__)) {
|
||||
do not initialize { section rpmsg_sh_mem_section };
|
||||
+12
-9
@@ -1,18 +1,20 @@
|
||||
/*
|
||||
** ###################################################################
|
||||
** Processors: MIMXRT1189CVM8B_cm33
|
||||
** MIMXRT1189CVM8C_cm33
|
||||
** MIMXRT1189XVM8B_cm33
|
||||
** MIMXRT1189XVM8C_cm33
|
||||
**
|
||||
** Compiler: GNU C Compiler
|
||||
** Reference manual: IMXRT1180RM, Rev 2, 12/2022
|
||||
** Version: rev. 0.1, 2021-03-09
|
||||
** Build: b240109
|
||||
** Reference manual: IMXRT1180RM, Rev 5, 01/2024
|
||||
** Version: rev. 2.0, 2024-01-18
|
||||
** Build: b250310
|
||||
**
|
||||
** Abstract:
|
||||
** Linker file for the GNU C Compiler
|
||||
**
|
||||
** Copyright 2016 Freescale Semiconductor, Inc.
|
||||
** Copyright 2016-2024 NXP
|
||||
** Copyright 2016-2025 NXP
|
||||
** SPDX-License-Identifier: BSD-3-Clause
|
||||
**
|
||||
** http: www.nxp.com
|
||||
@@ -24,6 +26,9 @@
|
||||
/* Entry Point */
|
||||
ENTRY(Reset_Handler)
|
||||
|
||||
__use_shmem__ = 1;
|
||||
__multicore__ = 1;
|
||||
|
||||
/* Board memory map */
|
||||
m_code_tcm_start = 0x0FFE0000;
|
||||
m_code_tcm_size = 0x00020000;
|
||||
@@ -40,7 +45,7 @@ m_sdram_size = DEFINED(__dual_image__) ? 0x00200000 : 0x02000000;
|
||||
m_hyperram_start = DEFINED(__dual_image__) ? 0x04600000 : 0x04000000;
|
||||
m_hyperram_size = DEFINED(__dual_image__) ? 0x00200000 : 0x00800000;
|
||||
m_flash_start = 0x28000000;
|
||||
m_flash_size = 0x01000000;
|
||||
m_flash_size = 0x00800000;
|
||||
|
||||
m_core1_image_maximum_size = 0x00040000;
|
||||
|
||||
@@ -59,7 +64,7 @@ m_xmcd_end = m_xmcd_start + m_xmcd_size - 1;
|
||||
m_container_start = m_flash_start + m_container_offset;
|
||||
m_container_end = m_container_start + m_container_size - 1;
|
||||
|
||||
app_image_offset = DEFINED(__dual_image__) ? 0x0010B000 : 0x0000B000;
|
||||
app_image_offset = 0x0000B000;
|
||||
vector_table_size = 0x00000400;
|
||||
m_qacode_start = m_code_tcm_start + (DEFINED(__ram_vector_table__) ? vector_table_size : 0);
|
||||
m_qacode_end = m_code_tcm_start + m_code_tcm_size - 1;
|
||||
@@ -67,7 +72,7 @@ m_qadata_start = m_system_tcm_start;
|
||||
m_qadata_end = m_system_tcm_start + m_system_tcm_size - 1;
|
||||
m_ram_vector_table_start = m_code_tcm_start;
|
||||
m_stack_size = DEFINED(__stack_size__) ? __stack_size__ : 0x1000;
|
||||
m_heap_size = DEFINED(__heap_size__) ? __heap_size__ : 0x4000;
|
||||
m_heap_size = DEFINED(__heap_size__) ? __heap_size__ : 0x8000;
|
||||
|
||||
/* Target specific definition, code & data allocation */
|
||||
m_code_size = m_flash_size - app_image_offset - vector_table_size;
|
||||
@@ -277,7 +282,6 @@ SECTIONS
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__data_start__ = .; /* create a global symbol at data start */
|
||||
*(m_usb_dma_init_data)
|
||||
*(.data) /* .data sections */
|
||||
*(.data*) /* .data* sections */
|
||||
*(DataQuickAccess) /* quick access data section */
|
||||
@@ -336,7 +340,6 @@ SECTIONS
|
||||
/* This is used by the startup in order to initialize the .bss section */
|
||||
. = ALIGN(4);
|
||||
__bss_start__ = .;
|
||||
*(m_usb_dma_noninit_data)
|
||||
*(.bss)
|
||||
*(.bss*)
|
||||
*(COMMON)
|
||||
+4
-2
@@ -78,7 +78,7 @@
|
||||
#if defined(__heap_size__)
|
||||
#define heap_size __heap_size__
|
||||
#else
|
||||
#define heap_size 0x20000
|
||||
#define heap_size 0x08000
|
||||
#endif
|
||||
|
||||
/* Target specific definition, code & data allocation */
|
||||
@@ -173,8 +173,10 @@ LR_m_text m_text_start m_text_size
|
||||
|
||||
ER_m_QuickAccessCode m_qacode_start m_qacode_size
|
||||
{
|
||||
fsl_flexspi.o (+RO-CODE)
|
||||
.ANY (CodeQuickAccess)
|
||||
fsl_flexspi.o (+RO-CODE)
|
||||
drv_flexspi_nor_flash.o (+RO-CODE)
|
||||
drv_flexspi.o (+RO-CODE)
|
||||
}
|
||||
|
||||
ER_m_QuickAccessData m_qadata_start EMPTY m_qadata_size
|
||||
+187
@@ -0,0 +1,187 @@
|
||||
/*
|
||||
** ###################################################################
|
||||
** Processors: MIMXRT1189CVM8B_cm33
|
||||
** MIMXRT1189CVM8C_cm33
|
||||
** MIMXRT1189XVM8B_cm33
|
||||
** MIMXRT1189XVM8C_cm33
|
||||
**
|
||||
** Compiler: IAR ANSI C/C++ Compiler for ARM
|
||||
** Reference manual: IMXRT1180RM, Rev 5, 01/2024
|
||||
** Version: rev. 2.0, 2024-01-18
|
||||
** Build: b250310
|
||||
**
|
||||
** Abstract:
|
||||
** Linker file for the IAR ANSI C/C++ Compiler for ARM
|
||||
**
|
||||
** Copyright 2016 Freescale Semiconductor, Inc.
|
||||
** Copyright 2016-2025 NXP
|
||||
** SPDX-License-Identifier: BSD-3-Clause
|
||||
**
|
||||
** http: www.nxp.com
|
||||
** mail: support@nxp.com
|
||||
**
|
||||
** ###################################################################
|
||||
*/
|
||||
|
||||
/* Board memory map */
|
||||
|
||||
define symbol m_code_tcm_start = 0x0FFE0000;
|
||||
define symbol m_code_tcm_size = 0x00020000;
|
||||
|
||||
define symbol m_system_tcm_start = 0x20000000;
|
||||
define symbol m_system_tcm_size = 0x00020000;
|
||||
|
||||
define symbol m_ocram1_start = 0x20484000; /* OCRAM1 first 16K access is blocked by TRDC */
|
||||
define symbol m_ocram1_size = 0x0007C000;
|
||||
|
||||
define symbol m_ocram2_start = 0x20500000;
|
||||
define symbol m_ocram2_size = 0x00040000;
|
||||
|
||||
/* CM33 use last 2M bytes space of sdram and hyperram for dual image framework */
|
||||
define symbol m_sdram_start = isdefinedsymbol(__dual_image__) ? 0x81E00000 : 0x80000000;
|
||||
define symbol m_sdram_size = isdefinedsymbol(__dual_image__) ? 0x00200000 : 0x02000000;
|
||||
define symbol m_hyperram_start = isdefinedsymbol(__dual_image__) ? 0x04600000 : 0x04000000;
|
||||
define symbol m_hyperram_size = isdefinedsymbol(__dual_image__) ? 0x00200000 : 0x00800000;
|
||||
define symbol m_flash_start = 0x28000000;
|
||||
define symbol m_flash_size = 0x00800000;
|
||||
|
||||
define symbol m_core1_image_maximum_size = 0x00040000;
|
||||
|
||||
/* General definition */
|
||||
define symbol m_fcb_offset = 0x400;
|
||||
define symbol m_fcb_size = 0x200;
|
||||
define symbol m_fcb_start = m_flash_start + m_fcb_offset;
|
||||
define symbol m_fcb_end = m_fcb_start + m_fcb_size - 1;
|
||||
|
||||
define symbol m_xmcd_offset = 0x800;
|
||||
define symbol m_xmcd_size = 0x400;
|
||||
define symbol m_xmcd_start = m_flash_start + m_xmcd_offset;
|
||||
define symbol m_xmcd_end = m_xmcd_start + m_xmcd_size - 1;
|
||||
|
||||
define symbol m_container_offset = 0x1000;
|
||||
define symbol m_container_size = 0x2000;
|
||||
define symbol m_container_start = m_flash_start + m_container_offset;
|
||||
define symbol m_container_end = m_container_start + m_container_size - 1;
|
||||
|
||||
define symbol app_image_offset = 0x0000B000;
|
||||
define symbol vector_table_size = 0x00000400;
|
||||
if (isdefinedsymbol(__stack_size__)) {
|
||||
define symbol __size_cstack__ = __stack_size__;
|
||||
} else {
|
||||
define symbol __size_cstack__ = 0x01000;
|
||||
}
|
||||
|
||||
if (isdefinedsymbol(__heap_size__)) {
|
||||
define symbol __size_heap__ = __heap_size__;
|
||||
} else {
|
||||
define symbol __size_heap__ = 0x08000;
|
||||
}
|
||||
|
||||
define symbol m_qacode_start = m_code_tcm_start + (isdefinedsymbol(__ram_vector_table__) ? vector_table_size : 0);
|
||||
define symbol m_qacode_end = m_code_tcm_start + m_code_tcm_size - 1;
|
||||
define symbol m_qadata_start = m_system_tcm_start;
|
||||
define symbol m_qadata_end = m_system_tcm_start + m_system_tcm_size - 1;
|
||||
define symbol m_ram_vector_table_start = m_code_tcm_start;
|
||||
|
||||
/* Target specific definition, code & data allocation */
|
||||
define symbol m_code_size = m_flash_size - app_image_offset;
|
||||
define symbol m_data_size = m_hyperram_size;
|
||||
define symbol m_ncache_size = isdefinedsymbol(__multicore__) ? 0x20000 : 0x40000; /* m_ncache_size must be 2^N */
|
||||
define symbol m_shmem_size = m_ocram2_size; /* m_shmem_size must be 2^N */
|
||||
|
||||
define symbol m_ocram1_size_for_cm7 = isdefinedsymbol(__multicore__) ? 0x40000 : 0;
|
||||
|
||||
define symbol m_ram_vector_table_size = isdefinedsymbol(__ram_vector_table__) ? vector_table_size : 0;
|
||||
|
||||
define symbol m_text_start = m_flash_start + app_image_offset;
|
||||
define symbol m_text_end = m_text_start + m_code_size - 1;
|
||||
define symbol m_interrupts_start = m_text_start;
|
||||
|
||||
define symbol m_data_start = m_hyperram_start;
|
||||
define symbol m_data_end = m_data_start + m_data_size - 1;
|
||||
|
||||
define symbol m_ncache_start = m_ocram1_start + m_ocram1_size - m_ocram1_size_for_cm7 - m_ncache_size;
|
||||
define symbol m_ncache_end = m_ncache_start + m_ncache_size - 1;
|
||||
|
||||
define symbol m_heap_start = m_ocram1_start;
|
||||
define symbol m_heap_end = m_ncache_start - 1;
|
||||
|
||||
if (isdefinedsymbol(__use_shmem__)) {
|
||||
define symbol m_rpmsg_sh_mem_start = m_ocram2_start;
|
||||
define symbol m_rpmsg_sh_mem_end = m_rpmsg_sh_mem_start + m_shmem_size - 1;
|
||||
}
|
||||
|
||||
/* Region definition */
|
||||
define memory mem with size = 4G;
|
||||
define region FCB_region = mem:[from m_fcb_start to m_fcb_end];
|
||||
define region XMCD_region = mem:[from m_xmcd_start to m_xmcd_end];
|
||||
define region CONTAINER_region = mem:[from m_container_start to m_container_end];
|
||||
define region TEXT_region = mem:[from m_text_start to m_text_end];
|
||||
define region DATA_region = mem:[from m_data_start to m_data_end-__size_cstack__];
|
||||
define region CSTACK_region = mem:[from m_data_end-__size_cstack__+1 to m_data_end];
|
||||
define region NCACHE_region = mem:[from m_ncache_start to m_ncache_end];
|
||||
define region HEAP_region = mem:[from m_heap_start to m_heap_end];
|
||||
define region QACODE_region = mem:[from m_qacode_start to m_qacode_end];
|
||||
define region QADATA_region = mem:[from m_qadata_start to m_qadata_end];
|
||||
if (isdefinedsymbol(__use_shmem__)) {
|
||||
define region rpmsg_sh_mem_region = mem:[from m_rpmsg_sh_mem_start to m_rpmsg_sh_mem_end];
|
||||
}
|
||||
|
||||
/* Exported symbol definition */
|
||||
define exported symbol __VECTOR_TABLE = m_interrupts_start;
|
||||
define exported symbol __VECTOR_RAM = m_ram_vector_table_start;
|
||||
define exported symbol __RAM_VECTOR_TABLE_SIZE = m_ram_vector_table_size;
|
||||
define exported symbol __NCACHE_REGION_START = m_ncache_start;
|
||||
define exported symbol __NCACHE_REGION_SIZE = m_ncache_end - m_ncache_start + 1;
|
||||
define exported symbol __CONTAINER_IMG_OFFSET = start(TEXT_region) - start(CONTAINER_region);
|
||||
define exported symbol __CONTAINER_IMG_LOAD_ADDR = start(TEXT_region);
|
||||
define exported symbol __CONTAINER_IMG_ENTRY_ADDR = start(TEXT_region);
|
||||
if (isdefinedsymbol(__use_shmem__)) {
|
||||
define exported symbol rpmsg_sh_mem_start = m_rpmsg_sh_mem_start;
|
||||
define exported symbol rpmsg_sh_mem_end = m_rpmsg_sh_mem_end;
|
||||
define exported symbol __RPMSG_SH_MEM_START = m_rpmsg_sh_mem_start;
|
||||
define exported symbol __RPMSG_SH_MEM_SIZE = m_rpmsg_sh_mem_end - m_rpmsg_sh_mem_start + 1;
|
||||
}
|
||||
|
||||
/* Block definition */
|
||||
define block RW { readwrite };
|
||||
define block ZI { zi };
|
||||
define block NCACHE_VAR { section NonCacheable , section NonCacheable.init };
|
||||
define block QACCESS_CODE { section CodeQuickAccess };
|
||||
define block QACCESS_DATA { section DataQuickAccess };
|
||||
define block CSTACK with alignment = 8, size = __size_cstack__ { };
|
||||
define block HEAP with alignment = 8, size = __size_heap__ { };
|
||||
define block CORE1_IMAGE_BLOCK with alignment = 16, maximum size = m_core1_image_maximum_size { section __core1_image };
|
||||
|
||||
/* cache line size = 16 bytes */
|
||||
define block CACHE_LINE_DATA_ZI with alignment = 16, end alignment = 16 { section CacheLineData };
|
||||
define block CACHE_LINE_DATA_RW with alignment = 16, end alignment = 16 { section CacheLineData.init };
|
||||
|
||||
define block RO with fixed order { readonly section .intvec, readonly, block CORE1_IMAGE_BLOCK };
|
||||
|
||||
initialize by copy { readwrite, section .textrw, section DataQuickAccess, section CodeQuickAccess, ro code object fsl_flexspi.o, ro code object drv_flexspi_nor_flash.o, ro code object drv_flexspi.o };
|
||||
do not initialize { section .noinit };
|
||||
if (isdefinedsymbol(__use_shmem__)) {
|
||||
do not initialize { section rpmsg_sh_mem_section };
|
||||
}
|
||||
|
||||
keep{ section .boot_hdr.conf, section .boot_hdr.xmcd_data, section .boot_hdr.container };
|
||||
|
||||
place in FCB_region { section .boot_hdr.conf };
|
||||
place in XMCD_region { section .boot_hdr.xmcd_data };
|
||||
place in CONTAINER_region { section .boot_hdr.container };
|
||||
place in TEXT_region { first block RO };
|
||||
place in QACODE_region { section .textrw, block QACCESS_CODE };
|
||||
place in DATA_region { block RW, block CACHE_LINE_DATA_RW };
|
||||
place in DATA_region { block ZI, block CACHE_LINE_DATA_ZI };
|
||||
place in QADATA_region { block QACCESS_DATA };
|
||||
place in NCACHE_region { block NCACHE_VAR };
|
||||
place in CSTACK_region { block CSTACK };
|
||||
if (isdefinedsymbol(__heap_noncacheable__)) {
|
||||
place in NCACHE_region { last block HEAP };
|
||||
} else {
|
||||
place in HEAP_region { last block HEAP };
|
||||
}
|
||||
if (isdefinedsymbol(__use_shmem__)) {
|
||||
place in rpmsg_sh_mem_region { section rpmsg_sh_mem_section };
|
||||
}
|
||||
+383
File diff suppressed because it is too large.
Load diff
+248
File diff suppressed because it is too large.
Load diff
+158
@@ -0,0 +1,158 @@
|
||||
/*
|
||||
** ###################################################################
|
||||
** Processors: MIMXRT1189CVM8B_cm33
|
||||
** MIMXRT1189CVM8C_cm33
|
||||
** MIMXRT1189XVM8B_cm33
|
||||
** MIMXRT1189XVM8C_cm33
|
||||
**
|
||||
** Compiler: IAR ANSI C/C++ Compiler for ARM
|
||||
** Reference manual: IMXRT1180RM, Rev 5, 01/2024
|
||||
** Version: rev. 2.0, 2024-01-18
|
||||
** Build: b250310
|
||||
**
|
||||
** Abstract:
|
||||
** Linker file for the IAR ANSI C/C++ Compiler for ARM
|
||||
**
|
||||
** Copyright 2016 Freescale Semiconductor, Inc.
|
||||
** Copyright 2016-2025 NXP
|
||||
** SPDX-License-Identifier: BSD-3-Clause
|
||||
**
|
||||
** http: www.nxp.com
|
||||
** mail: support@nxp.com
|
||||
**
|
||||
** ###################################################################
|
||||
*/
|
||||
|
||||
/* Board memory map */
|
||||
|
||||
define symbol m_code_tcm_start = 0x0FFE0000;
|
||||
define symbol m_code_tcm_size = 0x00020000;
|
||||
|
||||
define symbol m_system_tcm_start = 0x20000000;
|
||||
define symbol m_system_tcm_size = 0x00020000;
|
||||
|
||||
define symbol m_ocram1_start = 0x20484000; /* OCRAM1 first 16K access is blocked by TRDC */
|
||||
define symbol m_ocram1_size = 0x0007C000;
|
||||
|
||||
define symbol m_ocram2_start = 0x20500000;
|
||||
define symbol m_ocram2_size = 0x00040000;
|
||||
|
||||
/* CM33 use last 2M bytes space of sdram and hyperram for dual image framework */
|
||||
define symbol m_sdram_start = isdefinedsymbol(__dual_image__) ? 0x81E00000 : 0x80000000;
|
||||
define symbol m_sdram_size = isdefinedsymbol(__dual_image__) ? 0x00200000 : 0x02000000;
|
||||
define symbol m_hyperram_start = isdefinedsymbol(__dual_image__) ? 0x04600000 : 0x04000000;
|
||||
define symbol m_hyperram_size = isdefinedsymbol(__dual_image__) ? 0x00200000 : 0x00800000;
|
||||
define symbol m_flash_start = 0x28000000;
|
||||
define symbol m_flash_size = 0x01000000;
|
||||
|
||||
define symbol m_core1_image_maximum_size = 0x00040000;
|
||||
|
||||
/* General definition */
|
||||
define symbol app_image_offset = isdefinedsymbol(__dual_image__) ? 0x0010B000 : 0x0000B000;
|
||||
define symbol vector_table_size = 0x00000400;
|
||||
if (isdefinedsymbol(__stack_size__)) {
|
||||
define symbol __size_cstack__ = __stack_size__;
|
||||
} else {
|
||||
define symbol __size_cstack__ = 0x01000;
|
||||
}
|
||||
|
||||
if (isdefinedsymbol(__heap_size__)) {
|
||||
define symbol __size_heap__ = __heap_size__;
|
||||
} else {
|
||||
define symbol __size_heap__ = 0x08000;
|
||||
}
|
||||
|
||||
define symbol m_qacode_start = m_code_tcm_start + (isdefinedsymbol(__ram_vector_table__) ? vector_table_size : 0);
|
||||
define symbol m_qacode_end = m_code_tcm_start + m_code_tcm_size - 1;
|
||||
define symbol m_qadata_start = m_system_tcm_start;
|
||||
define symbol m_qadata_end = m_system_tcm_start + m_system_tcm_size - 1;
|
||||
define symbol m_ram_vector_table_start = m_code_tcm_start;
|
||||
|
||||
/* Target specific definition, code & data allocation */
|
||||
define symbol m_code_size = m_code_tcm_size;
|
||||
define symbol m_data_size = m_system_tcm_size;
|
||||
define symbol m_ncache_size = isdefinedsymbol(__multicore__) ? 0x20000 : 0x40000; /* m_ncache_size must be 2^N */
|
||||
define symbol m_shmem_size = m_ocram2_size; /* m_shmem_size must be 2^N */
|
||||
|
||||
define symbol m_ocram1_size_for_cm7 = isdefinedsymbol(__multicore__) ? 0x40000 : 0;
|
||||
|
||||
define symbol m_ram_vector_table_size = isdefinedsymbol(__ram_vector_table__) ? 0 : 0;
|
||||
|
||||
define symbol m_text_start = m_code_tcm_start;
|
||||
define symbol m_text_end = m_text_start + m_code_size - 1;
|
||||
define symbol m_interrupts_start = m_text_start;
|
||||
|
||||
define symbol m_data_start = m_system_tcm_start;
|
||||
define symbol m_data_end = m_data_start + m_data_size - 1;
|
||||
|
||||
define symbol m_ncache_start = m_ocram1_start + m_ocram1_size - m_ocram1_size_for_cm7 - m_ncache_size;
|
||||
define symbol m_ncache_end = m_ncache_start + m_ncache_size - 1;
|
||||
|
||||
define symbol m_heap_start = m_ocram1_start;
|
||||
define symbol m_heap_end = m_ncache_start - 1;
|
||||
|
||||
if (isdefinedsymbol(__use_shmem__)) {
|
||||
define symbol m_rpmsg_sh_mem_start = m_ocram2_start;
|
||||
define symbol m_rpmsg_sh_mem_end = m_rpmsg_sh_mem_start + m_shmem_size - 1;
|
||||
}
|
||||
|
||||
/* Exported symbol definition */
|
||||
define exported symbol __VECTOR_TABLE = m_interrupts_start;
|
||||
define exported symbol __VECTOR_RAM = m_ram_vector_table_start;
|
||||
define exported symbol __RAM_VECTOR_TABLE_SIZE = m_ram_vector_table_size;
|
||||
define exported symbol __NCACHE_REGION_START = m_ncache_start;
|
||||
define exported symbol __NCACHE_REGION_SIZE = m_ncache_end - m_ncache_start + 1;
|
||||
if (isdefinedsymbol(__use_shmem__)) {
|
||||
define exported symbol rpmsg_sh_mem_start = m_rpmsg_sh_mem_start;
|
||||
define exported symbol rpmsg_sh_mem_end = m_rpmsg_sh_mem_end;
|
||||
define exported symbol __RPMSG_SH_MEM_START = m_rpmsg_sh_mem_start;
|
||||
define exported symbol __RPMSG_SH_MEM_SIZE = m_rpmsg_sh_mem_end - m_rpmsg_sh_mem_start + 1;
|
||||
}
|
||||
|
||||
/* Region definition */
|
||||
define memory mem with size = 4G;
|
||||
define region TEXT_region = mem:[from m_text_start to m_text_end];
|
||||
define region DATA_region = mem:[from m_data_start to m_data_end-__size_cstack__];
|
||||
define region CSTACK_region = mem:[from m_data_end-__size_cstack__+1 to m_data_end];
|
||||
define region NCACHE_region = mem:[from m_ncache_start to m_ncache_end];
|
||||
define region HEAP_region = mem:[from m_heap_start to m_heap_end];
|
||||
define region QACODE_region = mem:[from m_qacode_start to m_qacode_end];
|
||||
define region QADATA_region = mem:[from m_qadata_start to m_qadata_end];
|
||||
if (isdefinedsymbol(__use_shmem__)) {
|
||||
define region rpmsg_sh_mem_region = mem:[from m_rpmsg_sh_mem_start to m_rpmsg_sh_mem_end];
|
||||
}
|
||||
|
||||
/* Block definition */
|
||||
define block RW { readwrite };
|
||||
define block ZI { zi };
|
||||
define block NCACHE_VAR { section NonCacheable , section NonCacheable.init };
|
||||
define block QACCESS_CODE { section CodeQuickAccess };
|
||||
define block QACCESS_DATA { section DataQuickAccess };
|
||||
define block CSTACK with alignment = 8, size = __size_cstack__ { };
|
||||
define block HEAP with alignment = 8, size = __size_heap__ { };
|
||||
define block CORE1_IMAGE_BLOCK with alignment = 16, maximum size = m_core1_image_maximum_size { section __core1_image };
|
||||
|
||||
initialize by copy { readwrite, section .textrw, section DataQuickAccess };
|
||||
do not initialize { section .noinit };
|
||||
if (isdefinedsymbol(__use_shmem__)) {
|
||||
do not initialize { section rpmsg_sh_mem_section };
|
||||
}
|
||||
|
||||
place at address mem: m_interrupts_start { readonly section .intvec };
|
||||
|
||||
place in TEXT_region { readonly };
|
||||
place in TEXT_region { block CORE1_IMAGE_BLOCK };
|
||||
place in TEXT_region { block QACCESS_CODE };
|
||||
place in DATA_region { block RW };
|
||||
place in DATA_region { block ZI };
|
||||
place in DATA_region { block QACCESS_DATA };
|
||||
place in NCACHE_region { block NCACHE_VAR };
|
||||
place in CSTACK_region { block CSTACK };
|
||||
if (isdefinedsymbol(__heap_noncacheable__)) {
|
||||
place in NCACHE_region { last block HEAP };
|
||||
} else {
|
||||
place in HEAP_region { last block HEAP };
|
||||
}
|
||||
if (isdefinedsymbol(__use_shmem__)) {
|
||||
place in rpmsg_sh_mem_region { section rpmsg_sh_mem_section };
|
||||
}
|
||||
+341
File diff suppressed because it is too large.
Load diff
+197
@@ -0,0 +1,197 @@
|
||||
#!armclang --target=arm-arm-none-eabi -mcpu=cortex-m33 -E -x c
|
||||
/*
|
||||
** ###################################################################
|
||||
** Processors: MIMXRT1189CVM8B_cm33
|
||||
** MIMXRT1189CVM8C_cm33
|
||||
** MIMXRT1189XVM8B_cm33
|
||||
** MIMXRT1189XVM8C_cm33
|
||||
**
|
||||
** Compiler: Keil ARM C/C++ Compiler
|
||||
** Reference manual: IMXRT1180RM, Rev 5, 01/2024
|
||||
** Version: rev. 2.0, 2024-01-18
|
||||
** Build: b250310
|
||||
**
|
||||
** Abstract:
|
||||
** Linker file for the Keil ARM C/C++ Compiler
|
||||
**
|
||||
** Copyright 2016 Freescale Semiconductor, Inc.
|
||||
** Copyright 2016-2025 NXP
|
||||
** SPDX-License-Identifier: BSD-3-Clause
|
||||
**
|
||||
** http: www.nxp.com
|
||||
** mail: support@nxp.com
|
||||
**
|
||||
** ###################################################################
|
||||
*/
|
||||
|
||||
|
||||
/* Board memory map */
|
||||
|
||||
#define m_code_tcm_start 0x0FFE0000
|
||||
#define m_code_tcm_size 0x00020000
|
||||
|
||||
#define m_system_tcm_start 0x20000000
|
||||
#define m_system_tcm_size 0x00020000
|
||||
|
||||
#define m_ocram1_start 0x20484000 /* OCRAM1 first 16K access is blocked by TRDC */
|
||||
#define m_ocram1_size 0x0007C000
|
||||
|
||||
#define m_ocram2_start 0x20500000
|
||||
#define m_ocram2_size 0x00040000
|
||||
|
||||
#if defined(__dual_image__)
|
||||
/* CM33 use last 2M bytes space of sdram and hyperram for dual image framework */
|
||||
#define m_sdram_start 0x81E00000
|
||||
#define m_sdram_size 0x00200000
|
||||
#define m_hyperram_start 0x04600000
|
||||
#define m_hyperram_size 0x00200000
|
||||
#else
|
||||
#define m_sdram_start 0x80000000
|
||||
#define m_sdram_size 0x02000000
|
||||
#define m_hyperram_start 0x04000000
|
||||
#define m_hyperram_size 0x00800000
|
||||
#endif
|
||||
|
||||
#define m_flash_start 0x28000000
|
||||
#define m_flash_size 0x01000000
|
||||
#define m_core1_image_maximum_size 0x00040000
|
||||
|
||||
/* General definition */
|
||||
#if defined(__dual_image__)
|
||||
#define app_image_offset 0x0010B000
|
||||
#else
|
||||
#define app_image_offset 0x0000B000
|
||||
#endif
|
||||
|
||||
#define vector_table_size 0x400
|
||||
#define m_ram_vector_table_start m_code_tcm_start
|
||||
|
||||
#if defined(__stack_size__)
|
||||
#define stack_size __stack_size__
|
||||
#else
|
||||
#define stack_size 0x01000
|
||||
#endif
|
||||
|
||||
#if defined(__heap_size__)
|
||||
#define heap_size __heap_size__
|
||||
#else
|
||||
#define heap_size 0x08000
|
||||
#endif
|
||||
|
||||
/* Target specific definition, code & data allocation */
|
||||
#if defined(__ram_vector_table__)
|
||||
#define m_ram_vector_table_size 0
|
||||
#else
|
||||
#define m_ram_vector_table_size 0
|
||||
#endif
|
||||
|
||||
#define m_qacode_start m_code_tcm_start + m_ram_vector_table_size
|
||||
#define m_qadata_start m_system_tcm_start
|
||||
#define m_qacode_size 0
|
||||
#define m_qadata_size 0
|
||||
|
||||
#define m_text_size m_code_tcm_size
|
||||
#define m_data_size m_system_tcm_size
|
||||
#if defined(__multicore__)
|
||||
#define m_ncache_size 0x20000 /* m_ncache_size must be 2^N */
|
||||
#define m_ocram1_size_for_cm7 0x40000
|
||||
#else
|
||||
#define m_ncache_size 0x40000 /* m_ncache_size must be 2^N */
|
||||
#define m_ocram1_size_for_cm7 0
|
||||
#endif
|
||||
#define m_shmem_size m_ocram2_size /* m_shmem_size must be 2^N */
|
||||
|
||||
#define m_text_start m_code_tcm_start
|
||||
#define m_interrupts_start m_text_start
|
||||
#define m_data_start m_system_tcm_start
|
||||
#define m_ncache_start m_ocram1_start + m_ocram1_size - m_ocram1_size_for_cm7 - m_ncache_size
|
||||
#define m_heap_start m_ocram1_start
|
||||
|
||||
#if defined(__use_shmem__)
|
||||
#define m_shmem_start m_ocram2_start
|
||||
#endif
|
||||
|
||||
; load region
|
||||
LR_m_text m_text_start m_text_size
|
||||
{
|
||||
; load address = execution address
|
||||
VECTOR_ROM m_interrupts_start FIXED vector_table_size
|
||||
{
|
||||
* (.isr_vector,+FIRST)
|
||||
}
|
||||
|
||||
VECTOR_RAM m_ram_vector_table_start EMPTY m_ram_vector_table_size
|
||||
{
|
||||
}
|
||||
|
||||
; load address = execution address
|
||||
ER_m_text m_text_start + vector_table_size FIXED m_text_size - vector_table_size
|
||||
{
|
||||
* (InRoot$$Sections)
|
||||
.ANY (+RO)
|
||||
.ANY (CodeQuickAccess)
|
||||
}
|
||||
|
||||
CORE1_REGION +0 ALIGN 16 m_core1_image_maximum_size
|
||||
{
|
||||
.ANY (.core1_code)
|
||||
}
|
||||
|
||||
ER_m_QuickAccessCode m_qacode_start EMPTY m_qacode_size
|
||||
{
|
||||
}
|
||||
|
||||
ER_m_QuickAccessData m_qadata_start EMPTY m_qadata_size
|
||||
{
|
||||
}
|
||||
|
||||
RW_m_data m_data_start m_data_size-stack_size
|
||||
{
|
||||
.ANY (+RW +ZI)
|
||||
.ANY (DataQuickAccess)
|
||||
}
|
||||
|
||||
; ncache data
|
||||
RW_m_ncache m_ncache_start m_ncache_size
|
||||
{
|
||||
.ANY (NonCacheable.init)
|
||||
.ANY (.bss.NonCacheable)
|
||||
}
|
||||
|
||||
#if defined(__heap_noncacheable__)
|
||||
; Heap region growing up
|
||||
ARM_LIB_HEAP +0 ALIGN 0x100 EMPTY heap_size
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
; Empty region added for MPU configuration
|
||||
RW_m_ncache_aux m_ncache_start + m_ncache_size EMPTY 0
|
||||
{
|
||||
}
|
||||
|
||||
#if defined(__use_shmem__)
|
||||
; shared memory data
|
||||
RPMSG_SH_MEM m_shmem_start m_shmem_size
|
||||
{
|
||||
.ANY (rpmsg_sh_mem_section)
|
||||
}
|
||||
|
||||
; Empty region added for MPU configuration
|
||||
RPMSG_SH_MEM_aux m_shmem_start + m_shmem_size EMPTY 0
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(__heap_noncacheable__)
|
||||
; Heap region growing up
|
||||
ARM_LIB_HEAP m_heap_start EMPTY heap_size
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
; Stack region growing down
|
||||
ARM_LIB_STACK m_data_start+m_data_size EMPTY -stack_size
|
||||
{
|
||||
}
|
||||
}
|
||||
-1041
File diff suppressed because it is too large.
Load diff
@@ -104,7 +104,7 @@ rt_inline int _addr_safe(rt_uint32_t offset, rt_size_t size)
|
||||
/*
|
||||
* _nor_write_enable - send WREN command (SDK: flexspi_nor_write_enable)
|
||||
*/
|
||||
QSPI_RAM_CODE static status_t _nor_write_enable(rt_uint32_t base_addr)
|
||||
static status_t _nor_write_enable(rt_uint32_t base_addr)
|
||||
{
|
||||
flexspi_transfer_t xfer;
|
||||
|
||||
@@ -123,7 +123,7 @@ QSPI_RAM_CODE static status_t _nor_write_enable(rt_uint32_t base_addr)
|
||||
* W25Q128JWSIQ SR1[0] = WIP (Write In Progress)
|
||||
* FLASH_BUSY_STATUS_POL = 1: bit set means busy
|
||||
*/
|
||||
QSPI_RAM_CODE static status_t _nor_wait_busy(void)
|
||||
static status_t _nor_wait_busy(void)
|
||||
{
|
||||
rt_uint32_t read_val = 0;
|
||||
rt_uint32_t timeout = 0;
|
||||
@@ -172,7 +172,7 @@ QSPI_RAM_CODE static status_t _nor_wait_busy(void)
|
||||
*
|
||||
* @addr: Flash internal offset (not AHB address)
|
||||
*/
|
||||
QSPI_RAM_CODE static status_t _nor_erase_sector(rt_uint32_t addr)
|
||||
static status_t _nor_erase_sector(rt_uint32_t addr)
|
||||
{
|
||||
rt_base_t level;
|
||||
status_t status;
|
||||
@@ -218,7 +218,7 @@ QSPI_RAM_CODE static status_t _nor_erase_sector(rt_uint32_t addr)
|
||||
* Uses PAGEPROGRAM_QUAD (0x32, 1-1-4 mode) for faster write speed,
|
||||
* consistent with the SDK example. src must be a 4-byte aligned SRAM buffer.
|
||||
*/
|
||||
QSPI_RAM_CODE static status_t _nor_page_program(rt_uint32_t addr, const rt_uint32_t *src)
|
||||
static status_t _nor_page_program(rt_uint32_t addr, const rt_uint32_t *src)
|
||||
{
|
||||
rt_base_t level;
|
||||
status_t status;
|
||||
@@ -407,7 +407,7 @@ void *rt_qspi_flash_mmap(rt_uint32_t offset, rt_size_t size)
|
||||
*
|
||||
* Data path: src -> s_write_buf (SRAM) -> Flash
|
||||
*/
|
||||
QSPI_RAM_CODE int rt_qspi_flash_write(rt_uint32_t offset, const rt_uint8_t *buf, rt_size_t size)
|
||||
int rt_qspi_flash_write(rt_uint32_t offset, const rt_uint8_t *buf, rt_size_t size)
|
||||
{
|
||||
rt_size_t written = 0;
|
||||
status_t status;
|
||||
@@ -473,7 +473,7 @@ QSPI_RAM_CODE int rt_qspi_flash_write(rt_uint32_t offset, const rt_uint8_t *buf,
|
||||
* offset and size must be sector-aligned (4KB).
|
||||
* Only the filesystem partition is allowed to be erased (_addr_safe guard).
|
||||
*/
|
||||
QSPI_RAM_CODE int rt_qspi_flash_erase(rt_uint32_t offset, rt_size_t size)
|
||||
int rt_qspi_flash_erase(rt_uint32_t offset, rt_size_t size)
|
||||
{
|
||||
rt_uint32_t addr;
|
||||
rt_uint32_t addr_end;
|
||||
|
||||
@@ -19,18 +19,18 @@
|
||||
* FLASH_SIZE = 0x4000 (Unit: KB) = 16MB
|
||||
* FlexSPI1_AMBA_BASE = 0x28000000
|
||||
* ============================================================ */
|
||||
#define QSPI_FLASH_BASE FlexSPI1_AMBA_BASE /* 0x28000000 */
|
||||
#define QSPI_FLASH_SIZE (0x4000U * 1024U) /* 16MB (0x4000 KB) */
|
||||
#define QSPI_SECTOR_SIZE 0x00001000U /* 4KB */
|
||||
#define QSPI_PAGE_SIZE 256U /* 256B */
|
||||
#define QSPI_FLASH_BASE FlexSPI1_AMBA_BASE /* 0x28000000 */
|
||||
#define QSPI_FLASH_SIZE (0x4000U * 1024U) /* 16MB (0x4000 KB) */
|
||||
#define QSPI_SECTOR_SIZE 0x00001000U /* 4KB */
|
||||
#define QSPI_PAGE_SIZE 256U /* 256B */
|
||||
|
||||
/*
|
||||
* Partition Plan (Total 16MB):
|
||||
* 0x00000000 ~ 0x007FFFFF: Application Code Area (8MB, limited by Scatter)
|
||||
* 0x00800000 ~ 0x00FFFFFF: File System Area (8MB, LittleFS)
|
||||
* 0x00000000 ~ 0x00EFFFFF: Application Code Area (15MB, limited by Scatter)
|
||||
* 0x00F00000 ~ 0x00FFFFFF: File System Area (1MB, LittleFS)
|
||||
*/
|
||||
#define QSPI_FS_OFFSET 0x00800000U
|
||||
#define QSPI_FS_SIZE 0x00800000U
|
||||
#define QSPI_FS_OFFSET 0x00F00000U
|
||||
#define QSPI_FS_SIZE 0x00100000U
|
||||
|
||||
/* ============================================================
|
||||
* RAM Code Section Attributes
|
||||
@@ -38,22 +38,22 @@
|
||||
* CPU can safely fetch instructions during FlexSPI IP command execution.
|
||||
* ============================================================ */
|
||||
#if defined(__CC_ARM) || defined(__ARMCC_VERSION)
|
||||
#define QSPI_RAM_CODE __attribute__((section("CodeQuickAccess"), noinline))
|
||||
#define QSPI_RAM_CODE __attribute__((section("CodeQuickAccess"), noinline))
|
||||
#elif defined(__GNUC__)
|
||||
#define QSPI_RAM_CODE __attribute__((section(".itcm.text"), noinline))
|
||||
#define QSPI_RAM_CODE __attribute__((section(".itcm.text"), noinline))
|
||||
#elif defined(__ICCARM__)
|
||||
#define QSPI_RAM_CODE __ramfunc
|
||||
#define QSPI_RAM_CODE __ramfunc
|
||||
#else
|
||||
#define QSPI_RAM_CODE
|
||||
#define QSPI_RAM_CODE
|
||||
#endif
|
||||
|
||||
/* ============================================================
|
||||
* External APIs
|
||||
* ============================================================ */
|
||||
int rt_qspi_flash_init(void);
|
||||
int rt_qspi_flash_read(uint32_t offset, uint8_t *buf, size_t size);
|
||||
int rt_qspi_flash_write(uint32_t offset, const uint8_t *buf, size_t size);
|
||||
int rt_qspi_flash_erase(uint32_t offset, size_t size);
|
||||
int rt_qspi_flash_init(void);
|
||||
int rt_qspi_flash_read(uint32_t offset, uint8_t *buf, size_t size);
|
||||
int rt_qspi_flash_write(uint32_t offset, const uint8_t *buf, size_t size);
|
||||
int rt_qspi_flash_erase(uint32_t offset, size_t size);
|
||||
void *rt_qspi_flash_mmap(uint32_t offset, size_t size);
|
||||
|
||||
#endif /* __DRV_FLEXSPI_NOR_FLASH_H__ */
|
||||
#endif /* __DRV_FLEXSPI_NOR_FLASH_H__ */
|
||||
@@ -17,20 +17,20 @@
|
||||
extern const struct fal_flash_dev imxrt1180_nor_flash;
|
||||
|
||||
/* flash device table */
|
||||
#define FAL_FLASH_DEV_TABLE \
|
||||
{ \
|
||||
&imxrt1180_nor_flash, \
|
||||
}
|
||||
#define FAL_FLASH_DEV_TABLE \
|
||||
{ \
|
||||
&imxrt1180_nor_flash, \
|
||||
}
|
||||
|
||||
/* ====================== Partition Configuration ========================== */
|
||||
#ifdef FAL_PART_HAS_TABLE_CFG
|
||||
|
||||
/* partition table */
|
||||
#define FAL_PART_TABLE \
|
||||
{ \
|
||||
{FAL_PART_MAGIC_WROD, "app", "norflash0", 0, 8*1024*1024, 0}, \
|
||||
{FAL_PART_MAGIC_WROD, "filesystem", "norflash0", 8*1024*1024, 8*1024*1024, 0}, \
|
||||
}
|
||||
#define FAL_PART_TABLE \
|
||||
{ \
|
||||
{ FAL_PART_MAGIC_WROD, "app", "norflash0", 0, 15 * 1024 * 1024, 0 }, \
|
||||
{ FAL_PART_MAGIC_WROD, "filesystem", "norflash0", 15 * 1024 * 1024, 1 * 1024 * 1024, 0 }, \
|
||||
}
|
||||
|
||||
#endif /* FAL_PART_HAS_TABLE_CFG */
|
||||
|
||||
|
||||
@@ -34,12 +34,12 @@ static int _fal_read(long offset, rt_uint8_t *buf, size_t size)
|
||||
return rt_qspi_flash_read((rt_uint32_t)offset, buf, size);
|
||||
}
|
||||
|
||||
QSPI_RAM_CODE static int _fal_write(long offset, const rt_uint8_t *buf, size_t size)
|
||||
static int _fal_write(long offset, const rt_uint8_t *buf, size_t size)
|
||||
{
|
||||
return rt_qspi_flash_write((rt_uint32_t)offset, buf, size);
|
||||
}
|
||||
|
||||
QSPI_RAM_CODE static int _fal_erase(long offset, size_t size)
|
||||
static int _fal_erase(long offset, size_t size)
|
||||
{
|
||||
return rt_qspi_flash_erase((rt_uint32_t)offset, size);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,129 @@
|
||||
/*
|
||||
* Copyright (c) 2024, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#ifndef CHERRYUSB_CONFIG_H
|
||||
#define CHERRYUSB_CONFIG_H
|
||||
|
||||
#include <rtthread.h>
|
||||
|
||||
/* USB common configuration */
|
||||
#define CONFIG_USB_PRINTF(...) rt_kprintf(__VA_ARGS__)
|
||||
|
||||
#if defined(BSP_CHERRYUSB_DEBUG_ENUM)
|
||||
#define CONFIG_USB_DBG_LEVEL USB_DBG_LOG
|
||||
#elif !defined(CONFIG_USB_DBG_LEVEL)
|
||||
#define CONFIG_USB_DBG_LEVEL USB_DBG_INFO
|
||||
#endif
|
||||
|
||||
#define CONFIG_USB_PRINTF_COLOR_ENABLE
|
||||
|
||||
/* USB DMA buffers are placed in NonCacheable sections on CM7. */
|
||||
#define CONFIG_USB_DCACHE_ENABLE
|
||||
|
||||
#ifdef CONFIG_USB_DCACHE_ENABLE
|
||||
#define CONFIG_USB_ALIGN_SIZE 32
|
||||
#else
|
||||
#define CONFIG_USB_ALIGN_SIZE 4
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#define USB_NOCACHE_RAM_SECTION __attribute__((section("NonCacheable,\"aw\",%nobits @")))
|
||||
#else
|
||||
#define USB_NOCACHE_RAM_SECTION __attribute__((section("NonCacheable")))
|
||||
#endif
|
||||
|
||||
/* USB device stack configuration */
|
||||
#ifndef CONFIG_USBDEV_REQUEST_BUFFER_LEN
|
||||
#define CONFIG_USBDEV_REQUEST_BUFFER_LEN 512
|
||||
#endif
|
||||
|
||||
#define CONFIG_USBDEV_ADVANCE_DESC
|
||||
|
||||
#ifndef CONFIG_USBDEV_EP0_PRIO
|
||||
#define CONFIG_USBDEV_EP0_PRIO 4
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_USBDEV_EP0_STACKSIZE
|
||||
#define CONFIG_USBDEV_EP0_STACKSIZE 2048
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_USBDEV_MSC_MAX_LUN
|
||||
#define CONFIG_USBDEV_MSC_MAX_LUN 1
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_USBDEV_MSC_MAX_BUFSIZE
|
||||
#define CONFIG_USBDEV_MSC_MAX_BUFSIZE 512
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_USBDEV_MAX_BUS
|
||||
#define CONFIG_USBDEV_MAX_BUS 1
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_USBDEV_EP_NUM
|
||||
#define CONFIG_USBDEV_EP_NUM 8
|
||||
#endif
|
||||
|
||||
/* USB host stack configuration */
|
||||
#define CONFIG_USBHOST_MAX_RHPORTS 1
|
||||
#define CONFIG_USBHOST_MAX_EXTHUBS 1
|
||||
#define CONFIG_USBHOST_MAX_EHPORTS 4
|
||||
#define CONFIG_USBHOST_MAX_INTERFACES 8
|
||||
#define CONFIG_USBHOST_MAX_INTF_ALTSETTINGS 8
|
||||
#define CONFIG_USBHOST_MAX_ENDPOINTS 4
|
||||
|
||||
#define CONFIG_USBHOST_MAX_CDC_ACM_CLASS 4
|
||||
#define CONFIG_USBHOST_MAX_HID_CLASS 4
|
||||
#define CONFIG_USBHOST_MAX_MSC_CLASS 2
|
||||
#define CONFIG_USBHOST_MAX_AUDIO_CLASS 1
|
||||
#define CONFIG_USBHOST_MAX_VIDEO_CLASS 1
|
||||
|
||||
#define CONFIG_USBHOST_DEV_NAMELEN 16
|
||||
|
||||
#ifndef CONFIG_USBHOST_PSC_PRIO
|
||||
#define CONFIG_USBHOST_PSC_PRIO 0
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_USBHOST_PSC_STACKSIZE
|
||||
#define CONFIG_USBHOST_PSC_STACKSIZE 2048
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_USBHOST_REQUEST_BUFFER_LEN
|
||||
#define CONFIG_USBHOST_REQUEST_BUFFER_LEN 512
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_USBHOST_CONTROL_TRANSFER_TIMEOUT
|
||||
#define CONFIG_USBHOST_CONTROL_TRANSFER_TIMEOUT 500
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_USBHOST_MSC_TIMEOUT
|
||||
#define CONFIG_USBHOST_MSC_TIMEOUT 5000
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_USBHOST_MAX_BUS
|
||||
#define CONFIG_USBHOST_MAX_BUS 1
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_USBHOST_PIPE_NUM
|
||||
#define CONFIG_USBHOST_PIPE_NUM 10
|
||||
#endif
|
||||
|
||||
/* EHCI port configuration */
|
||||
#define CONFIG_USB_EHCI_HCCR_OFFSET (0x100)
|
||||
#define CONFIG_USB_EHCI_FRAME_LIST_SIZE 1024
|
||||
#define CONFIG_USB_EHCI_QH_NUM CONFIG_USBHOST_PIPE_NUM
|
||||
#define CONFIG_USB_EHCI_QTD_NUM (CONFIG_USB_EHCI_QH_NUM * 3)
|
||||
#define CONFIG_USB_EHCI_ITD_NUM 4
|
||||
|
||||
#ifndef usb_phyaddr2ramaddr
|
||||
#define usb_phyaddr2ramaddr(addr) (addr)
|
||||
#endif
|
||||
|
||||
#ifndef usb_ramaddr2phyaddr
|
||||
#define usb_ramaddr2phyaddr(addr) (addr)
|
||||
#endif
|
||||
|
||||
#define CONFIG_USB_EHCI_NXP 1
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File renamed without changes.
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -61,18 +61,21 @@
|
||||
|
||||
/* end of rt_strnlen options */
|
||||
/* end of klibc options */
|
||||
#define RT_NAME_MAX 12
|
||||
#define RT_CPUS_NR 1
|
||||
#define RT_NAME_MAX 12
|
||||
#define RT_CPUS_NR 1
|
||||
#define RT_ALIGN_SIZE 8
|
||||
#define RT_THREAD_PRIORITY_32
|
||||
#define RT_THREAD_PRIORITY_MAX 32
|
||||
#define RT_TICK_PER_SECOND 100
|
||||
#define RT_TICK_PER_SECOND 1000
|
||||
#define RT_USING_OVERFLOW_CHECK
|
||||
#define RT_USING_HOOK
|
||||
#define RT_HOOK_USING_FUNC_PTR
|
||||
#define RT_USING_IDLE_HOOK
|
||||
#define RT_IDLE_HOOK_LIST_SIZE 4
|
||||
#define IDLE_THREAD_STACK_SIZE 4096
|
||||
#define RT_USING_TIMER_SOFT
|
||||
#define RT_TIMER_THREAD_PRIO 4
|
||||
#define RT_TIMER_THREAD_STACK_SIZE 2048
|
||||
|
||||
/* kservice options */
|
||||
|
||||
@@ -101,10 +104,10 @@
|
||||
/* end of Memory Management */
|
||||
#define RT_USING_DEVICE
|
||||
#define RT_USING_CONSOLE
|
||||
#define RT_CONSOLEBUF_SIZE 128
|
||||
#define RT_CONSOLEBUF_SIZE 128
|
||||
#define RT_CONSOLE_DEVICE_NAME "uart1"
|
||||
#define RT_USING_CONSOLE_OUTPUT_CTL
|
||||
#define RT_VER_NUM 0x50300
|
||||
#define RT_VER_NUM 0x50300
|
||||
#define RT_BACKTRACE_LEVEL_MAX_NR 32
|
||||
/* end of RT-Thread Kernel */
|
||||
#define RT_USING_HW_ATOMIC
|
||||
@@ -113,7 +116,6 @@
|
||||
#define RT_USING_CPU_FFS
|
||||
#define ARCH_ARM
|
||||
#define ARCH_ARM_CORTEX_M
|
||||
#define ARCH_ARM_CORTEX_FPU
|
||||
#define ARCH_ARM_CORTEX_SECURE
|
||||
#define ARCH_ARM_CORTEX_M33
|
||||
|
||||
@@ -122,12 +124,12 @@
|
||||
#define RT_USING_COMPONENTS_INIT
|
||||
#define RT_USING_USER_MAIN
|
||||
#define RT_MAIN_THREAD_STACK_SIZE 4096
|
||||
#define RT_MAIN_THREAD_PRIORITY 10
|
||||
#define RT_MAIN_THREAD_PRIORITY 10
|
||||
#define RT_USING_MSH
|
||||
#define RT_USING_FINSH
|
||||
#define FINSH_USING_MSH
|
||||
#define FINSH_THREAD_NAME "tshell"
|
||||
#define FINSH_THREAD_PRIORITY 20
|
||||
#define FINSH_THREAD_NAME "tshell"
|
||||
#define FINSH_THREAD_PRIORITY 20
|
||||
#define FINSH_THREAD_STACK_SIZE 4096
|
||||
#define FINSH_USING_HISTORY
|
||||
#define FINSH_HISTORY_LINES 5
|
||||
@@ -160,8 +162,8 @@
|
||||
|
||||
#define RT_LIBC_USING_LIGHT_TZ_DST
|
||||
#define RT_LIBC_TZ_DEFAULT_HOUR 8
|
||||
#define RT_LIBC_TZ_DEFAULT_MIN 0
|
||||
#define RT_LIBC_TZ_DEFAULT_SEC 0
|
||||
#define RT_LIBC_TZ_DEFAULT_MIN 0
|
||||
#define RT_LIBC_TZ_DEFAULT_SEC 0
|
||||
/* end of Timezone and Daylight Saving Time */
|
||||
/* end of ISO-ANSI C layer */
|
||||
|
||||
@@ -296,10 +298,6 @@
|
||||
|
||||
/* end of Kendryte SDK */
|
||||
|
||||
/* MM32 HAL & SDK Drivers */
|
||||
|
||||
/* end of MM32 HAL & SDK Drivers */
|
||||
|
||||
/* WCH HAL & SDK Drivers */
|
||||
|
||||
/* end of WCH HAL & SDK Drivers */
|
||||
@@ -333,10 +331,6 @@
|
||||
/* FT32 HAL & SDK Drivers */
|
||||
|
||||
/* end of FT32 HAL & SDK Drivers */
|
||||
|
||||
/* NOVOSNS Drivers */
|
||||
|
||||
/* end of NOVOSNS Drivers */
|
||||
/* end of HAL & SDK Drivers */
|
||||
|
||||
/* sensors drivers */
|
||||
@@ -437,6 +431,7 @@
|
||||
|
||||
/* Board extended module Drivers */
|
||||
|
||||
#define BSP_LINKER_SCRIPT_FLEXSPI_NOR
|
||||
/* end of Hardware Drivers Config */
|
||||
|
||||
#endif
|
||||
@@ -32,6 +32,36 @@ if os.getenv('RTT_EXEC_PATH'):
|
||||
BUILD = 'debug'
|
||||
# BUILD = 'release'
|
||||
|
||||
# Read linker script selection from rtconfig.h (set by Kconfig BSP_LINKER_SCRIPT_* choice).
|
||||
# Supported types: RAM, FLEXSPI_NOR, FLEXSPI_NOR_HYPERRAM
|
||||
# Default to RAM when no match is found.
|
||||
_LINKER_SCRIPT_TYPE = 'RAM'
|
||||
_rtconfig_h = os.path.join(os.path.dirname(__file__), 'rtconfig.h')
|
||||
if os.path.exists(_rtconfig_h):
|
||||
with open(_rtconfig_h, 'r') as _f:
|
||||
for _line in _f:
|
||||
_s = _line.strip()
|
||||
if _s.startswith('//'):
|
||||
continue
|
||||
# Check the most specific name first to avoid false matches.
|
||||
if _s.startswith('#define BSP_LINKER_SCRIPT_FLEXSPI_NOR_HYPERRAM'):
|
||||
_LINKER_SCRIPT_TYPE = 'FLEXSPI_NOR_HYPERRAM'
|
||||
break
|
||||
if _s.startswith('#define BSP_LINKER_SCRIPT_FLEXSPI_NOR'):
|
||||
_LINKER_SCRIPT_TYPE = 'FLEXSPI_NOR'
|
||||
break
|
||||
if _s.startswith('#define BSP_LINKER_SCRIPT_RAM'):
|
||||
_LINKER_SCRIPT_TYPE = 'RAM'
|
||||
break
|
||||
|
||||
# Base filename (without extension) for the selected linker script.
|
||||
_LINKER_SCRIPT_BASE = {
|
||||
'RAM': 'MIMXRT1189xxxxx_cm33_ram',
|
||||
'FLEXSPI_NOR': 'MIMXRT1189xxxxx_cm33_flexspi_nor',
|
||||
'FLEXSPI_NOR_HYPERRAM': 'MIMXRT1189xxxxx_cm33_flexspi_nor_hyperram',
|
||||
}[_LINKER_SCRIPT_TYPE]
|
||||
|
||||
|
||||
if PLATFORM == 'gcc':
|
||||
PREFIX = 'arm-none-eabi-'
|
||||
CC = PREFIX + 'gcc'
|
||||
@@ -46,10 +76,13 @@ if PLATFORM == 'gcc':
|
||||
STRIP = PREFIX + 'strip'
|
||||
|
||||
DEVICE = ' -mcpu=' + CPU + ' -mthumb -mfpu=fpv5-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections'
|
||||
|
||||
|
||||
CFLAGS = DEVICE + ' -Wall -D__FPU_PRESENT'
|
||||
AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -D__START=entry -D__STARTUP_CLEAR_BSS'
|
||||
LFLAGS = DEVICE + ' -specs=nano.specs -specs=nosys.specs -Wl,--gc-sections,-Map=rtthread.map,--print-memory-usage -T board/linker_scripts/link.lds'
|
||||
|
||||
LINKER_SCRIPT = 'board/linker_scripts/' + _LINKER_SCRIPT_BASE + '.ld'
|
||||
|
||||
LFLAGS = DEVICE + ' -specs=nano.specs -specs=nosys.specs -Wl,--gc-sections,-Map=rtthread.map,--print-memory-usage -T ' + LINKER_SCRIPT
|
||||
|
||||
CPATH = ''
|
||||
LPATH = ''
|
||||
@@ -60,17 +93,17 @@ if PLATFORM == 'gcc':
|
||||
if BUILD == 'debug':
|
||||
CFLAGS += ' -g'
|
||||
AFLAGS += ' -g'
|
||||
# CFLAGS += ' -O1'
|
||||
# CFLAGS += ' -O1'
|
||||
CFLAGS += ' -O0'
|
||||
else:
|
||||
CFLAGS += ' -O2 -Os'
|
||||
|
||||
POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n'
|
||||
|
||||
# module setting
|
||||
# module setting
|
||||
CXXFLAGS = ' -Woverloaded-virtual -fno-exceptions -fno-rtti '
|
||||
CXXFLAGS += CFLAGS
|
||||
|
||||
CXXFLAGS += CFLAGS
|
||||
|
||||
M_CFLAGS = CFLAGS + ' -mlong-calls -fPIC '
|
||||
M_CXXFLAGS = CXXFLAGS + ' -mlong-calls -fPIC'
|
||||
M_LFLAGS = DEVICE + CXXFLAGS + ' -Wl,--gc-sections,-z,max-page-size=0x4' +\
|
||||
@@ -88,9 +121,12 @@ elif PLATFORM == 'armcc':
|
||||
DEVICE = ' --cpu ' + CPU + '.fp.sp'
|
||||
CFLAGS = DEVICE + ' --apcs=interwork'
|
||||
AFLAGS = DEVICE
|
||||
LFLAGS = DEVICE + ' --libpath "' + EXEC_PATH + '\ARM\ARMCC\lib" --info sizes --info totals --info unused --info veneers --list rtthread.map --scatter "board\linker_scripts\link.scf"'
|
||||
|
||||
LFLAGS += ' --keep *.o(.rti_fn.*) --keep *.o(FSymTab) --keep *.o(VSymTab)'
|
||||
LINKER_SCRIPT = 'board/linker_scripts/' + _LINKER_SCRIPT_BASE + '.scf'
|
||||
|
||||
LFLAGS = DEVICE + ' --libpath "' + EXEC_PATH + '\ARM\ARMCC\lib" --info sizes --info totals --info unused --info veneers --list rtthread.map --scatter "' + LINKER_SCRIPT + '"'
|
||||
|
||||
LFLAGS += ' --keep *.o(.rti_fn.*) --keep *.o(FSymTab) --keep *.o(VSymTab)'
|
||||
|
||||
CFLAGS += ' --diag_suppress=66,1296,186,6314'
|
||||
CFLAGS += ' -I' + EXEC_PATH + '/ARM/RV31/INC'
|
||||
@@ -129,9 +165,13 @@ elif PLATFORM == 'armclang':
|
||||
AFLAGS = DEVICE + ' --apcs=interwork '
|
||||
AFLAGS += ' -x assembler-with-cpp'
|
||||
AFLAGS += ' -Wa,-mimplicit-it=thumb'
|
||||
|
||||
# armlink --scatter accepts the file with extension.
|
||||
LINKER_SCRIPT = 'board/linker_scripts/' + _LINKER_SCRIPT_BASE + '.scf'
|
||||
|
||||
LFLAGS = DEVICE + ' --info sizes --info totals --info unused --info veneers '
|
||||
LFLAGS += ' --list rt-thread.map '
|
||||
LFLAGS += r' --strict --scatter "board/linker_scripts/link" '
|
||||
LFLAGS += r' --strict --scatter "' + LINKER_SCRIPT + '" '
|
||||
CFLAGS += ' -I' + EXEC_PATH + '/ARM/ARMCLANG/include'
|
||||
LFLAGS += ' --libpath=' + EXEC_PATH + '/ARM/ARMCLANG/lib'
|
||||
|
||||
@@ -142,7 +182,7 @@ elif PLATFORM == 'armclang':
|
||||
AFLAGS += ' -g'
|
||||
else:
|
||||
CFLAGS += ' -O2'
|
||||
|
||||
|
||||
CXXFLAGS = CFLAGS
|
||||
CFLAGS += ' -std=c99'
|
||||
|
||||
@@ -179,7 +219,9 @@ elif PLATFORM == 'iccarm':
|
||||
else:
|
||||
CFLAGS += ' -Oh'
|
||||
|
||||
LFLAGS = ' --config "board/linker_scripts/link.icf"'
|
||||
LINKER_SCRIPT = 'board/linker_scripts/' + _LINKER_SCRIPT_BASE + '.icf'
|
||||
|
||||
LFLAGS = ' --config "' + LINKER_SCRIPT + '"'
|
||||
LFLAGS += ' --redirect _Printf=_PrintfTiny'
|
||||
|
||||
CXXFLAGS = CFLAGS
|
||||
@@ -187,9 +229,42 @@ elif PLATFORM == 'iccarm':
|
||||
EXEC_PATH = EXEC_PATH + '/arm/bin/'
|
||||
POST_ACTION = 'ielftool --bin $TARGET rtthread.bin'
|
||||
|
||||
# Map from linker script type to the matching Keil target name.
|
||||
_LINKER_SCRIPT_TO_KEIL_TARGET = {
|
||||
'RAM': 'rtthread_ram',
|
||||
'FLEXSPI_NOR': 'rtthread_flexspi_nor',
|
||||
'FLEXSPI_NOR_HYPERRAM': 'rtthread_flexspi_nor_hyperram',
|
||||
}
|
||||
|
||||
def update_keil_active_target(uvoptx_path='project.uvoptx'):
|
||||
"""Set <IsCurrentTarget> in project.uvoptx to match the selected linker script."""
|
||||
import xml.etree.ElementTree as etree
|
||||
|
||||
active = _LINKER_SCRIPT_TO_KEIL_TARGET.get(_LINKER_SCRIPT_TYPE, 'rtthread_ram')
|
||||
|
||||
if not os.path.exists(uvoptx_path):
|
||||
return
|
||||
|
||||
tree = etree.parse(uvoptx_path)
|
||||
root = tree.getroot()
|
||||
|
||||
for tgt in tree.findall('Target'):
|
||||
tname = tgt.find('TargetName')
|
||||
is_current = tgt.find('TargetOption/OPTFL/IsCurrentTarget')
|
||||
if tname is not None and is_current is not None:
|
||||
is_current.text = '1' if tname.text == active else '0'
|
||||
|
||||
out = open(uvoptx_path, 'w')
|
||||
out.write('<?xml version="1.0" encoding="UTF-8" standalone="no" ?>\n')
|
||||
out.write(etree.tostring(root, encoding='utf-8').decode())
|
||||
out.close()
|
||||
|
||||
print('Keil active target set to: ' + active)
|
||||
|
||||
def dist_handle(BSP_ROOT, dist_dir):
|
||||
import sys
|
||||
cwd_path = os.getcwd()
|
||||
# sys.path.append(os.path.join(os.path.dirname(BSP_ROOT), 'tools'))
|
||||
sys.path.append(os.path.join(os.path.dirname(os.path.dirname(BSP_ROOT)), 'tools'))
|
||||
from sdk_dist import dist_do_building
|
||||
dist_do_building(BSP_ROOT, dist_dir)
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -8,13 +8,8 @@ if GetDepend('BSP_USING_QSPIFLASH'):
|
||||
CPPPATH = [cwd]
|
||||
LINKFLAGS = ''
|
||||
|
||||
if rtconfig.PLATFORM in ['armcc', 'armclang']:
|
||||
LINKFLAGS += ' --keep=*(.boot_hdr.container)'
|
||||
# LINKFLAGS += ' --keep=*(.boot_hdr.xmcd_data)'
|
||||
LINKFLAGS += ' --keep=*(.boot_hdr.conf)'
|
||||
LINKFLAGS += ' --entry=Reset_Handler '
|
||||
if rtconfig.PLATFORM in ['armcc', 'armclang']:
|
||||
LINKFLAGS += ' --predefine="-DXIP_BOOT_HEADER_ENABLE=1"'
|
||||
LINKFLAGS += ' --predefine="-DXIP_EXTERNAL_FLASH=1"'
|
||||
|
||||
group = DefineGroup('xip', src, depend = [''], CPPPATH = CPPPATH, LINKFLAGS = LINKFLAGS)
|
||||
Return('group')
|
||||
@@ -12,9 +12,28 @@ Peripheral.hyperflash_dma:
|
||||
- CONFIG_BSP_USING_FLEXSPI=y
|
||||
- CONFIG_BSP_USING_FLEXSPI1=y
|
||||
- CONFIG_BSP_USING_OSPI_FLASH=y
|
||||
- CONFIG_BSP_USING_GPIO=y
|
||||
Peripheral.hyperflash:
|
||||
<<: *scons
|
||||
kconfig:
|
||||
- CONFIG_BSP_USING_FLEXSPI=y
|
||||
- CONFIG_BSP_USING_FLEXSPI1=y
|
||||
- CONFIG_BSP_USING_OSPI_FLASH=y
|
||||
- CONFIG_BSP_USING_OSPI_FLASH=y
|
||||
- CONFIG_BSP_USING_GPIO=y
|
||||
Peripheral.qspi_flash_FS:
|
||||
<<: *scons
|
||||
kconfig:
|
||||
- CONFIG_BSP_USING_QSPI_FLASH_FS=y
|
||||
Peripheral.usb_device:
|
||||
<<: *scons
|
||||
kconfig:
|
||||
- CONFIG_BSP_USING_USB=y
|
||||
Peripheral.netc:
|
||||
<<: *scons
|
||||
kconfig:
|
||||
- CONFIG_BSP_USING_ETH=y
|
||||
- CONFIG_BSP_USING_GPIO=y
|
||||
Peripheral.multicore:
|
||||
<<: *scons
|
||||
kconfig:
|
||||
- CONFIG_BSP_USE_MULTICORE=y
|
||||
@@ -126,7 +126,10 @@ CONFIG_RT_HOOK_USING_FUNC_PTR=y
|
||||
CONFIG_RT_USING_IDLE_HOOK=y
|
||||
CONFIG_RT_IDLE_HOOK_LIST_SIZE=4
|
||||
CONFIG_IDLE_THREAD_STACK_SIZE=4096
|
||||
# CONFIG_RT_USING_TIMER_SOFT is not set
|
||||
CONFIG_RT_USING_TIMER_SOFT=y
|
||||
CONFIG_RT_TIMER_THREAD_PRIO=4
|
||||
CONFIG_RT_TIMER_THREAD_STACK_SIZE=2048
|
||||
# CONFIG_RT_USING_TIMER_ALL_SOFT is not set
|
||||
# CONFIG_RT_USING_CPU_USAGE_TRACER is not set
|
||||
|
||||
#
|
||||
@@ -177,7 +180,7 @@ CONFIG_RT_USING_DEVICE=y
|
||||
# CONFIG_RT_USING_THREADSAFE_PRINTF is not set
|
||||
CONFIG_RT_USING_CONSOLE=y
|
||||
CONFIG_RT_CONSOLEBUF_SIZE=128
|
||||
CONFIG_RT_CONSOLE_DEVICE_NAME="uart1"
|
||||
CONFIG_RT_CONSOLE_DEVICE_NAME="uart12"
|
||||
CONFIG_RT_USING_CONSOLE_OUTPUT_CTL=y
|
||||
CONFIG_RT_VER_NUM=0x50300
|
||||
# CONFIG_RT_USING_STDC_ATOMIC is not set
|
||||
@@ -236,7 +239,9 @@ CONFIG_FINSH_USING_OPTION_COMPLETION=y
|
||||
# CONFIG_RT_USING_DEV_BUS is not set
|
||||
CONFIG_RT_USING_DEVICE_IPC=y
|
||||
CONFIG_RT_UNAMED_PIPE_NUMBER=64
|
||||
# CONFIG_RT_USING_SYSTEM_WORKQUEUE is not set
|
||||
CONFIG_RT_USING_SYSTEM_WORKQUEUE=y
|
||||
CONFIG_RT_SYSTEM_WORKQUEUE_STACKSIZE=2048
|
||||
CONFIG_RT_SYSTEM_WORKQUEUE_PRIORITY=23
|
||||
CONFIG_RT_USING_SERIAL=y
|
||||
CONFIG_RT_USING_SERIAL_V1=y
|
||||
# CONFIG_RT_USING_SERIAL_V2 is not set
|
||||
@@ -587,8 +592,6 @@ CONFIG_RT_LIBC_TZ_DEFAULT_SEC=0
|
||||
# tools packages
|
||||
#
|
||||
# CONFIG_PKG_USING_VECTOR is not set
|
||||
# CONFIG_PKG_USING_SORCH is not set
|
||||
# CONFIG_PKG_USING_DICT is not set
|
||||
# CONFIG_PKG_USING_CMBACKTRACE is not set
|
||||
# CONFIG_PKG_USING_MCOREDUMP is not set
|
||||
# CONFIG_PKG_USING_EASYFLASH is not set
|
||||
@@ -736,8 +739,6 @@ CONFIG_RT_LIBC_TZ_DEFAULT_SEC=0
|
||||
# CONFIG_PKG_USING_HEARTBEAT is not set
|
||||
# CONFIG_PKG_USING_MICRO_ROS_RTTHREAD_PACKAGE is not set
|
||||
# CONFIG_PKG_USING_CHERRYECAT is not set
|
||||
# CONFIG_PKG_USING_EVENT_LOOP is not set
|
||||
# CONFIG_PKG_USING_THREAD_MANAGER is not set
|
||||
# end of system packages
|
||||
|
||||
#
|
||||
@@ -821,21 +822,7 @@ CONFIG_RT_LIBC_TZ_DEFAULT_SEC=0
|
||||
# CONFIG_PKG_USING_NRFX is not set
|
||||
# CONFIG_PKG_USING_RASPBERRYPI_PICO_RP2350_SDK is not set
|
||||
# CONFIG_PKG_USING_RASPBERRYPI_PICO_SDK is not set
|
||||
|
||||
#
|
||||
# MM32 HAL & SDK Drivers
|
||||
#
|
||||
# CONFIG_PKG_USING_MM32F103XX_CMSIS is not set
|
||||
# CONFIG_PKG_USING_MM32F3270X_CMSIS is not set
|
||||
# CONFIG_PKG_USING_MM32F5260X_CMSIS is not set
|
||||
# CONFIG_PKG_USING_MM32L0XX_CMSIS is not set
|
||||
# CONFIG_PKG_USING_MM32L3XX_CMSIS is not set
|
||||
# CONFIG_PKG_USING_MM32F103XX_HAL_DRIVER is not set
|
||||
# CONFIG_PKG_USING_MM32F3270X_HAL_DRIVER is not set
|
||||
# CONFIG_PKG_USING_MM32F5260X_HAL_DRIVER is not set
|
||||
# CONFIG_PKG_USING_MM32L0XX_HAL_DRIVER is not set
|
||||
# CONFIG_PKG_USING_MM32L3XX_HAL_DRIVER is not set
|
||||
# end of MM32 HAL & SDK Drivers
|
||||
# CONFIG_PKG_USING_MM32 is not set
|
||||
|
||||
#
|
||||
# WCH HAL & SDK Drivers
|
||||
@@ -900,7 +887,9 @@ CONFIG_PKG_NXP_IMXRT_DRIVER_VER="latest"
|
||||
#
|
||||
# NUVOTON Drivers
|
||||
#
|
||||
# CONFIG_PKG_USING_NUVOTON_CMSIS_DRIVER is not set
|
||||
# CONFIG_PKG_USING_NUVOTON_SERIES_DRIVER is not set
|
||||
# CONFIG_PKG_USING_NUVOTON_ARM926_LIB is not set
|
||||
# end of NUVOTON Drivers
|
||||
|
||||
#
|
||||
@@ -926,12 +915,6 @@ CONFIG_PKG_NXP_IMXRT_DRIVER_VER="latest"
|
||||
# CONFIG_PKG_USING_FT32F4_STD_DRIVER is not set
|
||||
# CONFIG_PKG_USING_FT32F4_CMSIS_DRIVER is not set
|
||||
# end of FT32 HAL & SDK Drivers
|
||||
|
||||
#
|
||||
# NOVOSNS Drivers
|
||||
#
|
||||
# CONFIG_PKG_USING_NOVOSNS_SERIES_DRIVER is not set
|
||||
# end of NOVOSNS Drivers
|
||||
# end of HAL & SDK Drivers
|
||||
|
||||
#
|
||||
@@ -1112,7 +1095,6 @@ CONFIG_PKG_NXP_IMXRT_DRIVER_VER="latest"
|
||||
# CONFIG_PKG_USING_ISOTP_C is not set
|
||||
# CONFIG_PKG_USING_IKUNLED is not set
|
||||
# CONFIG_PKG_USING_INS5T8025 is not set
|
||||
# CONFIG_PKG_USING_IRUART is not set
|
||||
# CONFIG_PKG_USING_ST7305 is not set
|
||||
# CONFIG_PKG_USING_TM1668 is not set
|
||||
# CONFIG_PKG_USING_SPI_TOOLS is not set
|
||||
@@ -1468,31 +1450,44 @@ CONFIG_SOC_MIMXRT1189CVM8C_CM7=y
|
||||
# On-chip Peripheral Drivers
|
||||
#
|
||||
# CONFIG_BSP_USING_DMA is not set
|
||||
CONFIG_BSP_USING_GPIO=y
|
||||
# CONFIG_BSP_USING_GPIO is not set
|
||||
# CONFIG_BSP_USING_RTC is not set
|
||||
# CONFIG_BSP_USING_USB is not set
|
||||
# CONFIG_BSP_USING_SDIO is not set
|
||||
CONFIG_BSP_USING_LPUART=y
|
||||
CONFIG_BSP_USING_LPUART1=y
|
||||
# CONFIG_BSP_LPUART1_RX_USING_DMA is not set
|
||||
# CONFIG_BSP_LPUART1_TX_USING_DMA is not set
|
||||
# CONFIG_BSP_USING_LPUART1 is not set
|
||||
# CONFIG_BSP_USING_LPUART2 is not set
|
||||
# CONFIG_BSP_USING_LPUART3 is not set
|
||||
# CONFIG_BSP_USING_I2C is not set
|
||||
# CONFIG_BSP_USING_LPUART4 is not set
|
||||
# CONFIG_BSP_USING_LPUART5 is not set
|
||||
# CONFIG_BSP_USING_LPUART6 is not set
|
||||
# CONFIG_BSP_USING_LPUART7 is not set
|
||||
# CONFIG_BSP_USING_LPUART8 is not set
|
||||
# CONFIG_BSP_USING_LPUART9 is not set
|
||||
# CONFIG_BSP_USING_LPUART10 is not set
|
||||
# CONFIG_BSP_USING_LPUART11 is not set
|
||||
CONFIG_BSP_USING_LPUART12=y
|
||||
# CONFIG_BSP_LPUART12_RX_USING_DMA is not set
|
||||
# CONFIG_BSP_LPUART12_TX_USING_DMA is not set
|
||||
# CONFIG_BSP_USING_CAN is not set
|
||||
# CONFIG_BSP_USING_FLEXSPI is not set
|
||||
# CONFIG_BSP_USING_CLOCK_TIMER is not set
|
||||
# end of On-chip Peripheral Drivers
|
||||
|
||||
#
|
||||
# Onboard Peripheral Drivers
|
||||
#
|
||||
# CONFIG_BSP_USING_SDRAM is not set
|
||||
# CONFIG_BSP_USE_HYPERRAM is not set
|
||||
# CONFIG_BSP_USE_MULTICORE is not set
|
||||
# CONFIG_BSP_USING_ETHERCAT is not set
|
||||
# CONFIG_BSP_USING_ETH is not set
|
||||
# CONFIG_BSP_USING_FS is not set
|
||||
# CONFIG_BSP_USING_VGLITE is not set
|
||||
# end of Onboard Peripheral Drivers
|
||||
|
||||
#
|
||||
# Board extended module Drivers
|
||||
#
|
||||
CONFIG_BSP_LINKER_SCRIPT_RAM=y
|
||||
# CONFIG_BSP_LINKER_SCRIPT_HYPERRAM is not set
|
||||
# CONFIG_BSP_LINKER_SCRIPT_FLEXSPI_NOR is not set
|
||||
# CONFIG_BSP_LINKER_SCRIPT_FLEXSPI_NOR_HYPERRAM is not set
|
||||
# end of Hardware Drivers Config
|
||||
@@ -11,7 +11,7 @@ MaxNumAPs = 0
|
||||
LowPowerHandlingMode = 0
|
||||
OverrideMemMap = 0
|
||||
AllowSimulation = 1
|
||||
ScriptFile=""
|
||||
ScriptFile="evkmimxrt1180_cm7.jlinkscript"
|
||||
[FLASH]
|
||||
RMWThreshold = 0x400
|
||||
Loaders=""
|
||||
|
||||
@@ -3,7 +3,11 @@ from building import *
|
||||
import os
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
src = Glob('*.c')
|
||||
|
||||
src = Split("""
|
||||
main.c
|
||||
""")
|
||||
|
||||
CPPPATH = [cwd]
|
||||
|
||||
# add for startup script
|
||||
@@ -12,6 +16,22 @@ if rtconfig.PLATFORM in ['gcc']:
|
||||
else:
|
||||
CPPDEFINES = []
|
||||
|
||||
if GetDepend(['BSP_USE_MULTICORE']):
|
||||
src += Split("""
|
||||
multicore_thread.c
|
||||
""")
|
||||
|
||||
if GetDepend(['BSP_USING_ETHERCAT']):
|
||||
src += Split("""
|
||||
ecat_thread.c
|
||||
""")
|
||||
|
||||
if GetDepend(['BSP_USING_FS']):
|
||||
src += Split("""
|
||||
mnt.c
|
||||
""")
|
||||
|
||||
# Create application group
|
||||
group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES=CPPDEFINES)
|
||||
|
||||
Return('group')
|
||||
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright 2021-2025 NXP
|
||||
* All rights reserved.
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2026-06-02 lucas Cao EtherCAT thread
|
||||
*/
|
||||
|
||||
#include <rtthread.h>
|
||||
#include <rtdevice.h>
|
||||
|
||||
extern void ecat_main(void);
|
||||
|
||||
/* EtherCAT thread stack size */
|
||||
#define ECAT_THREAD_STACK_SIZE 4096
|
||||
/* EtherCAT thread priority */
|
||||
#define ECAT_THREAD_PRIORITY 10
|
||||
/* EtherCAT thread time slice */
|
||||
#define ECAT_THREAD_TIMESLICE 20
|
||||
|
||||
static void ecat_thread_entry(void *parameter)
|
||||
{
|
||||
rt_kprintf("EtherCAT thread started\r\n");
|
||||
ecat_main();
|
||||
}
|
||||
|
||||
int ecat_thread_init(void)
|
||||
{
|
||||
rt_thread_t ecat_thread;
|
||||
|
||||
/* Create EtherCAT thread */
|
||||
ecat_thread = rt_thread_create("ecat",
|
||||
ecat_thread_entry,
|
||||
RT_NULL,
|
||||
ECAT_THREAD_STACK_SIZE,
|
||||
ECAT_THREAD_PRIORITY,
|
||||
ECAT_THREAD_TIMESLICE);
|
||||
|
||||
if (ecat_thread != RT_NULL)
|
||||
{
|
||||
rt_thread_startup(ecat_thread);
|
||||
rt_kprintf("EtherCAT thread created successfully\r\n");
|
||||
return RT_EOK;
|
||||
}
|
||||
else
|
||||
{
|
||||
rt_kprintf("EtherCAT thread creation failed\r\n");
|
||||
return -RT_ERROR;
|
||||
}
|
||||
}
|
||||
INIT_APP_EXPORT(ecat_thread_init);
|
||||
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
* Copyright (c) 2019-2024, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2026-06-02 CoreBoxer add LittleFS on QSPI NOR Flash (IMXRT1180-EVK)
|
||||
*/
|
||||
|
||||
#include <rtthread.h>
|
||||
|
||||
/* ====================================================================
|
||||
* QSPI NOR Flash LittleFS (controlled by BSP_USING_QSPI_FLASH_FS)
|
||||
*
|
||||
* Dependencies:
|
||||
* - drv_flash.c (Flash read/write/erase driver via ROM API)
|
||||
* - FAL framework (partition management)
|
||||
* - LittleFS component (RT-Thread package)
|
||||
*
|
||||
* FAL partition configuration (fal_cfg.h):
|
||||
* "filesystem" partition → filesystem area of norflash0
|
||||
*
|
||||
* Mount procedure:
|
||||
* 1. Find FAL partition to confirm correct configuration
|
||||
* 2. Create MTD NOR block device
|
||||
* 3. Try direct mount (for already formatted filesystem)
|
||||
* 4. If failed, perform mkfs then remount (first use or format scenario)
|
||||
* ==================================================================== */
|
||||
#ifdef BSP_USING_QSPI_FLASH_FS
|
||||
#include <dfs_fs.h>
|
||||
#include <fal.h>
|
||||
|
||||
#define FS_PARTITION_NAME "filesystem"
|
||||
#define FS_TYPE_NAME "lfs"
|
||||
#define FS_MOUNT_POINT "/"
|
||||
|
||||
static int _qspi_flash_fs_mount(void)
|
||||
{
|
||||
struct fal_mtd_nor_device *mtd_dev;
|
||||
int ret;
|
||||
|
||||
/* Find FAL partition to confirm configuration is correct */
|
||||
if (fal_partition_find(FS_PARTITION_NAME) == RT_NULL)
|
||||
{
|
||||
rt_kprintf("[qspi_fs] partition '%s' not found, check fal_cfg.h\n",
|
||||
FS_PARTITION_NAME);
|
||||
return -RT_ERROR;
|
||||
}
|
||||
|
||||
/* Create MTD NOR block device for filesystem partition */
|
||||
mtd_dev = (struct fal_mtd_nor_device *)fal_mtd_nor_device_create(FS_PARTITION_NAME);
|
||||
if (mtd_dev == RT_NULL)
|
||||
{
|
||||
rt_kprintf("[qspi_fs] failed to create MTD NOR device for '%s'\n",
|
||||
FS_PARTITION_NAME);
|
||||
return -RT_ERROR;
|
||||
}
|
||||
|
||||
/* Try direct mount (for already formatted flash) */
|
||||
ret = dfs_mount(FS_PARTITION_NAME, FS_MOUNT_POINT, FS_TYPE_NAME, 0, 0);
|
||||
if (ret == 0)
|
||||
{
|
||||
rt_kprintf("[qspi_fs] '%s' mounted at '%s'\n",
|
||||
FS_PARTITION_NAME, FS_MOUNT_POINT);
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
/* Mount failed, indicating flash is not formatted (first use scenario), perform mkfs */
|
||||
rt_kprintf("[qspi_fs] mount failed (ret=%d), formatting '%s'...\n",
|
||||
ret, FS_PARTITION_NAME);
|
||||
|
||||
ret = dfs_mkfs(FS_TYPE_NAME, FS_PARTITION_NAME);
|
||||
if (ret != 0)
|
||||
{
|
||||
rt_kprintf("[qspi_fs] mkfs failed (ret=%d)\n", ret);
|
||||
return -RT_ERROR;
|
||||
}
|
||||
|
||||
/* Remount after successful mkfs */
|
||||
ret = dfs_mount(FS_PARTITION_NAME, FS_MOUNT_POINT, FS_TYPE_NAME, 0, 0);
|
||||
if (ret != 0)
|
||||
{
|
||||
rt_kprintf("[qspi_fs] mount failed after mkfs (ret=%d)\n", ret);
|
||||
return -RT_ERROR;
|
||||
}
|
||||
|
||||
rt_kprintf("[qspi_fs] '%s' formatted and mounted at '%s'\n",
|
||||
FS_PARTITION_NAME, FS_MOUNT_POINT);
|
||||
return RT_EOK;
|
||||
}
|
||||
INIT_APP_EXPORT(_qspi_flash_fs_mount);
|
||||
/*
|
||||
* FAL initialization registered as INIT_COMPONENT_EXPORT:
|
||||
* after Flash driver (INIT_DEVICE_EXPORT)
|
||||
* before filesystem mount (INIT_APP_EXPORT)
|
||||
*/
|
||||
INIT_COMPONENT_EXPORT(fal_init);
|
||||
|
||||
#endif /* BSP_USING_QSPI_FLASH_FS */
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -412,8 +412,8 @@ void BOARD_BootClockRUN(void)
|
||||
#endif
|
||||
|
||||
#if (__CORTEX_M == 7)
|
||||
DCDC_SetVoltage(kDCDC_CORE0, kDCDC_1P0Target1P1V);
|
||||
DCDC_SetVoltage(kDCDC_CORE1, kDCDC_1P0Target1P1V);
|
||||
DCDC_SetVoltage(kDCDC_CORE0, kDCDC_1P0Target1P125V);
|
||||
DCDC_SetVoltage(kDCDC_CORE1, kDCDC_1P0Target1P125V);
|
||||
/* FBB need to be enabled in OverDrive(OD) mode */
|
||||
PMU_EnableFBB(ANADIG_PMU, true);
|
||||
#endif
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -12,6 +12,8 @@
|
||||
#ifndef _PIN_MUX_H_
|
||||
#define _PIN_MUX_H_
|
||||
|
||||
#include <rtthread.h>
|
||||
|
||||
/*!
|
||||
* @addtogroup pin_mux
|
||||
* @{
|
||||
@@ -37,6 +39,112 @@ void BOARD_InitBootPins(void);
|
||||
*/
|
||||
void BOARD_InitPins(void); /* Function assigned for the Cortex-M33 */
|
||||
|
||||
#ifdef BSP_USING_ETH
|
||||
/* GPIO_AD_25 (coord M15), ENET0_RST_B */
|
||||
/* Routed pin properties */
|
||||
#define BOARD_INITPHYACCESSPINS_ENET0_RST_B_PERIPHERAL RGPIO4 /*!< Peripheral name */
|
||||
#define BOARD_INITPHYACCESSPINS_ENET0_RST_B_SIGNAL gpio_io /*!< Signal name */
|
||||
#define BOARD_INITPHYACCESSPINS_ENET0_RST_B_CHANNEL 25U /*!< Signal channel */
|
||||
|
||||
/* Symbols to be used with GPIO driver */
|
||||
#define BOARD_INITPHYACCESSPINS_ENET0_RST_B_GPIO RGPIO4 /*!< GPIO peripheral base pointer */
|
||||
#define BOARD_INITPHYACCESSPINS_ENET0_RST_B_GPIO_PIN 25U /*!< GPIO pin number */
|
||||
#define BOARD_INITPHYACCESSPINS_ENET0_RST_B_GPIO_PIN_MASK (1U << 25U) /*!< GPIO pin mask */
|
||||
|
||||
/* GPIO_B1_13 (coord B11), ENET1_RST_B */
|
||||
/* Routed pin properties */
|
||||
#define BOARD_INITPHYACCESSPINS_ENET1_RST_B_PERIPHERAL RGPIO6 /*!< Peripheral name */
|
||||
#define BOARD_INITPHYACCESSPINS_ENET1_RST_B_SIGNAL gpio_io /*!< Signal name */
|
||||
#define BOARD_INITPHYACCESSPINS_ENET1_RST_B_CHANNEL 13U /*!< Signal channel */
|
||||
|
||||
/* Symbols to be used with GPIO driver */
|
||||
#define BOARD_INITPHYACCESSPINS_ENET1_RST_B_GPIO RGPIO6 /*!< GPIO peripheral base pointer */
|
||||
#define BOARD_INITPHYACCESSPINS_ENET1_RST_B_GPIO_PIN 13U /*!< GPIO pin number */
|
||||
#define BOARD_INITPHYACCESSPINS_ENET1_RST_B_GPIO_PIN_MASK (1U << 13U) /*!< GPIO pin mask */
|
||||
|
||||
/* GPIO_AD_28 (coord L16), ENET2_RST_B */
|
||||
/* Routed pin properties */
|
||||
#define BOARD_INITPHYACCESSPINS_ENET2_RST_B_PERIPHERAL RGPIO4 /*!< Peripheral name */
|
||||
#define BOARD_INITPHYACCESSPINS_ENET2_RST_B_SIGNAL gpio_io /*!< Signal name */
|
||||
#define BOARD_INITPHYACCESSPINS_ENET2_RST_B_CHANNEL 28U /*!< Signal channel */
|
||||
|
||||
/* Symbols to be used with GPIO driver */
|
||||
#define BOARD_INITPHYACCESSPINS_ENET2_RST_B_GPIO RGPIO4 /*!< GPIO peripheral base pointer */
|
||||
#define BOARD_INITPHYACCESSPINS_ENET2_RST_B_GPIO_PIN 28U /*!< GPIO pin number */
|
||||
#define BOARD_INITPHYACCESSPINS_ENET2_RST_B_GPIO_PIN_MASK (1U << 28U) /*!< GPIO pin mask */
|
||||
|
||||
/* GPIO_B2_01 (coord E10), ENET3_RST_B */
|
||||
/* Routed pin properties */
|
||||
#define BOARD_INITPHYACCESSPINS_ENET3_RST_B_PERIPHERAL RGPIO6 /*!< Peripheral name */
|
||||
#define BOARD_INITPHYACCESSPINS_ENET3_RST_B_SIGNAL gpio_io /*!< Signal name */
|
||||
#define BOARD_INITPHYACCESSPINS_ENET3_RST_B_CHANNEL 15U /*!< Signal channel */
|
||||
|
||||
/* Symbols to be used with GPIO driver */
|
||||
#define BOARD_INITPHYACCESSPINS_ENET3_RST_B_GPIO RGPIO6 /*!< GPIO peripheral base pointer */
|
||||
#define BOARD_INITPHYACCESSPINS_ENET3_RST_B_GPIO_PIN 15U /*!< GPIO pin number */
|
||||
#define BOARD_INITPHYACCESSPINS_ENET3_RST_B_GPIO_PIN_MASK (1U << 15U) /*!< GPIO pin mask */
|
||||
|
||||
/* GPIO_AD_13 (coord N15), ENET4_RST_B */
|
||||
/* Routed pin properties */
|
||||
#define BOARD_INITPHYACCESSPINS_ENET4_RST_B_PERIPHERAL RGPIO4 /*!< Peripheral name */
|
||||
#define BOARD_INITPHYACCESSPINS_ENET4_RST_B_SIGNAL gpio_io /*!< Signal name */
|
||||
#define BOARD_INITPHYACCESSPINS_ENET4_RST_B_CHANNEL 13U /*!< Signal channel */
|
||||
|
||||
/* Symbols to be used with GPIO driver */
|
||||
#define BOARD_INITPHYACCESSPINS_ENET4_RST_B_GPIO RGPIO4 /*!< GPIO peripheral base pointer */
|
||||
#define BOARD_INITPHYACCESSPINS_ENET4_RST_B_GPIO_PIN 13U /*!< GPIO pin number */
|
||||
#define BOARD_INITPHYACCESSPINS_ENET4_RST_B_GPIO_PIN_MASK (1U << 13U) /*!< GPIO pin mask */
|
||||
|
||||
/* GPIO_AD_12 (coord P17), ENET4_INT_B */
|
||||
/* Routed pin properties */
|
||||
#define BOARD_INITPHYACCESSPINS_ENET4_INT_B_PERIPHERAL RGPIO4 /*!< Peripheral name */
|
||||
#define BOARD_INITPHYACCESSPINS_ENET4_INT_B_SIGNAL gpio_io /*!< Signal name */
|
||||
#define BOARD_INITPHYACCESSPINS_ENET4_INT_B_CHANNEL 12U /*!< Signal channel */
|
||||
|
||||
/* Symbols to be used with GPIO driver */
|
||||
#define BOARD_INITPHYACCESSPINS_ENET4_INT_B_GPIO RGPIO4 /*!< GPIO peripheral base pointer */
|
||||
#define BOARD_INITPHYACCESSPINS_ENET4_INT_B_GPIO_PIN 12U /*!< GPIO pin number */
|
||||
#define BOARD_INITPHYACCESSPINS_ENET4_INT_B_GPIO_PIN_MASK (1U << 12U) /*!< GPIO pin mask */
|
||||
|
||||
/*!
|
||||
* @brief Configures pin routing and optionally pin electrical features.
|
||||
*
|
||||
*/
|
||||
void BOARD_InitPhyAccessPins(void); /* Function assigned for the Cortex-M33 */
|
||||
|
||||
/*!
|
||||
* @brief Configures pin routing and optionally pin electrical features.
|
||||
*
|
||||
*/
|
||||
void BOARD_InitEpPins(void); /* Function assigned for the Cortex-M33 */
|
||||
|
||||
/*!
|
||||
* @brief Configures pin routing and optionally pin electrical features.
|
||||
*
|
||||
*/
|
||||
void BOARD_InitSwtPort0Pins(void); /* Function assigned for the Cortex-M33 */
|
||||
|
||||
/*!
|
||||
* @brief Configures pin routing and optionally pin electrical features.
|
||||
*
|
||||
*/
|
||||
void BOARD_InitSwtPort1Pins(void); /* Function assigned for the Cortex-M33 */
|
||||
|
||||
/*!
|
||||
* @brief Configures pin routing and optionally pin electrical features.
|
||||
*
|
||||
*/
|
||||
void BOARD_InitSwtPort2Pins(void); /* Function assigned for the Cortex-M33 */
|
||||
|
||||
/*!
|
||||
* @brief Configures pin routing and optionally pin electrical features.
|
||||
*
|
||||
*/
|
||||
void BOARD_InitSwtPort3Pins(void); /* Function assigned for the Cortex-M33 */
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
Import('rtconfig')
|
||||
Import('RTT_ROOT')
|
||||
|
||||
from building import *
|
||||
import os
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
|
||||
@@ -17,6 +21,9 @@ else:
|
||||
MCUX_Config/pin_mux.c
|
||||
""")
|
||||
|
||||
if GetDepend(['BSP_USING_QSPI_FLASH_FS']):
|
||||
src += ['ports/drv_flexspi_nor_flash.c', 'ports/fal_flash_port.c']
|
||||
|
||||
if GetDepend(['BSP_USING_OSPI_FLASH']):
|
||||
src += ['ports/flexspi_octal_flash_ops.c']
|
||||
|
||||
@@ -25,7 +32,8 @@ if GetDepend(['BSP_USING_OSPI_FLASH']):
|
||||
else:
|
||||
CPPPATH = [cwd,cwd + '/MCUX_Config',cwd + '/ports']
|
||||
|
||||
CPPDEFINES = ['CPU_MIMXRT1189CVM8C_cm7', 'MIMXRT1189_cm7_SERIES', 'FSL_SDK_ENABLE_DRIVER_CACHE_CONTROL=1', 'ARM_MATH_CM7']
|
||||
CPPDEFINES = ['CPU_MIMXRT1189CVM8C_cm7', 'MIMXRT1189_cm7_SERIES', 'ARM_MATH_CM7']
|
||||
LINKFLAGS = ''
|
||||
|
||||
if rtconfig.PLATFORM in ['gcc']:
|
||||
CPPDEFINES += ['__STARTUP_INITIALIZE_RAMFUNCTION']
|
||||
@@ -37,6 +45,47 @@ if rtconfig.PLATFORM in ['armcc', 'armclang']:
|
||||
if rtconfig.PLATFORM in ['iccarm']:
|
||||
CPPDEFINES += ['NDEBUG']
|
||||
|
||||
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES=CPPDEFINES)
|
||||
if GetDepend(['BSP_USE_HYPERRAM']):
|
||||
CPPDEFINES += ['USE_HYPERRAM=1']
|
||||
|
||||
if GetDepend(['BSP_USE_MULTICORE']):
|
||||
CPPDEFINES += ['__USE_SHMEM', 'MULTICORE_APP=1']
|
||||
CPPDEFINES += ['XIP_EXTERNAL_FLASH=1']
|
||||
if rtconfig.PLATFORM in ['gcc']:
|
||||
LINKFLAGS += ' -Wl,-defsym,__use_shmem__=1'
|
||||
LINKFLAGS += ' -Wl,-defsym,__multicore__=1'
|
||||
if rtconfig.PLATFORM in ['armcc', 'armclang']:
|
||||
LINKFLAGS += ' --predefine="-D__use_shmem__=1"'
|
||||
LINKFLAGS += ' --predefine="-D__multicore__=1"'
|
||||
if rtconfig.PLATFORM in ['iccarm']:
|
||||
LINKFLAGS += ' __use_shmem__=1'
|
||||
LINKFLAGS += ' __multicore__=1'
|
||||
|
||||
if GetDepend(['BSP_USING_ETH']):
|
||||
CPPDEFINES += ['SDK_NETC_USED=1', 'FSL_ETH_ENABLE_CACHE_CONTROL=1']
|
||||
|
||||
if GetDepend(['RT_USING_CHERRYUSB']):
|
||||
cherryusb_path = os.path.join(RTT_ROOT, 'components', 'drivers', 'usb', 'cherryusb')
|
||||
src += ['cherryusb_port.c']
|
||||
if GetDepend(['RT_CHERRYUSB_DEVICE_TEMPLATE_CDC_ACM']):
|
||||
src += ['cherryusb_cdc_acm.c']
|
||||
if GetDepend(['BSP_CHERRYUSB_HOST_MOUSE_DEMO']):
|
||||
src += ['usbh_mouse_demo.c']
|
||||
CPPPATH += [
|
||||
cherryusb_path,
|
||||
os.path.join(cherryusb_path, 'common'),
|
||||
os.path.join(cherryusb_path, 'core'),
|
||||
os.path.join(cherryusb_path, 'class', 'hub'),
|
||||
os.path.join(cherryusb_path, 'class', 'cdc'),
|
||||
os.path.join(cherryusb_path, 'class', 'hid'),
|
||||
]
|
||||
|
||||
if GetDepend(['BSP_LINKER_SCRIPT_FLEXSPI_NOR']):
|
||||
CPPDEFINES += ['XIP_EXTERNAL_FLASH=1']
|
||||
|
||||
if GetDepend(['BSP_LINKER_SCRIPT_FLEXSPI_NOR_HYPERRAM']):
|
||||
CPPDEFINES += ['XIP_EXTERNAL_FLASH=1']
|
||||
|
||||
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES=CPPDEFINES, LINKFLAGS=LINKFLAGS)
|
||||
|
||||
Return('group')
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
+153
@@ -0,0 +1,153 @@
|
||||
/*
|
||||
** ###################################################################
|
||||
** Processors: MIMXRT1189CVM8B_cm7
|
||||
** MIMXRT1189CVM8C_cm7
|
||||
** MIMXRT1189XVM8B_cm7
|
||||
** MIMXRT1189XVM8C_cm7
|
||||
**
|
||||
** Compiler: IAR ANSI C/C++ Compiler for ARM
|
||||
** Reference manual: IMXRT1180RM, Rev 5, 01/2024
|
||||
** Version: rev. 2.0, 2024-01-18
|
||||
** Build: b250310
|
||||
**
|
||||
** Abstract:
|
||||
** Linker file for the IAR ANSI C/C++ Compiler for ARM
|
||||
**
|
||||
** Copyright 2016 Freescale Semiconductor, Inc.
|
||||
** Copyright 2016-2025 NXP
|
||||
** SPDX-License-Identifier: BSD-3-Clause
|
||||
**
|
||||
** http: www.nxp.com
|
||||
** mail: support@nxp.com
|
||||
**
|
||||
** ###################################################################
|
||||
*/
|
||||
|
||||
/* Board memory map */
|
||||
define symbol m_itcm_start = 0x00000000;
|
||||
define symbol m_itcm_size = 0x00040000;
|
||||
|
||||
define symbol m_dtcm_start = 0x20000000;
|
||||
define symbol m_dtcm_size = 0x00040000;
|
||||
|
||||
define symbol m_ocram1_start = 0x20484000; /* OCRAM1 first 16K access is blocked by TRDC */
|
||||
define symbol m_ocram1_size = 0x0007C000;
|
||||
|
||||
define symbol m_ocram2_start = 0x20500000;
|
||||
define symbol m_ocram2_size = 0x00040000;
|
||||
|
||||
define symbol m_sdram_start = 0x80000000;
|
||||
define symbol m_sdram_size = 0x01E00000; /* Reserved 2M for CM33 usage, so size = physical memory size - 2M */
|
||||
define symbol m_hyperram_start = 0x04000000;
|
||||
define symbol m_hyperram_size = 0x00600000; /* Reserved 2M for CM33 usage, so size = physical memory size - 2M */
|
||||
define symbol m_flash_start = 0x28800000;
|
||||
define symbol m_flash_size = 0x00800000;
|
||||
|
||||
/* General definition */
|
||||
define symbol app_image_offset = 0x00000000;
|
||||
define symbol vector_table_size = 0x00000400;
|
||||
if (isdefinedsymbol(__stack_size__)) {
|
||||
define symbol __size_cstack__ = __stack_size__;
|
||||
} else {
|
||||
define symbol __size_cstack__ = 0x1000;
|
||||
}
|
||||
|
||||
if (isdefinedsymbol(__heap_size__)) {
|
||||
define symbol __size_heap__ = __heap_size__;
|
||||
} else {
|
||||
define symbol __size_heap__ = 0x8000;
|
||||
}
|
||||
|
||||
define symbol m_qacode_start = m_itcm_start + (isdefinedsymbol(__ram_vector_table__) ? vector_table_size : 0);
|
||||
define symbol m_qacode_end = m_itcm_start + m_itcm_size - 1;
|
||||
define symbol m_qadata_start = m_dtcm_start;
|
||||
define symbol m_qadata_end = m_dtcm_start + m_dtcm_size - 1;
|
||||
define symbol m_ram_vector_table_start = m_itcm_start;
|
||||
|
||||
/* Target specific definition, code & data allocation */
|
||||
define symbol m_code_size = m_flash_size - app_image_offset;
|
||||
define symbol m_data_size = m_dtcm_size;
|
||||
define symbol m_ncache_size = isdefinedsymbol(__multicore__) ? 0x20000 : 0x40000; /* m_ncache_size must be 2^N */
|
||||
define symbol m_shmem_size = m_ocram2_size; /* m_shmem_size must be 2^N */
|
||||
|
||||
define symbol m_ocram1_size_for_cm7 = isdefinedsymbol(__multicore__) ? 0x40000 : m_ocram1_size;
|
||||
|
||||
define symbol m_ram_vector_table_size = isdefinedsymbol(__ram_vector_table__) ? vector_table_size : 0;
|
||||
|
||||
define symbol m_text_start = m_flash_start + app_image_offset;
|
||||
define symbol m_text_end = m_text_start + m_code_size - 1;
|
||||
define symbol m_interrupts_start = m_text_start;
|
||||
|
||||
define symbol m_data_start = m_dtcm_start;
|
||||
define symbol m_data_end = m_data_start + m_data_size - 1;
|
||||
|
||||
define symbol m_ncache_start = m_ocram1_start + m_ocram1_size - m_ncache_size; /* (m_ncache_start % m_ncache_size) must be 0 */
|
||||
define symbol m_ncache_end = m_ncache_start + m_ncache_size - 1;
|
||||
|
||||
define symbol m_heap_start = m_ocram1_start + m_ocram1_size - m_ocram1_size_for_cm7;
|
||||
define symbol m_heap_end = m_ncache_start - 1;
|
||||
|
||||
if (isdefinedsymbol(__use_shmem__)) {
|
||||
define symbol m_rpmsg_sh_mem_start = m_ocram2_start; /* (m_rpmsg_sh_mem_start % m_shmem_size) must be 0 */
|
||||
define symbol m_rpmsg_sh_mem_end = m_rpmsg_sh_mem_start + m_shmem_size - 1;
|
||||
}
|
||||
|
||||
/* Exported symbol definition */
|
||||
define exported symbol __VECTOR_TABLE = m_interrupts_start;
|
||||
define exported symbol __VECTOR_RAM = m_ram_vector_table_start;
|
||||
define exported symbol __RAM_VECTOR_TABLE_SIZE = m_ram_vector_table_size;
|
||||
define exported symbol __NCACHE_REGION_START = m_ncache_start;
|
||||
define exported symbol __NCACHE_REGION_SIZE = m_ncache_end - m_ncache_start + 1;
|
||||
if (isdefinedsymbol(__use_shmem__)) {
|
||||
define exported symbol rpmsg_sh_mem_start = m_rpmsg_sh_mem_start;
|
||||
define exported symbol rpmsg_sh_mem_end = m_rpmsg_sh_mem_end;
|
||||
define exported symbol __RPMSG_SH_MEM_START = m_rpmsg_sh_mem_start;
|
||||
define exported symbol __RPMSG_SH_MEM_SIZE = m_rpmsg_sh_mem_end - m_rpmsg_sh_mem_start + 1;
|
||||
}
|
||||
|
||||
/* Region definition */
|
||||
define memory mem with size = 4G;
|
||||
define region TEXT_region = mem:[from m_text_start to m_text_end];
|
||||
define region DATA_region = mem:[from m_data_start to m_data_end-__size_cstack__];
|
||||
define region CSTACK_region = mem:[from m_data_end-__size_cstack__+1 to m_data_end];
|
||||
define region NCACHE_region = mem:[from m_ncache_start to m_ncache_end];
|
||||
define region HEAP_region = mem:[from m_heap_start to m_heap_end];
|
||||
define region QACODE_region = mem:[from m_qacode_start to m_qacode_end];
|
||||
define region QADATA_region = mem:[from m_qadata_start to m_qadata_end];
|
||||
if (isdefinedsymbol(__use_shmem__)) {
|
||||
define region rpmsg_sh_mem_region = mem:[from m_rpmsg_sh_mem_start to m_rpmsg_sh_mem_end];
|
||||
}
|
||||
|
||||
/* Block definition */
|
||||
define block RW { readwrite };
|
||||
define block ZI { zi };
|
||||
define block NCACHE_VAR { section NonCacheable , section NonCacheable.init };
|
||||
define block QACCESS_CODE { section CodeQuickAccess };
|
||||
define block QACCESS_DATA { section DataQuickAccess };
|
||||
define block CSTACK with alignment = 8, size = __size_cstack__ { };
|
||||
define block HEAP with alignment = 8, size = __size_heap__ { };
|
||||
|
||||
initialize by copy { readwrite, section .textrw, section DataQuickAccess, section CodeQuickAccess,
|
||||
ro code object fsl_flexspi.o, ro code object drv_flexspi_nor_flash.o, ro code object drv_flexspi.o };
|
||||
do not initialize { section .noinit };
|
||||
if (isdefinedsymbol(__use_shmem__)) {
|
||||
do not initialize { section rpmsg_sh_mem_section };
|
||||
}
|
||||
|
||||
place at address mem: m_interrupts_start { readonly section .intvec };
|
||||
|
||||
place in TEXT_region { readonly };
|
||||
place in QACODE_region { block QACCESS_CODE };
|
||||
place in DATA_region { block RW };
|
||||
place in DATA_region { block ZI };
|
||||
place in DATA_region { block QACCESS_DATA };
|
||||
place in NCACHE_region { block NCACHE_VAR };
|
||||
place in CSTACK_region { block CSTACK };
|
||||
if (isdefinedsymbol(__heap_noncacheable__)) {
|
||||
place in NCACHE_region { last block HEAP };
|
||||
} else {
|
||||
place in HEAP_region { last block HEAP };
|
||||
}
|
||||
if (isdefinedsymbol(__use_shmem__)) {
|
||||
place in rpmsg_sh_mem_region { section rpmsg_sh_mem_section };
|
||||
}
|
||||
+333
File diff suppressed because it is too large.
Load diff
+181
@@ -0,0 +1,181 @@
|
||||
#!armclang --target=arm-arm-none-eabi -mcpu=cortex-m7 -E -x c
|
||||
/*
|
||||
** ###################################################################
|
||||
** Processors: MIMXRT1189CVM8B_cm7
|
||||
** MIMXRT1189CVM8C_cm7
|
||||
** MIMXRT1189XVM8B_cm7
|
||||
** MIMXRT1189XVM8C_cm7
|
||||
**
|
||||
** Compiler: Keil ARM C/C++ Compiler
|
||||
** Reference manual: IMXRT1180RM, Rev 5, 01/2024
|
||||
** Version: rev. 2.0, 2024-01-18
|
||||
** Build: b250310
|
||||
**
|
||||
** Abstract:
|
||||
** Linker file for the Keil ARM C/C++ Compiler
|
||||
**
|
||||
** Copyright 2016 Freescale Semiconductor, Inc.
|
||||
** Copyright 2016-2025 NXP
|
||||
** SPDX-License-Identifier: BSD-3-Clause
|
||||
**
|
||||
** http: www.nxp.com
|
||||
** mail: support@nxp.com
|
||||
**
|
||||
** ###################################################################
|
||||
*/
|
||||
|
||||
|
||||
/* Board memory map */
|
||||
|
||||
#define m_itcm_start 0x00000000
|
||||
#define m_itcm_size 0x00040000
|
||||
|
||||
#define m_dtcm_start 0x20000000
|
||||
#define m_dtcm_size 0x00040000
|
||||
|
||||
#define m_ocram1_start 0x20484000 /* OCRAM1 first 16K access is blocked by TRDC */
|
||||
#define m_ocram1_size 0x0007C000
|
||||
|
||||
#define m_ocram2_start 0x20500000
|
||||
#define m_ocram2_size 0x00040000
|
||||
|
||||
#define m_sdram_start 0x80000000
|
||||
#define m_sdram_size 0x01E00000 /* Reserved 2M for CM33 usage, so size = physical memory size - 2M */
|
||||
#define m_hyperram_start 0x04000000
|
||||
#define m_hyperram_size 0x00600000 /* Reserved 2M for CM33 usage, so size = physical memory size - 2M */
|
||||
#define m_flash_start 0x28800000
|
||||
#define m_flash_size 0x00800000
|
||||
|
||||
/* General definition */
|
||||
#define app_image_offset 0x00000000
|
||||
#define vector_table_size 0x400
|
||||
#define m_ram_vector_table_start m_itcm_start
|
||||
|
||||
#if defined(__stack_size__)
|
||||
#define stack_size __stack_size__
|
||||
#else
|
||||
#define stack_size 0x01000
|
||||
#endif
|
||||
|
||||
#if defined(__heap_size__)
|
||||
#define heap_size __heap_size__
|
||||
#else
|
||||
#define heap_size 0x08000
|
||||
#endif
|
||||
|
||||
/* Target specific definition, code & data allocation */
|
||||
#if defined(__ram_vector_table__)
|
||||
#define m_ram_vector_table_size vector_table_size
|
||||
#else
|
||||
#define m_ram_vector_table_size 0
|
||||
#endif
|
||||
|
||||
#define m_qacode_start m_itcm_start + m_ram_vector_table_size
|
||||
#define m_qadata_start m_dtcm_start
|
||||
#define m_qacode_size m_itcm_size - (m_qacode_start - m_itcm_start)
|
||||
#define m_qadata_size 0
|
||||
|
||||
#define m_text_size m_flash_size - app_image_offset
|
||||
#define m_data_size m_dtcm_size
|
||||
#if defined(__multicore__)
|
||||
#define m_ncache_size 0x20000 /* m_ncache_size must be 2^N */
|
||||
#define m_ocram1_size_for_cm7 0x40000
|
||||
#else
|
||||
#define m_ncache_size 0x40000 /* m_ncache_size must be 2^N */
|
||||
#define m_ocram1_size_for_cm7 m_ocram1_size
|
||||
#endif
|
||||
|
||||
#define m_shmem_size m_ocram2_size /* m_shmem_size must be 2^N */
|
||||
|
||||
#define m_text_start m_flash_start + app_image_offset
|
||||
#define m_interrupts_start m_text_start
|
||||
#define m_data_start m_dtcm_start
|
||||
#define m_ncache_start m_ocram1_start + m_ocram1_size - m_ncache_size
|
||||
#define m_heap_start m_ocram1_start + m_ocram1_size - m_ocram1_size_for_cm7
|
||||
|
||||
#if defined(__use_shmem__)
|
||||
#define m_shmem_start m_ocram2_start
|
||||
#endif
|
||||
|
||||
; load region
|
||||
LR_m_text m_text_start m_text_size
|
||||
{
|
||||
; load address = execution address
|
||||
VECTOR_ROM m_interrupts_start FIXED vector_table_size
|
||||
{
|
||||
* (.isr_vector,+FIRST)
|
||||
}
|
||||
|
||||
VECTOR_RAM m_ram_vector_table_start EMPTY m_ram_vector_table_size
|
||||
{
|
||||
}
|
||||
|
||||
; load address = execution address
|
||||
ER_m_text m_text_start + vector_table_size FIXED m_text_size - vector_table_size
|
||||
{
|
||||
* (InRoot$$Sections)
|
||||
.ANY (+RO)
|
||||
}
|
||||
|
||||
ER_m_QuickAccessCode m_qacode_start m_qacode_size
|
||||
{
|
||||
.ANY (CodeQuickAccess)
|
||||
fsl_flexspi.o (+RO-CODE)
|
||||
drv_flexspi_nor_flash.o (+RO-CODE)
|
||||
drv_flexspi.o (+RO-CODE)
|
||||
}
|
||||
|
||||
ER_m_QuickAccessData m_qadata_start EMPTY m_qadata_size
|
||||
{
|
||||
}
|
||||
|
||||
RW_m_data m_data_start m_data_size-stack_size
|
||||
{
|
||||
.ANY (+RW +ZI)
|
||||
.ANY (DataQuickAccess)
|
||||
}
|
||||
|
||||
; ncache data
|
||||
RW_m_ncache m_ncache_start m_ncache_size
|
||||
{
|
||||
.ANY (NonCacheable.init)
|
||||
.ANY (.bss.NonCacheable)
|
||||
}
|
||||
|
||||
#if defined(__heap_noncacheable__)
|
||||
; Heap region growing up
|
||||
ARM_LIB_HEAP +0 ALIGN 0x100 EMPTY heap_size
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
; Empty region added for MPU configuration
|
||||
RW_m_ncache_aux m_ncache_start + m_ncache_size EMPTY 0
|
||||
{
|
||||
}
|
||||
|
||||
#if defined(__use_shmem__)
|
||||
; shared memory data
|
||||
RPMSG_SH_MEM m_shmem_start m_shmem_size
|
||||
{
|
||||
.ANY (rpmsg_sh_mem_section)
|
||||
}
|
||||
|
||||
; Empty region added for MPU configuration
|
||||
RPMSG_SH_MEM_aux m_shmem_start + m_shmem_size EMPTY 0
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(__heap_noncacheable__)
|
||||
; Heap region growing up
|
||||
ARM_LIB_HEAP m_heap_start EMPTY heap_size
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
; Stack region growing down
|
||||
ARM_LIB_STACK m_data_start+m_data_size EMPTY -stack_size
|
||||
{
|
||||
}
|
||||
}
|
||||
+157
@@ -0,0 +1,157 @@
|
||||
/*
|
||||
** ###################################################################
|
||||
** Processors: MIMXRT1189CVM8B_cm7
|
||||
** MIMXRT1189CVM8C_cm7
|
||||
** MIMXRT1189XVM8B_cm7
|
||||
** MIMXRT1189XVM8C_cm7
|
||||
**
|
||||
** Compiler: IAR ANSI C/C++ Compiler for ARM
|
||||
** Reference manual: IMXRT1180RM, Rev 5, 01/2024
|
||||
** Version: rev. 2.0, 2024-01-18
|
||||
** Build: b250310
|
||||
**
|
||||
** Abstract:
|
||||
** Linker file for the IAR ANSI C/C++ Compiler for ARM
|
||||
**
|
||||
** Copyright 2016 Freescale Semiconductor, Inc.
|
||||
** Copyright 2016-2025 NXP
|
||||
** SPDX-License-Identifier: BSD-3-Clause
|
||||
**
|
||||
** http: www.nxp.com
|
||||
** mail: support@nxp.com
|
||||
**
|
||||
** ###################################################################
|
||||
*/
|
||||
|
||||
/* Board memory map */
|
||||
define symbol m_itcm_start = 0x00000000;
|
||||
define symbol m_itcm_size = 0x00040000;
|
||||
|
||||
define symbol m_dtcm_start = 0x20000000;
|
||||
define symbol m_dtcm_size = 0x00040000;
|
||||
|
||||
define symbol m_ocram1_start = 0x20484000; /* OCRAM1 first 16K access is blocked by TRDC */
|
||||
define symbol m_ocram1_size = 0x0007C000;
|
||||
|
||||
define symbol m_ocram2_start = 0x20500000;
|
||||
define symbol m_ocram2_size = 0x00040000;
|
||||
|
||||
define symbol m_sdram_start = 0x80000000;
|
||||
define symbol m_sdram_size = 0x01E00000; /* Reserved 2M for CM33 usage, so size = physical memory size - 2M */
|
||||
define symbol m_hyperram_start = 0x04000000;
|
||||
define symbol m_hyperram_size = 0x00600000; /* Reserved 2M for CM33 usage, so size = physical memory size - 2M */
|
||||
define symbol m_flash_start = 0x28800000;
|
||||
define symbol m_flash_size = 0x00800000;
|
||||
|
||||
/* General definition */
|
||||
define symbol app_image_offset = 0x00000000;
|
||||
define symbol vector_table_size = 0x00000400;
|
||||
if (isdefinedsymbol(__stack_size__)) {
|
||||
define symbol __size_cstack__ = __stack_size__;
|
||||
} else {
|
||||
define symbol __size_cstack__ = 0x1000;
|
||||
}
|
||||
|
||||
if (isdefinedsymbol(__heap_size__)) {
|
||||
define symbol __size_heap__ = __heap_size__;
|
||||
} else {
|
||||
define symbol __size_heap__ = 0x8000;
|
||||
}
|
||||
|
||||
define symbol m_qacode_start = m_itcm_start + (isdefinedsymbol(__ram_vector_table__) ? vector_table_size : 0);
|
||||
define symbol m_qacode_end = m_itcm_start + m_itcm_size - 1;
|
||||
define symbol m_qadata_start = m_dtcm_start;
|
||||
define symbol m_qadata_end = m_dtcm_start + m_dtcm_size - 1;
|
||||
define symbol m_ram_vector_table_start = m_itcm_start;
|
||||
|
||||
/* Target specific definition, code & data allocation */
|
||||
define symbol m_code_size = m_flash_size - app_image_offset;
|
||||
define symbol m_data_size = 0x00600000;
|
||||
define symbol m_ncache_size = isdefinedsymbol(__multicore__) ? 0x20000 : 0x40000; /* m_ncache_size must be 2^N */
|
||||
define symbol m_shmem_size = m_ocram2_size; /* m_shmem_size must be 2^N */
|
||||
|
||||
define symbol m_ocram1_size_for_cm7 = isdefinedsymbol(__multicore__) ? 0x40000 : m_ocram1_size;
|
||||
|
||||
define symbol m_ram_vector_table_size = isdefinedsymbol(__ram_vector_table__) ? vector_table_size : 0;
|
||||
|
||||
define symbol m_text_start = m_flash_start + app_image_offset;
|
||||
define symbol m_text_end = m_text_start + m_code_size - 1;
|
||||
define symbol m_interrupts_start = m_text_start;
|
||||
|
||||
define symbol m_data_start = m_hyperram_start;
|
||||
define symbol m_data_end = m_data_start + m_data_size - 1;
|
||||
|
||||
define symbol m_ncache_start = m_ocram1_start + m_ocram1_size - m_ncache_size; /* (m_ncache_start % m_ncache_size) must be 0 */
|
||||
define symbol m_ncache_end = m_ncache_start + m_ncache_size - 1;
|
||||
|
||||
define symbol m_heap_start = m_ocram1_start + m_ocram1_size - m_ocram1_size_for_cm7;
|
||||
define symbol m_heap_end = m_ncache_start - 1;
|
||||
|
||||
if (isdefinedsymbol(__use_shmem__)) {
|
||||
define symbol m_rpmsg_sh_mem_start = m_ocram2_start; /* (m_rpmsg_sh_mem_start % m_shmem_size) must be 0 */
|
||||
define symbol m_rpmsg_sh_mem_end = m_rpmsg_sh_mem_start + m_shmem_size - 1;
|
||||
}
|
||||
|
||||
/* Exported symbol definition */
|
||||
define exported symbol __VECTOR_TABLE = m_interrupts_start;
|
||||
define exported symbol __VECTOR_RAM = m_ram_vector_table_start;
|
||||
define exported symbol __RAM_VECTOR_TABLE_SIZE = m_ram_vector_table_size;
|
||||
define exported symbol __NCACHE_REGION_START = m_ncache_start;
|
||||
define exported symbol __NCACHE_REGION_SIZE = m_ncache_end - m_ncache_start + 1;
|
||||
if (isdefinedsymbol(__use_shmem__)) {
|
||||
define exported symbol rpmsg_sh_mem_start = m_rpmsg_sh_mem_start;
|
||||
define exported symbol rpmsg_sh_mem_end = m_rpmsg_sh_mem_end;
|
||||
define exported symbol __RPMSG_SH_MEM_START = m_rpmsg_sh_mem_start;
|
||||
define exported symbol __RPMSG_SH_MEM_SIZE = m_rpmsg_sh_mem_end - m_rpmsg_sh_mem_start + 1;
|
||||
}
|
||||
|
||||
/* Region definition */
|
||||
define memory mem with size = 4G;
|
||||
define region TEXT_region = mem:[from m_text_start to m_text_end];
|
||||
define region DATA_region = mem:[from m_data_start to m_data_end-__size_cstack__];
|
||||
define region CSTACK_region = mem:[from m_data_end-__size_cstack__+1 to m_data_end];
|
||||
define region NCACHE_region = mem:[from m_ncache_start to m_ncache_end];
|
||||
define region HEAP_region = mem:[from m_heap_start to m_heap_end];
|
||||
define region QACODE_region = mem:[from m_qacode_start to m_qacode_end];
|
||||
define region QADATA_region = mem:[from m_qadata_start to m_qadata_end];
|
||||
if (isdefinedsymbol(__use_shmem__)) {
|
||||
define region rpmsg_sh_mem_region = mem:[from m_rpmsg_sh_mem_start to m_rpmsg_sh_mem_end];
|
||||
}
|
||||
|
||||
/* Block definition */
|
||||
define block RW { readwrite };
|
||||
define block ZI { zi };
|
||||
define block NCACHE_VAR { section NonCacheable , section NonCacheable.init };
|
||||
define block QACCESS_CODE { section CodeQuickAccess };
|
||||
define block QACCESS_DATA { section DataQuickAccess };
|
||||
define block CSTACK with alignment = 8, size = __size_cstack__ { };
|
||||
define block HEAP with alignment = 8, size = __size_heap__ { };
|
||||
|
||||
/* cache line size = 32 bytes */
|
||||
define block CACHE_LINE_DATA_ZI with alignment = 32, end alignment = 32 { section CacheLineData };
|
||||
define block CACHE_LINE_DATA_RW with alignment = 32, end alignment = 32 { section CacheLineData.init };
|
||||
|
||||
initialize by copy { readwrite, section .textrw, section DataQuickAccess, section CodeQuickAccess,
|
||||
ro code object fsl_flexspi.o, ro code object drv_flexspi_nor_flash.o, ro code object drv_flexspi.o };
|
||||
do not initialize { section .noinit };
|
||||
if (isdefinedsymbol(__use_shmem__)) {
|
||||
do not initialize { section rpmsg_sh_mem_section };
|
||||
}
|
||||
|
||||
place at address mem: m_interrupts_start { readonly section .intvec };
|
||||
|
||||
place in TEXT_region { readonly };
|
||||
place in QACODE_region { block QACCESS_CODE };
|
||||
place in DATA_region { block RW, block CACHE_LINE_DATA_RW };
|
||||
place in DATA_region { block ZI, block CACHE_LINE_DATA_ZI };
|
||||
place in QADATA_region { block QACCESS_DATA };
|
||||
place in NCACHE_region { block NCACHE_VAR };
|
||||
place in CSTACK_region { block CSTACK };
|
||||
if (isdefinedsymbol(__heap_noncacheable__)) {
|
||||
place in NCACHE_region { last block HEAP };
|
||||
} else {
|
||||
place in HEAP_region { last block HEAP };
|
||||
}
|
||||
if (isdefinedsymbol(__use_shmem__)) {
|
||||
place in rpmsg_sh_mem_region { section rpmsg_sh_mem_section };
|
||||
}
|
||||
+337
File diff suppressed because it is too large.
Load diff
+194
@@ -0,0 +1,194 @@
|
||||
#!armclang --target=arm-arm-none-eabi -mcpu=cortex-m7 -E -x c
|
||||
/*
|
||||
** ###################################################################
|
||||
** Processors: MIMXRT1189CVM8B_cm7
|
||||
** MIMXRT1189CVM8C_cm7
|
||||
** MIMXRT1189XVM8B_cm7
|
||||
** MIMXRT1189XVM8C_cm7
|
||||
**
|
||||
** Compiler: Keil ARM C/C++ Compiler
|
||||
** Reference manual: IMXRT1180RM, Rev 5, 01/2024
|
||||
** Version: rev. 2.0, 2024-01-18
|
||||
** Build: b250310
|
||||
**
|
||||
** Abstract:
|
||||
** Linker file for the Keil ARM C/C++ Compiler
|
||||
**
|
||||
** Copyright 2016 Freescale Semiconductor, Inc.
|
||||
** Copyright 2016-2025 NXP
|
||||
** SPDX-License-Identifier: BSD-3-Clause
|
||||
**
|
||||
** http: www.nxp.com
|
||||
** mail: support@nxp.com
|
||||
**
|
||||
** ###################################################################
|
||||
*/
|
||||
|
||||
|
||||
/* Board memory map */
|
||||
|
||||
#define m_itcm_start 0x00000000
|
||||
#define m_itcm_size 0x00040000
|
||||
|
||||
#define m_dtcm_start 0x20000000
|
||||
#define m_dtcm_size 0x00040000
|
||||
|
||||
#define m_ocram1_start 0x20484000 /* OCRAM1 first 16K access is blocked by TRDC */
|
||||
#define m_ocram1_size 0x0007C000
|
||||
|
||||
#define m_ocram2_start 0x20500000
|
||||
#define m_ocram2_size 0x00040000
|
||||
|
||||
#define m_sdram_start 0x80000000
|
||||
#define m_sdram_size 0x01E00000 /* Reserved 2M for CM33 usage, so size = physical memory size - 2M */
|
||||
#define m_hyperram_start 0x04000000
|
||||
#define m_hyperram_size 0x00600000 /* Reserved 2M for CM33 usage, so size = physical memory size - 2M */
|
||||
#define m_flash_start 0x28800000
|
||||
#define m_flash_size 0x00800000
|
||||
|
||||
/* General definition */
|
||||
#define app_image_offset 0x00000000
|
||||
#define vector_table_size 0x400
|
||||
#define m_ram_vector_table_start m_itcm_start
|
||||
|
||||
#if defined(__stack_size__)
|
||||
#define stack_size __stack_size__
|
||||
#else
|
||||
#define stack_size 0x01000
|
||||
#endif
|
||||
|
||||
#if defined(__heap_size__)
|
||||
#define heap_size __heap_size__
|
||||
#else
|
||||
#define heap_size 0x08000
|
||||
#endif
|
||||
|
||||
/* Target specific definition, code & data allocation */
|
||||
#if defined(__ram_vector_table__)
|
||||
#define m_ram_vector_table_size vector_table_size
|
||||
#else
|
||||
#define m_ram_vector_table_size 0
|
||||
#endif
|
||||
|
||||
#define m_qacode_start m_itcm_start + m_ram_vector_table_size
|
||||
#define m_qadata_start m_dtcm_start
|
||||
#define m_qacode_size m_itcm_size - (m_qacode_start - m_itcm_start)
|
||||
#define m_qadata_size m_dtcm_size
|
||||
|
||||
#define m_text_size m_flash_size - app_image_offset
|
||||
#define m_data_size 0x00600000
|
||||
#if defined(__multicore__)
|
||||
#define m_ncache_size 0x20000 /* m_ncache_size must be 2^N */
|
||||
#define m_ocram1_size_for_cm7 0x40000
|
||||
#else
|
||||
#define m_ncache_size 0x40000 /* m_ncache_size must be 2^N */
|
||||
#define m_ocram1_size_for_cm7 m_ocram1_size
|
||||
#endif
|
||||
|
||||
#define m_shmem_size m_ocram2_size /* m_shmem_size must be 2^N */
|
||||
|
||||
#define m_text_start m_flash_start + app_image_offset
|
||||
#define m_interrupts_start m_text_start
|
||||
#define m_data_start m_hyperram_start
|
||||
#define m_ncache_start m_ocram1_start + m_ocram1_size - m_ncache_size
|
||||
#define m_heap_start m_ocram1_start + m_ocram1_size - m_ocram1_size_for_cm7
|
||||
|
||||
#if defined(__use_shmem__)
|
||||
#define m_shmem_start m_ocram2_start
|
||||
#endif
|
||||
|
||||
; load region
|
||||
LR_m_text m_text_start m_text_size
|
||||
{
|
||||
; load address = execution address
|
||||
VECTOR_ROM m_interrupts_start FIXED vector_table_size
|
||||
{
|
||||
* (.isr_vector,+FIRST)
|
||||
}
|
||||
|
||||
VECTOR_RAM m_ram_vector_table_start EMPTY m_ram_vector_table_size
|
||||
{
|
||||
}
|
||||
|
||||
; load address = execution address
|
||||
ER_m_text m_text_start + vector_table_size FIXED m_text_size - vector_table_size
|
||||
{
|
||||
* (InRoot$$Sections)
|
||||
.ANY (+RO)
|
||||
}
|
||||
|
||||
ER_m_QuickAccessCode m_qacode_start m_qacode_size
|
||||
{
|
||||
.ANY (CodeQuickAccess)
|
||||
}
|
||||
|
||||
ER_m_QuickAccessData m_qadata_start m_qadata_size
|
||||
{
|
||||
.ANY (DataQuickAccess)
|
||||
fsl_flexspi.o (+RO-CODE)
|
||||
drv_flexspi_nor_flash.o (+RO-CODE)
|
||||
drv_flexspi.o (+RO-CODE)
|
||||
}
|
||||
|
||||
RW_m_data m_data_start m_data_size-stack_size
|
||||
{
|
||||
.ANY (+RW +ZI)
|
||||
}
|
||||
|
||||
; cache line size is 32 bytes
|
||||
RW_m_CacheLineData +0 ALIGN 32 (m_data_size-stack_size-ImageLength(RW_m_data))/32*32
|
||||
{
|
||||
* (CacheLineData)
|
||||
* (CacheLineData.init)
|
||||
}
|
||||
|
||||
; auxiliary to make sure RW_m_CacheLineData end-aligned CACHE LINE SIZE
|
||||
; DO NOT insert any region between RW_m_CacheLineData and RW_m_CacheLineData_Aux
|
||||
RW_m_CacheLineData_Aux +0 ALIGN 32 EMPTY 0
|
||||
{
|
||||
}
|
||||
|
||||
; ncache data
|
||||
RW_m_ncache m_ncache_start m_ncache_size
|
||||
{
|
||||
.ANY (NonCacheable.init)
|
||||
.ANY (.bss.NonCacheable)
|
||||
}
|
||||
|
||||
#if defined(__heap_noncacheable__)
|
||||
; Heap region growing up
|
||||
ARM_LIB_HEAP +0 ALIGN 0x100 EMPTY heap_size
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
; Empty region added for MPU configuration
|
||||
RW_m_ncache_aux m_ncache_start + m_ncache_size EMPTY 0
|
||||
{
|
||||
}
|
||||
|
||||
#if defined(__use_shmem__)
|
||||
; shared memory data
|
||||
RPMSG_SH_MEM m_shmem_start m_shmem_size
|
||||
{
|
||||
.ANY (rpmsg_sh_mem_section)
|
||||
}
|
||||
|
||||
; Empty region added for MPU configuration
|
||||
RPMSG_SH_MEM_aux m_shmem_start + m_shmem_size EMPTY 0
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(__heap_noncacheable__)
|
||||
; Heap region growing up
|
||||
ARM_LIB_HEAP m_heap_start EMPTY heap_size
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
; Stack region growing down
|
||||
ARM_LIB_STACK m_data_start+m_data_size EMPTY -stack_size
|
||||
{
|
||||
}
|
||||
}
|
||||
+156
@@ -0,0 +1,156 @@
|
||||
/*
|
||||
** ###################################################################
|
||||
** Processors: MIMXRT1189CVM8B_cm7
|
||||
** MIMXRT1189CVM8C_cm7
|
||||
** MIMXRT1189XVM8B_cm7
|
||||
** MIMXRT1189XVM8C_cm7
|
||||
**
|
||||
** Compiler: IAR ANSI C/C++ Compiler for ARM
|
||||
** Reference manual: IMXRT1180RM, Rev 5, 01/2024
|
||||
** Version: rev. 2.0, 2024-01-18
|
||||
** Build: b250310
|
||||
**
|
||||
** Abstract:
|
||||
** Linker file for the IAR ANSI C/C++ Compiler for ARM
|
||||
**
|
||||
** Copyright 2016 Freescale Semiconductor, Inc.
|
||||
** Copyright 2016-2025 NXP
|
||||
** SPDX-License-Identifier: BSD-3-Clause
|
||||
**
|
||||
** http: www.nxp.com
|
||||
** mail: support@nxp.com
|
||||
**
|
||||
** ###################################################################
|
||||
*/
|
||||
|
||||
/* Board memory map */
|
||||
define symbol m_itcm_start = 0x00000000;
|
||||
define symbol m_itcm_size = 0x00040000;
|
||||
|
||||
define symbol m_dtcm_start = 0x20000000;
|
||||
define symbol m_dtcm_size = 0x00040000;
|
||||
|
||||
define symbol m_ocram1_start = 0x20484000; /* OCRAM1 first 16K access is blocked by TRDC */
|
||||
define symbol m_ocram1_size = 0x0007C000;
|
||||
|
||||
define symbol m_ocram2_start = 0x20500000;
|
||||
define symbol m_ocram2_size = 0x00040000;
|
||||
|
||||
define symbol m_sdram_start = 0x80000000;
|
||||
define symbol m_sdram_size = 0x01E00000; /* Reserved 2M for CM33 usage, so size = physical memory size - 2M */
|
||||
define symbol m_hyperram_start = 0x04000000;
|
||||
define symbol m_hyperram_size = 0x00600000; /* Reserved 2M for CM33 usage, so size = physical memory size - 2M */
|
||||
define symbol m_flash_start = 0x28000000;
|
||||
define symbol m_flash_size = 0x01000000;
|
||||
|
||||
/* General definition */
|
||||
define symbol app_image_offset = 0x0000B000;
|
||||
define symbol vector_table_size = 0x00000400;
|
||||
if (isdefinedsymbol(__stack_size__)) {
|
||||
define symbol __size_cstack__ = __stack_size__;
|
||||
} else {
|
||||
define symbol __size_cstack__ = 0x8000;
|
||||
}
|
||||
|
||||
if (isdefinedsymbol(__heap_size__)) {
|
||||
define symbol __size_heap__ = __heap_size__;
|
||||
} else {
|
||||
define symbol __size_heap__ = 0x4000;
|
||||
}
|
||||
|
||||
define symbol m_qacode_start = m_itcm_start + (isdefinedsymbol(__ram_vector_table__) ? vector_table_size : 0);
|
||||
define symbol m_qacode_end = m_itcm_start + m_itcm_size - 1;
|
||||
define symbol m_qadata_start = m_dtcm_start;
|
||||
define symbol m_qadata_end = m_dtcm_start + m_dtcm_size - 1;
|
||||
define symbol m_ram_vector_table_start = m_itcm_start;
|
||||
|
||||
/* Target specific definition, code & data allocation */
|
||||
define symbol m_code_size = m_itcm_size;
|
||||
define symbol m_data_size = 0x00600000;
|
||||
define symbol m_ncache_size = isdefinedsymbol(__multicore__) ? 0x20000 : 0x40000; /* m_ncache_size must be 2^N */
|
||||
define symbol m_shmem_size = m_ocram2_size; /* m_shmem_size must be 2^N */
|
||||
|
||||
define symbol m_ocram1_size_for_cm7 = isdefinedsymbol(__multicore__) ? 0x40000 : m_ocram1_size;
|
||||
|
||||
define symbol m_ram_vector_table_size = isdefinedsymbol(__ram_vector_table__) ? 0 : 0;
|
||||
|
||||
define symbol m_text_start = m_itcm_start;
|
||||
define symbol m_text_end = m_text_start + m_code_size - 1;
|
||||
define symbol m_interrupts_start = m_text_start;
|
||||
|
||||
define symbol m_data_start = m_hyperram_start;
|
||||
define symbol m_data_end = m_data_start + m_data_size - 1;
|
||||
|
||||
define symbol m_ncache_start = m_ocram1_start + m_ocram1_size - m_ncache_size; /* (m_ncache_start % m_ncache_size) must be 0 */
|
||||
define symbol m_ncache_end = m_ncache_start + m_ncache_size - 1;
|
||||
|
||||
define symbol m_heap_start = m_ocram1_start + m_ocram1_size - m_ocram1_size_for_cm7;
|
||||
define symbol m_heap_end = m_ncache_start - 1;
|
||||
|
||||
if (isdefinedsymbol(__use_shmem__)) {
|
||||
define symbol m_rpmsg_sh_mem_start = m_ocram2_start; /* (m_rpmsg_sh_mem_start % m_shmem_size) must be 0 */
|
||||
define symbol m_rpmsg_sh_mem_end = m_rpmsg_sh_mem_start + m_shmem_size - 1;
|
||||
}
|
||||
|
||||
/* Exported symbol definition */
|
||||
define exported symbol __VECTOR_TABLE = m_interrupts_start;
|
||||
define exported symbol __VECTOR_RAM = m_ram_vector_table_start;
|
||||
define exported symbol __RAM_VECTOR_TABLE_SIZE = m_ram_vector_table_size;
|
||||
define exported symbol __NCACHE_REGION_START = m_ncache_start;
|
||||
define exported symbol __NCACHE_REGION_SIZE = m_ncache_end - m_ncache_start + 1;
|
||||
if (isdefinedsymbol(__use_shmem__)) {
|
||||
define exported symbol rpmsg_sh_mem_start = m_rpmsg_sh_mem_start;
|
||||
define exported symbol rpmsg_sh_mem_end = m_rpmsg_sh_mem_end;
|
||||
define exported symbol __RPMSG_SH_MEM_START = m_rpmsg_sh_mem_start;
|
||||
define exported symbol __RPMSG_SH_MEM_SIZE = m_rpmsg_sh_mem_end - m_rpmsg_sh_mem_start + 1;
|
||||
}
|
||||
|
||||
/* Region definition */
|
||||
define memory mem with size = 4G;
|
||||
define region TEXT_region = mem:[from m_text_start to m_text_end];
|
||||
define region DATA_region = mem:[from m_data_start to m_data_end-__size_cstack__];
|
||||
define region CSTACK_region = mem:[from m_data_end-__size_cstack__+1 to m_data_end];
|
||||
define region NCACHE_region = mem:[from m_ncache_start to m_ncache_end];
|
||||
define region HEAP_region = mem:[from m_heap_start to m_heap_end];
|
||||
define region QACODE_region = mem:[from m_qacode_start to m_qacode_end];
|
||||
define region QADATA_region = mem:[from m_qadata_start to m_qadata_end];
|
||||
if (isdefinedsymbol(__use_shmem__)) {
|
||||
define region rpmsg_sh_mem_region = mem:[from m_rpmsg_sh_mem_start to m_rpmsg_sh_mem_end];
|
||||
}
|
||||
|
||||
/* Block definition */
|
||||
define block RW { readwrite };
|
||||
define block ZI { zi };
|
||||
define block NCACHE_VAR { section NonCacheable , section NonCacheable.init };
|
||||
define block QACCESS_CODE { section CodeQuickAccess };
|
||||
define block QACCESS_DATA { section DataQuickAccess };
|
||||
define block CSTACK with alignment = 8, size = __size_cstack__ { };
|
||||
define block HEAP with alignment = 8, size = __size_heap__ { };
|
||||
|
||||
/* cache line size = 32 bytes */
|
||||
define block CACHE_LINE_DATA_ZI with alignment = 32, end alignment = 32 { section CacheLineData };
|
||||
define block CACHE_LINE_DATA_RW with alignment = 32, end alignment = 32 { section CacheLineData.init };
|
||||
|
||||
initialize by copy { readwrite, section .textrw, section DataQuickAccess };
|
||||
do not initialize { section .noinit };
|
||||
if (isdefinedsymbol(__use_shmem__)) {
|
||||
do not initialize { section rpmsg_sh_mem_section };
|
||||
}
|
||||
|
||||
place at address mem: m_interrupts_start { readonly section .intvec };
|
||||
|
||||
place in TEXT_region { readonly };
|
||||
place in TEXT_region { block QACCESS_CODE };
|
||||
place in DATA_region { block RW, block CACHE_LINE_DATA_RW };
|
||||
place in DATA_region { block ZI, block CACHE_LINE_DATA_ZI };
|
||||
place in QADATA_region { block QACCESS_DATA };
|
||||
place in NCACHE_region { block NCACHE_VAR };
|
||||
place in CSTACK_region { block CSTACK };
|
||||
if (isdefinedsymbol(__heap_noncacheable__)) {
|
||||
place in NCACHE_region { last block HEAP };
|
||||
} else {
|
||||
place in HEAP_region { last block HEAP };
|
||||
}
|
||||
if (isdefinedsymbol(__use_shmem__)) {
|
||||
place in rpmsg_sh_mem_region { section rpmsg_sh_mem_section };
|
||||
}
|
||||
+338
File diff suppressed because it is too large.
Load diff
+190
@@ -0,0 +1,190 @@
|
||||
#!armclang --target=arm-arm-none-eabi -mcpu=cortex-m7 -E -x c
|
||||
/*
|
||||
** ###################################################################
|
||||
** Processors: MIMXRT1189CVM8B_cm7
|
||||
** MIMXRT1189CVM8C_cm7
|
||||
** MIMXRT1189XVM8B_cm7
|
||||
** MIMXRT1189XVM8C_cm7
|
||||
**
|
||||
** Compiler: Keil ARM C/C++ Compiler
|
||||
** Reference manual: IMXRT1180RM, Rev 5, 01/2024
|
||||
** Version: rev. 2.0, 2024-01-18
|
||||
** Build: b250310
|
||||
**
|
||||
** Abstract:
|
||||
** Linker file for the Keil ARM C/C++ Compiler
|
||||
**
|
||||
** Copyright 2016 Freescale Semiconductor, Inc.
|
||||
** Copyright 2016-2025 NXP
|
||||
** SPDX-License-Identifier: BSD-3-Clause
|
||||
**
|
||||
** http: www.nxp.com
|
||||
** mail: support@nxp.com
|
||||
**
|
||||
** ###################################################################
|
||||
*/
|
||||
|
||||
|
||||
/* Board memory map */
|
||||
|
||||
#define m_itcm_start 0x00000000
|
||||
#define m_itcm_size 0x00040000
|
||||
|
||||
#define m_dtcm_start 0x20000000
|
||||
#define m_dtcm_size 0x00040000
|
||||
|
||||
#define m_ocram1_start 0x20484000 /* OCRAM1 first 16K access is blocked by TRDC */
|
||||
#define m_ocram1_size 0x0007C000
|
||||
|
||||
#define m_ocram2_start 0x20500000
|
||||
#define m_ocram2_size 0x00040000
|
||||
|
||||
#define m_sdram_start 0x80000000
|
||||
#define m_sdram_size 0x01E00000 /* Reserved 2M for CM33 usage, so size = physical memory size - 2M */
|
||||
#define m_hyperram_start 0x04000000
|
||||
#define m_hyperram_size 0x00600000 /* Reserved 2M for CM33 usage, so size = physical memory size - 2M */
|
||||
#define m_flash_start 0x28000000
|
||||
#define m_flash_size 0x01000000
|
||||
|
||||
/* General definition */
|
||||
#define app_image_offset 0x0000B000
|
||||
#define vector_table_size 0x400
|
||||
#define m_ram_vector_table_start m_itcm_start
|
||||
|
||||
#if defined(__stack_size__)
|
||||
#define stack_size __stack_size__
|
||||
#else
|
||||
#define stack_size 0x01000
|
||||
#endif
|
||||
|
||||
#if defined(__heap_size__)
|
||||
#define heap_size __heap_size__
|
||||
#else
|
||||
#define heap_size 0x08000
|
||||
#endif
|
||||
|
||||
/* Target specific definition, code & data allocation */
|
||||
#if defined(__ram_vector_table__)
|
||||
#define m_ram_vector_table_size 0
|
||||
#else
|
||||
#define m_ram_vector_table_size 0
|
||||
#endif
|
||||
|
||||
#define m_qacode_start m_itcm_start + m_ram_vector_table_size
|
||||
#define m_qadata_start m_dtcm_start
|
||||
#define m_qacode_size 0
|
||||
#define m_qadata_size m_dtcm_size
|
||||
|
||||
#define m_text_size m_itcm_size
|
||||
#define m_data_size 0x00600000
|
||||
#if defined(__multicore__)
|
||||
#define m_ncache_size 0x20000 /* m_ncache_size must be 2^N */
|
||||
#define m_ocram1_size_for_cm7 0x40000
|
||||
#else
|
||||
#define m_ncache_size 0x40000 /* m_ncache_size must be 2^N */
|
||||
#define m_ocram1_size_for_cm7 m_ocram1_size
|
||||
#endif
|
||||
#define m_shmem_size m_ocram2_size /* m_shmem_size must be 2^N */
|
||||
|
||||
#define m_text_start m_itcm_start
|
||||
#define m_interrupts_start m_text_start
|
||||
#define m_data_start m_hyperram_start
|
||||
#define m_ncache_start m_ocram1_start + m_ocram1_size - m_ncache_size
|
||||
#define m_heap_start m_ocram1_start + m_ocram1_size - m_ocram1_size_for_cm7
|
||||
|
||||
#if defined(__use_shmem__)
|
||||
#define m_shmem_start m_ocram2_start
|
||||
#endif
|
||||
|
||||
; load region
|
||||
LR_m_text m_text_start m_text_size
|
||||
{
|
||||
; load address = execution address
|
||||
VECTOR_ROM m_interrupts_start FIXED vector_table_size
|
||||
{
|
||||
* (.isr_vector,+FIRST)
|
||||
}
|
||||
|
||||
VECTOR_RAM m_ram_vector_table_start EMPTY m_ram_vector_table_size
|
||||
{
|
||||
}
|
||||
|
||||
; load address = execution address
|
||||
ER_m_text m_text_start + vector_table_size FIXED m_text_size - vector_table_size
|
||||
{
|
||||
* (InRoot$$Sections)
|
||||
.ANY (+RO)
|
||||
.ANY (CodeQuickAccess)
|
||||
}
|
||||
|
||||
ER_m_QuickAccessCode m_qacode_start EMPTY m_qacode_size
|
||||
{
|
||||
}
|
||||
|
||||
ER_m_QuickAccessData m_qadata_start m_qadata_size
|
||||
{
|
||||
.ANY (DataQuickAccess)
|
||||
}
|
||||
|
||||
RW_m_data m_data_start m_data_size-stack_size
|
||||
{
|
||||
.ANY (+RW +ZI)
|
||||
}
|
||||
|
||||
; cache line size is 32 bytes
|
||||
RW_m_CacheLineData +0 ALIGN 32 (m_data_size-stack_size-ImageLength(RW_m_data))/32*32
|
||||
{
|
||||
* (CacheLineData)
|
||||
* (CacheLineData.init)
|
||||
}
|
||||
|
||||
; auxiliary to make sure RW_m_CacheLineData end-aligned CACHE LINE SIZE
|
||||
; DO NOT insert any region between RW_m_CacheLineData and RW_m_CacheLineData_Aux
|
||||
RW_m_CacheLineData_Aux +0 ALIGN 32 EMPTY 0
|
||||
{
|
||||
}
|
||||
|
||||
; ncache data
|
||||
RW_m_ncache m_ncache_start m_ncache_size
|
||||
{
|
||||
.ANY (NonCacheable.init)
|
||||
.ANY (.bss.NonCacheable)
|
||||
}
|
||||
|
||||
#if defined(__heap_noncacheable__)
|
||||
; Heap region growing up
|
||||
ARM_LIB_HEAP +0 ALIGN 0x100 EMPTY heap_size
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
; Empty region added for MPU configuration
|
||||
RW_m_ncache_aux m_ncache_start + m_ncache_size EMPTY 0
|
||||
{
|
||||
}
|
||||
|
||||
#if defined(__use_shmem__)
|
||||
; shared memory data
|
||||
RPMSG_SH_MEM m_shmem_start m_shmem_size
|
||||
{
|
||||
.ANY (rpmsg_sh_mem_section)
|
||||
}
|
||||
|
||||
; Empty region added for MPU configuration
|
||||
RPMSG_SH_MEM_aux m_shmem_start + m_shmem_size EMPTY 0
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(__heap_noncacheable__)
|
||||
; Heap region growing up
|
||||
ARM_LIB_HEAP m_heap_start EMPTY heap_size
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
; Stack region growing down
|
||||
ARM_LIB_STACK m_data_start+m_data_size EMPTY -stack_size
|
||||
{
|
||||
}
|
||||
}
|
||||
+1
-3
@@ -55,7 +55,7 @@ if (isdefinedsymbol(__stack_size__)) {
|
||||
if (isdefinedsymbol(__heap_size__)) {
|
||||
define symbol __size_heap__ = __heap_size__;
|
||||
} else {
|
||||
define symbol __size_heap__ = 0x4000;
|
||||
define symbol __size_heap__ = 0x8000;
|
||||
}
|
||||
|
||||
define symbol m_qacode_start = m_itcm_start + (isdefinedsymbol(__ram_vector_table__) ? vector_table_size : 0);
|
||||
@@ -105,8 +105,6 @@ if (isdefinedsymbol(__use_shmem__)) {
|
||||
define exported symbol __RPMSG_SH_MEM_SIZE = m_rpmsg_sh_mem_end - m_rpmsg_sh_mem_start + 1;
|
||||
}
|
||||
|
||||
define exported symbol __RTT_HEAP_END = m_ocram2_start + m_ocram2_size - 1;
|
||||
|
||||
/* Region definition */
|
||||
define memory mem with size = 4G;
|
||||
define region TEXT_region = mem:[from m_text_start to m_text_end];
|
||||
+4
-1
@@ -26,6 +26,9 @@
|
||||
/* Entry Point */
|
||||
ENTRY(Reset_Handler)
|
||||
|
||||
__use_shmem__ = 1;
|
||||
__multicore__ = 1;
|
||||
|
||||
/* Board memory map */
|
||||
m_itcm_start = 0x00000000;
|
||||
m_itcm_size = 0x00040000;
|
||||
@@ -51,7 +54,7 @@ m_qadata_start = m_dtcm_start;
|
||||
m_qadata_end = m_dtcm_start + m_dtcm_size - 1;
|
||||
m_ram_vector_table_start = m_itcm_start;
|
||||
m_stack_size = DEFINED(__stack_size__) ? __stack_size__ : 0x1000;
|
||||
m_heap_size = DEFINED(__heap_size__) ? __heap_size__ : 0x4000;
|
||||
m_heap_size = DEFINED(__heap_size__) ? __heap_size__ : 0x8000;
|
||||
|
||||
/* Target specific definition, code & data allocation */
|
||||
m_code_size = m_itcm_size - vector_table_size;
|
||||
+1
-1
@@ -60,7 +60,7 @@
|
||||
#if defined(__heap_size__)
|
||||
#define heap_size __heap_size__
|
||||
#else
|
||||
#define heap_size 0x04000
|
||||
#define heap_size 0x08000
|
||||
#endif
|
||||
|
||||
/* Target specific definition, code & data allocation */
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2026, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2024-06-03 CoreBoxer support IMXRT1180-EVK
|
||||
*/
|
||||
|
||||
#ifndef __DRV_FLEXSPI_NOR_FLASH_H__
|
||||
#define __DRV_FLEXSPI_NOR_FLASH_H__
|
||||
|
||||
#include <rtthread.h>
|
||||
|
||||
/* ============================================================
|
||||
* Flash Physical Parameters
|
||||
* Source: SDK example app.h
|
||||
* FLASH_SIZE = 0x4000 (Unit: KB) = 16MB
|
||||
* FlexSPI1_AMBA_BASE = 0x28000000
|
||||
* ============================================================ */
|
||||
#define QSPI_FLASH_BASE FlexSPI1_AMBA_BASE /* 0x28000000 */
|
||||
#define QSPI_FLASH_SIZE (0x4000U * 1024U) /* 16MB (0x4000 KB) */
|
||||
#define QSPI_SECTOR_SIZE 0x00001000U /* 4KB */
|
||||
#define QSPI_PAGE_SIZE 256U /* 256B */
|
||||
|
||||
/*
|
||||
* Partition Plan (Total 16MB):
|
||||
* 0x00000000 ~ 0x00EFFFFF: Application Code Area (15MB, limited by Scatter)
|
||||
* 0x00F00000 ~ 0x00FFFFFF: File System Area (1MB, LittleFS)
|
||||
*/
|
||||
#define QSPI_FS_OFFSET 0x00F00000U
|
||||
#define QSPI_FS_SIZE 0x00100000U
|
||||
|
||||
/* ============================================================
|
||||
* RAM Code Section Attributes
|
||||
* Write/Erase functions placed in CodeQuickAccess (ITCM),
|
||||
* CPU can safely fetch instructions during FlexSPI IP command execution.
|
||||
* ============================================================ */
|
||||
#if defined(__CC_ARM) || defined(__ARMCC_VERSION)
|
||||
#define QSPI_RAM_CODE __attribute__((section("CodeQuickAccess"), noinline))
|
||||
#elif defined(__GNUC__)
|
||||
#define QSPI_RAM_CODE __attribute__((section(".itcm.text"), noinline))
|
||||
#elif defined(__ICCARM__)
|
||||
#define QSPI_RAM_CODE __ramfunc
|
||||
#else
|
||||
#define QSPI_RAM_CODE
|
||||
#endif
|
||||
|
||||
/* ============================================================
|
||||
* External APIs
|
||||
* ============================================================ */
|
||||
int rt_qspi_flash_init(void);
|
||||
int rt_qspi_flash_read(uint32_t offset, uint8_t *buf, size_t size);
|
||||
int rt_qspi_flash_write(uint32_t offset, const uint8_t *buf, size_t size);
|
||||
int rt_qspi_flash_erase(uint32_t offset, size_t size);
|
||||
void *rt_qspi_flash_mmap(uint32_t offset, size_t size);
|
||||
|
||||
#endif /* __DRV_FLEXSPI_NOR_FLASH_H__ */
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2024, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2024-01-01 RT-Thread first version
|
||||
*/
|
||||
|
||||
#ifndef __FAL_CFG_H__
|
||||
#define __FAL_CFG_H__
|
||||
|
||||
#include <rtthread.h>
|
||||
#include <board.h>
|
||||
|
||||
extern const struct fal_flash_dev imxrt1180_nor_flash;
|
||||
|
||||
/* flash device table */
|
||||
#define FAL_FLASH_DEV_TABLE \
|
||||
{ \
|
||||
&imxrt1180_nor_flash, \
|
||||
}
|
||||
|
||||
/* ====================== Partition Configuration ========================== */
|
||||
#ifdef FAL_PART_HAS_TABLE_CFG
|
||||
|
||||
/* partition table */
|
||||
#define FAL_PART_TABLE \
|
||||
{ \
|
||||
{ FAL_PART_MAGIC_WROD, "app", "norflash0", 0, 15 * 1024 * 1024, 0 }, \
|
||||
{ FAL_PART_MAGIC_WROD, "filesystem", "norflash0", 15 * 1024 * 1024, 1 * 1024 * 1024, 0 }, \
|
||||
}
|
||||
|
||||
#endif /* FAL_PART_HAS_TABLE_CFG */
|
||||
|
||||
#endif /* __FAL_CFG_H__ */
|
||||
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2026, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2026-06-03 CoreBoxer support IMXRT1180-EVK
|
||||
*/
|
||||
|
||||
#include <rtthread.h>
|
||||
#include <rthw.h>
|
||||
#include <fal.h>
|
||||
|
||||
#include "drv_flexspi_nor_flash.h"
|
||||
|
||||
/*
|
||||
* Logging configuration
|
||||
*/
|
||||
#define LOG_TAG "fal.flash"
|
||||
#define LOG_LVL LOG_LVL_INFO
|
||||
#include <rtdbg.h>
|
||||
|
||||
/* FAL ops bridge */
|
||||
#ifdef RT_USING_FAL
|
||||
|
||||
static int _fal_init(void)
|
||||
{
|
||||
return rt_qspi_flash_init();
|
||||
}
|
||||
|
||||
static int _fal_read(long offset, rt_uint8_t *buf, size_t size)
|
||||
{
|
||||
return rt_qspi_flash_read((rt_uint32_t)offset, buf, size);
|
||||
}
|
||||
|
||||
static int _fal_write(long offset, const rt_uint8_t *buf, size_t size)
|
||||
{
|
||||
return rt_qspi_flash_write((rt_uint32_t)offset, buf, size);
|
||||
}
|
||||
|
||||
static int _fal_erase(long offset, size_t size)
|
||||
{
|
||||
return rt_qspi_flash_erase((rt_uint32_t)offset, size);
|
||||
}
|
||||
|
||||
const struct fal_flash_dev imxrt1180_nor_flash = {
|
||||
.name = "norflash0",
|
||||
.addr = QSPI_FLASH_BASE,
|
||||
.len = QSPI_FLASH_SIZE,
|
||||
.blk_size = QSPI_SECTOR_SIZE,
|
||||
.ops = { _fal_init, _fal_read, _fal_write, _fal_erase },
|
||||
.write_gran = QSPI_PAGE_SIZE,
|
||||
};
|
||||
|
||||
#endif /* RT_USING_FAL */
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "flexspi_port.h"
|
||||
#include "rtconfig.h"
|
||||
|
||||
#ifdef BSP_USING_FLEXSPI1
|
||||
#ifdef BSP_USING_OSPI_FLASH
|
||||
|
||||
#ifdef BSP_USING_DMA
|
||||
#include "fsl_flexspi_edma.h"
|
||||
|
||||
@@ -6,42 +6,105 @@
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2022-08-15 xjy198903 The first version for rt1170
|
||||
* 2026-06-03 CoreBoxer support IMXRT1180-EVK
|
||||
*/
|
||||
|
||||
#ifndef FLEXSPI_PORT_H__
|
||||
#define FLEXSPI_PORT_H__
|
||||
|
||||
#include "fsl_cache.h"
|
||||
#include <rtthread.h>
|
||||
|
||||
#if defined(BSP_USING_QSPI_FLASH_FS) && defined(BSP_USING_OSPI_FLASH)
|
||||
#error "Please enable only one of BSP_USING_QSPI_FLASH_FS or BSP_USING_OSPI_FLASH"
|
||||
#endif
|
||||
|
||||
#if defined(BSP_USING_QSPI_FLASH_FS)
|
||||
/* parameters for flexpsi peripheral */
|
||||
#define FLEXSPI1_CONTROL_BASE FLEXSPI1
|
||||
#define FLEXSPI_ROOT_CLK (400000000U) /* serial root clk: 400MHz*/
|
||||
#define FLASH_SIZE (64 * 1024) /* device size 64*1024(KB) = 64MB */
|
||||
#define FLASH_PAGE_SIZE 256
|
||||
#define SECTOR_SIZE 0x1000 /* 4K */
|
||||
|
||||
#define ARD_SEQ_NUMBER 1 /* Sequence number for AHB read command */
|
||||
#define ARD_SEQ_INDEX 0 /* Sequence ID for AHB read command */
|
||||
#define AWR_SEQ_NUMBER 0 /* Sequence number for AHB write command */
|
||||
#define AWR_SEQ_INDEX 0 /* Sequence ID for AHB write command */
|
||||
#define FLEXSPI_RX_SAMPLE_CLOCK kFLEXSPI_ReadSampleClkExternalInputFromDqsPad
|
||||
|
||||
#define FLASH_PORT kFLEXSPI_PortA1
|
||||
#define CLOCK_SRC kCLOCK_FLEXSPI2_ClockRoot_MuxOscRc400M
|
||||
#define CLOCK_DIV 2U
|
||||
#define CUSTOM_LUT_LENGTH 60U
|
||||
#define FLEXSPI1_CONTROL_BASE FLEXSPI1
|
||||
#define FLEXSPI2_CONTROL_BASE FLEXSPI2
|
||||
#define FLEXSPI_ROOT_CLK (12000000U) /* serial root clk: 12MHz*/
|
||||
#define FLASH_SIZE (16 * 1024) /* device size 16*1024(KB) = 16MB */
|
||||
#define ARD_SEQ_NUMBER 1 /* Sequence number for AHB read command */
|
||||
#define ARD_SEQ_INDEX 0 /* Sequence ID for AHB read command */
|
||||
#define AWR_SEQ_NUMBER 0 /* Sequence number for AHB write command */
|
||||
#define AWR_SEQ_INDEX 0 /* Sequence ID for AHB write command */
|
||||
#define ARD_SEQ_CMD 0xBB /* cmd for read */
|
||||
#define AWR_SEQ_CMD 0xAA /* cmd for write */
|
||||
#define FLEXSPI_RX_SAMPLE_CLOCK kFLEXSPI_ReadSampleClkLoopbackFromDqsPad
|
||||
#define FLASH_PORT kFLEXSPI_PortA1
|
||||
#define CLOCK_SRC kCLOCK_FLEXSPI1_ClockRoot_MuxOscRc24M
|
||||
#define CLOCK_DIV 2U
|
||||
#define CUSTOM_LUT_LENGTH 60U
|
||||
#define FLEXSPI1_AHB_DATA_ADDRESS (0x28000000U)
|
||||
#define FLEXSPI2_AHB_DATA_ADDRESS (0x60000000U)
|
||||
|
||||
#define COMBINATION_MODE 0U
|
||||
#define FREE_RUNNING_MODE 0U
|
||||
#define COMBINATION_MODE 0U
|
||||
#define FREE_RUNNING_MODE 0U
|
||||
|
||||
#define EXAMPLE_FLEXSPI_AMBA_BASE FlexSPI1_AMBA_BASE
|
||||
#define FLASH_PAGE_SIZE 256
|
||||
#define SECTOR_SIZE 0x1000 /* 4K */
|
||||
#define EXAMPLE_FLEXSPI_CLOCK kCLOCK_Flexspi1
|
||||
#define FLASH_PORT kFLEXSPI_PortA1
|
||||
|
||||
/* DMA related. */
|
||||
#define FLEXSPI_DMA (DMA4)
|
||||
#define FLEXSPI_DMA (DMA4)
|
||||
#define FLEXSPI_TX_DMA_REQUEST_SOURCE kDma4RequestMuxFlexSPI1Tx
|
||||
#define FLEXSPI_RX_DMA_REQUEST_SOURCE kDma4RequestMuxFlexSPI1Rx
|
||||
#define FLEXSPI_TX_DMA_CHANNEL 0U
|
||||
#define FLEXSPI_RX_DMA_CHANNEL 2U
|
||||
#define FLEXSPI_TX_DMA_CHANNEL 0U
|
||||
#define FLEXSPI_RX_DMA_CHANNEL 2U
|
||||
|
||||
#define NOR_CMD_LUT_SEQ_IDX_READ_NORMAL 7
|
||||
#define NOR_CMD_LUT_SEQ_IDX_READ_FAST 13
|
||||
#define NOR_CMD_LUT_SEQ_IDX_READ_FAST_QUAD 0
|
||||
#define NOR_CMD_LUT_SEQ_IDX_READSTATUS 1
|
||||
#define NOR_CMD_LUT_SEQ_IDX_WRITEENABLE 2
|
||||
#define NOR_CMD_LUT_SEQ_IDX_ERASESECTOR 3
|
||||
#define NOR_CMD_LUT_SEQ_IDX_PAGEPROGRAM_SINGLE 6
|
||||
#define NOR_CMD_LUT_SEQ_IDX_PAGEPROGRAM_QUAD 4
|
||||
#define NOR_CMD_LUT_SEQ_IDX_READID 8
|
||||
#define NOR_CMD_LUT_SEQ_IDX_WRITESTATUSREG 9
|
||||
#define NOR_CMD_LUT_SEQ_IDX_ENTERQPI 10
|
||||
#define NOR_CMD_LUT_SEQ_IDX_EXITQPI 11
|
||||
#define NOR_CMD_LUT_SEQ_IDX_READSTATUSREG 12
|
||||
#define NOR_CMD_LUT_SEQ_IDX_ERASECHIP 5
|
||||
|
||||
#define FLASH_QUAD_ENABLE 0x40
|
||||
#define FLASH_BUSY_STATUS_POL 1
|
||||
#define FLASH_BUSY_STATUS_OFFSET 0
|
||||
|
||||
#elif defined(BSP_USING_OSPI_FLASH)
|
||||
#include "fsl_cache.h"
|
||||
|
||||
/* parameters for flexpsi peripheral */
|
||||
#define FLEXSPI1_CONTROL_BASE FLEXSPI1
|
||||
#define FLEXSPI_ROOT_CLK (400000000U) /* serial root clk: 400MHz*/
|
||||
#define FLASH_SIZE (64 * 1024) /* device size 64*1024(KB) = 64MB */
|
||||
#define FLASH_PAGE_SIZE 256
|
||||
#define SECTOR_SIZE 0x1000 /* 4K */
|
||||
|
||||
#define ARD_SEQ_NUMBER 1 /* Sequence number for AHB read command */
|
||||
#define ARD_SEQ_INDEX 0 /* Sequence ID for AHB read command */
|
||||
#define AWR_SEQ_NUMBER 0 /* Sequence number for AHB write command */
|
||||
#define AWR_SEQ_INDEX 0 /* Sequence ID for AHB write command */
|
||||
#define FLEXSPI_RX_SAMPLE_CLOCK kFLEXSPI_ReadSampleClkExternalInputFromDqsPad
|
||||
|
||||
#define FLASH_PORT kFLEXSPI_PortA1
|
||||
#define CLOCK_SRC kCLOCK_FLEXSPI2_ClockRoot_MuxOscRc400M
|
||||
#define CLOCK_DIV 2U
|
||||
#define CUSTOM_LUT_LENGTH 60U
|
||||
#define FLEXSPI1_AHB_DATA_ADDRESS (0x28000000U)
|
||||
#define FLEXSPI2_AHB_DATA_ADDRESS (0x60000000U)
|
||||
|
||||
#define COMBINATION_MODE 0U
|
||||
#define FREE_RUNNING_MODE 0U
|
||||
|
||||
/* DMA related. */
|
||||
#define FLEXSPI_DMA (DMA4)
|
||||
#define FLEXSPI_TX_DMA_REQUEST_SOURCE kDma4RequestMuxFlexSPI1Tx
|
||||
#define FLEXSPI_RX_DMA_REQUEST_SOURCE kDma4RequestMuxFlexSPI1Rx
|
||||
#define FLEXSPI_TX_DMA_CHANNEL 0U
|
||||
#define FLEXSPI_RX_DMA_CHANNEL 2U
|
||||
|
||||
|
||||
#define NOR_CMD_LUT_SEQ_IDX_READ 0
|
||||
@@ -63,8 +126,8 @@
|
||||
So we need to ensure at any time, the FlexSPI LUT sequence 9 for the flash must
|
||||
be set to STOP command to avoid unexpected debugger behaivor.
|
||||
*/
|
||||
#define NOR_CMD_LUT_SEQ_IDX_WRITE 9
|
||||
#define NOR_CMD_LUT_SEQ_IDX_READSTATUS_OPI 10
|
||||
#define NOR_CMD_LUT_SEQ_IDX_WRITE 9
|
||||
#define NOR_CMD_LUT_SEQ_IDX_READSTATUS_OPI 10
|
||||
|
||||
#define FLASH_BUSY_STATUS_POL 1
|
||||
#define FLASH_BUSY_STATUS_OFFSET 0
|
||||
@@ -74,7 +137,7 @@
|
||||
* If cache is enabled, this example should maintain the cache to make sure
|
||||
* CPU core accesses the memory, not cache only.
|
||||
*/
|
||||
#define CACHE_MAINTAIN 1
|
||||
#define CACHE_MAINTAIN 1
|
||||
|
||||
/*${macro:end}*/
|
||||
|
||||
@@ -90,8 +153,9 @@ typedef struct _flexspi_cache_status
|
||||
} flexspi_cache_status_t;
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* FLEXSPI_PORT_H__ */
|
||||
|
||||
@@ -0,0 +1,129 @@
|
||||
/*
|
||||
* Copyright (c) 2024, sakumisu
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#ifndef CHERRYUSB_CONFIG_H
|
||||
#define CHERRYUSB_CONFIG_H
|
||||
|
||||
#include <rtthread.h>
|
||||
|
||||
/* USB common configuration */
|
||||
#define CONFIG_USB_PRINTF(...) rt_kprintf(__VA_ARGS__)
|
||||
|
||||
#if defined(BSP_CHERRYUSB_DEBUG_ENUM)
|
||||
#define CONFIG_USB_DBG_LEVEL USB_DBG_LOG
|
||||
#elif !defined(CONFIG_USB_DBG_LEVEL)
|
||||
#define CONFIG_USB_DBG_LEVEL USB_DBG_INFO
|
||||
#endif
|
||||
|
||||
#define CONFIG_USB_PRINTF_COLOR_ENABLE
|
||||
|
||||
/* USB DMA buffers are placed in NonCacheable sections on CM7. */
|
||||
#define CONFIG_USB_DCACHE_ENABLE
|
||||
|
||||
#ifdef CONFIG_USB_DCACHE_ENABLE
|
||||
#define CONFIG_USB_ALIGN_SIZE 32
|
||||
#else
|
||||
#define CONFIG_USB_ALIGN_SIZE 4
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#define USB_NOCACHE_RAM_SECTION __attribute__((section("NonCacheable,\"aw\",%nobits @")))
|
||||
#else
|
||||
#define USB_NOCACHE_RAM_SECTION __attribute__((section("NonCacheable")))
|
||||
#endif
|
||||
|
||||
/* USB device stack configuration */
|
||||
#ifndef CONFIG_USBDEV_REQUEST_BUFFER_LEN
|
||||
#define CONFIG_USBDEV_REQUEST_BUFFER_LEN 512
|
||||
#endif
|
||||
|
||||
#define CONFIG_USBDEV_ADVANCE_DESC
|
||||
|
||||
#ifndef CONFIG_USBDEV_EP0_PRIO
|
||||
#define CONFIG_USBDEV_EP0_PRIO 4
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_USBDEV_EP0_STACKSIZE
|
||||
#define CONFIG_USBDEV_EP0_STACKSIZE 2048
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_USBDEV_MSC_MAX_LUN
|
||||
#define CONFIG_USBDEV_MSC_MAX_LUN 1
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_USBDEV_MSC_MAX_BUFSIZE
|
||||
#define CONFIG_USBDEV_MSC_MAX_BUFSIZE 512
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_USBDEV_MAX_BUS
|
||||
#define CONFIG_USBDEV_MAX_BUS 1
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_USBDEV_EP_NUM
|
||||
#define CONFIG_USBDEV_EP_NUM 8
|
||||
#endif
|
||||
|
||||
/* USB host stack configuration */
|
||||
#define CONFIG_USBHOST_MAX_RHPORTS 1
|
||||
#define CONFIG_USBHOST_MAX_EXTHUBS 1
|
||||
#define CONFIG_USBHOST_MAX_EHPORTS 4
|
||||
#define CONFIG_USBHOST_MAX_INTERFACES 8
|
||||
#define CONFIG_USBHOST_MAX_INTF_ALTSETTINGS 8
|
||||
#define CONFIG_USBHOST_MAX_ENDPOINTS 4
|
||||
|
||||
#define CONFIG_USBHOST_MAX_CDC_ACM_CLASS 4
|
||||
#define CONFIG_USBHOST_MAX_HID_CLASS 4
|
||||
#define CONFIG_USBHOST_MAX_MSC_CLASS 2
|
||||
#define CONFIG_USBHOST_MAX_AUDIO_CLASS 1
|
||||
#define CONFIG_USBHOST_MAX_VIDEO_CLASS 1
|
||||
|
||||
#define CONFIG_USBHOST_DEV_NAMELEN 16
|
||||
|
||||
#ifndef CONFIG_USBHOST_PSC_PRIO
|
||||
#define CONFIG_USBHOST_PSC_PRIO 0
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_USBHOST_PSC_STACKSIZE
|
||||
#define CONFIG_USBHOST_PSC_STACKSIZE 2048
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_USBHOST_REQUEST_BUFFER_LEN
|
||||
#define CONFIG_USBHOST_REQUEST_BUFFER_LEN 512
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_USBHOST_CONTROL_TRANSFER_TIMEOUT
|
||||
#define CONFIG_USBHOST_CONTROL_TRANSFER_TIMEOUT 500
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_USBHOST_MSC_TIMEOUT
|
||||
#define CONFIG_USBHOST_MSC_TIMEOUT 5000
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_USBHOST_MAX_BUS
|
||||
#define CONFIG_USBHOST_MAX_BUS 1
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_USBHOST_PIPE_NUM
|
||||
#define CONFIG_USBHOST_PIPE_NUM 10
|
||||
#endif
|
||||
|
||||
/* EHCI port configuration */
|
||||
#define CONFIG_USB_EHCI_HCCR_OFFSET (0x100)
|
||||
#define CONFIG_USB_EHCI_FRAME_LIST_SIZE 1024
|
||||
#define CONFIG_USB_EHCI_QH_NUM CONFIG_USBHOST_PIPE_NUM
|
||||
#define CONFIG_USB_EHCI_QTD_NUM (CONFIG_USB_EHCI_QH_NUM * 3)
|
||||
#define CONFIG_USB_EHCI_ITD_NUM 4
|
||||
|
||||
#ifndef usb_phyaddr2ramaddr
|
||||
#define usb_phyaddr2ramaddr(addr) (addr)
|
||||
#endif
|
||||
|
||||
#ifndef usb_ramaddr2phyaddr
|
||||
#define usb_ramaddr2phyaddr(addr) (addr)
|
||||
#endif
|
||||
|
||||
#define CONFIG_USB_EHCI_NXP 1
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File renamed without changes.
@@ -61,18 +61,21 @@
|
||||
|
||||
/* end of rt_strnlen options */
|
||||
/* end of klibc options */
|
||||
#define RT_NAME_MAX 12
|
||||
#define RT_CPUS_NR 1
|
||||
#define RT_NAME_MAX 12
|
||||
#define RT_CPUS_NR 1
|
||||
#define RT_ALIGN_SIZE 8
|
||||
#define RT_THREAD_PRIORITY_32
|
||||
#define RT_THREAD_PRIORITY_MAX 32
|
||||
#define RT_TICK_PER_SECOND 1000
|
||||
#define RT_TICK_PER_SECOND 1000
|
||||
#define RT_USING_OVERFLOW_CHECK
|
||||
#define RT_USING_HOOK
|
||||
#define RT_HOOK_USING_FUNC_PTR
|
||||
#define RT_USING_IDLE_HOOK
|
||||
#define RT_IDLE_HOOK_LIST_SIZE 4
|
||||
#define IDLE_THREAD_STACK_SIZE 4096
|
||||
#define RT_USING_TIMER_SOFT
|
||||
#define RT_TIMER_THREAD_PRIO 4
|
||||
#define RT_TIMER_THREAD_STACK_SIZE 2048
|
||||
|
||||
/* kservice options */
|
||||
|
||||
@@ -100,10 +103,10 @@
|
||||
/* end of Memory Management */
|
||||
#define RT_USING_DEVICE
|
||||
#define RT_USING_CONSOLE
|
||||
#define RT_CONSOLEBUF_SIZE 128
|
||||
#define RT_CONSOLE_DEVICE_NAME "uart1"
|
||||
#define RT_CONSOLEBUF_SIZE 128
|
||||
#define RT_CONSOLE_DEVICE_NAME "uart12"
|
||||
#define RT_USING_CONSOLE_OUTPUT_CTL
|
||||
#define RT_VER_NUM 0x50300
|
||||
#define RT_VER_NUM 0x50300
|
||||
#define RT_BACKTRACE_LEVEL_MAX_NR 32
|
||||
/* end of RT-Thread Kernel */
|
||||
#define RT_USING_CACHE
|
||||
@@ -121,12 +124,12 @@
|
||||
#define RT_USING_COMPONENTS_INIT
|
||||
#define RT_USING_USER_MAIN
|
||||
#define RT_MAIN_THREAD_STACK_SIZE 4096
|
||||
#define RT_MAIN_THREAD_PRIORITY 10
|
||||
#define RT_MAIN_THREAD_PRIORITY 10
|
||||
#define RT_USING_MSH
|
||||
#define RT_USING_FINSH
|
||||
#define FINSH_USING_MSH
|
||||
#define FINSH_THREAD_NAME "tshell"
|
||||
#define FINSH_THREAD_PRIORITY 20
|
||||
#define FINSH_THREAD_NAME "tshell"
|
||||
#define FINSH_THREAD_PRIORITY 20
|
||||
#define FINSH_THREAD_STACK_SIZE 4096
|
||||
#define FINSH_USING_HISTORY
|
||||
#define FINSH_HISTORY_LINES 5
|
||||
@@ -145,6 +148,9 @@
|
||||
|
||||
#define RT_USING_DEVICE_IPC
|
||||
#define RT_UNAMED_PIPE_NUMBER 64
|
||||
#define RT_USING_SYSTEM_WORKQUEUE
|
||||
#define RT_SYSTEM_WORKQUEUE_STACKSIZE 2048
|
||||
#define RT_SYSTEM_WORKQUEUE_PRIORITY 23
|
||||
#define RT_USING_SERIAL
|
||||
#define RT_USING_SERIAL_V1
|
||||
#define RT_SERIAL_RB_BUFSZ 64
|
||||
@@ -159,8 +165,8 @@
|
||||
|
||||
#define RT_LIBC_USING_LIGHT_TZ_DST
|
||||
#define RT_LIBC_TZ_DEFAULT_HOUR 8
|
||||
#define RT_LIBC_TZ_DEFAULT_MIN 0
|
||||
#define RT_LIBC_TZ_DEFAULT_SEC 0
|
||||
#define RT_LIBC_TZ_DEFAULT_MIN 0
|
||||
#define RT_LIBC_TZ_DEFAULT_SEC 0
|
||||
/* end of Timezone and Daylight Saving Time */
|
||||
/* end of ISO-ANSI C layer */
|
||||
|
||||
@@ -295,10 +301,6 @@
|
||||
|
||||
/* end of Kendryte SDK */
|
||||
|
||||
/* MM32 HAL & SDK Drivers */
|
||||
|
||||
/* end of MM32 HAL & SDK Drivers */
|
||||
|
||||
/* WCH HAL & SDK Drivers */
|
||||
|
||||
/* end of WCH HAL & SDK Drivers */
|
||||
@@ -332,10 +334,6 @@
|
||||
/* FT32 HAL & SDK Drivers */
|
||||
|
||||
/* end of FT32 HAL & SDK Drivers */
|
||||
|
||||
/* NOVOSNS Drivers */
|
||||
|
||||
/* end of NOVOSNS Drivers */
|
||||
/* end of HAL & SDK Drivers */
|
||||
|
||||
/* sensors drivers */
|
||||
@@ -425,9 +423,8 @@
|
||||
|
||||
/* On-chip Peripheral Drivers */
|
||||
|
||||
#define BSP_USING_GPIO
|
||||
#define BSP_USING_LPUART
|
||||
#define BSP_USING_LPUART1
|
||||
#define BSP_USING_LPUART12
|
||||
/* end of On-chip Peripheral Drivers */
|
||||
|
||||
/* Onboard Peripheral Drivers */
|
||||
@@ -436,6 +433,7 @@
|
||||
|
||||
/* Board extended module Drivers */
|
||||
|
||||
#define BSP_LINKER_SCRIPT_RAM
|
||||
/* end of Hardware Drivers Config */
|
||||
|
||||
#endif
|
||||
@@ -20,7 +20,7 @@ if CROSS_TOOL == 'gcc':
|
||||
PLATFORM = 'gcc'
|
||||
EXEC_PATH = r'C:\Users\XXYYZZ'
|
||||
elif CROSS_TOOL == 'keil':
|
||||
PLATFORM = 'armcc'
|
||||
PLATFORM = 'armclang'
|
||||
EXEC_PATH = r'C:/Keil_v5'
|
||||
elif CROSS_TOOL == 'iar':
|
||||
PLATFORM = 'iccarm'
|
||||
@@ -29,8 +29,42 @@ elif CROSS_TOOL == 'iar':
|
||||
if os.getenv('RTT_EXEC_PATH'):
|
||||
EXEC_PATH = os.getenv('RTT_EXEC_PATH')
|
||||
|
||||
#BUILD = 'debug'
|
||||
BUILD = 'release'
|
||||
BUILD = 'debug'
|
||||
# BUILD = 'release'
|
||||
|
||||
# Read linker script selection from rtconfig.h (set by Kconfig BSP_LINKER_SCRIPT_* choice).
|
||||
# Supported types: RAM, HYPERRAM, FLEXSPI_NOR, FLEXSPI_NOR_HYPERRAM
|
||||
# Default to RAM when no match is found.
|
||||
_LINKER_SCRIPT_TYPE = 'RAM'
|
||||
_rtconfig_h = os.path.join(os.path.dirname(__file__), 'rtconfig.h')
|
||||
if os.path.exists(_rtconfig_h):
|
||||
with open(_rtconfig_h, 'r') as _f:
|
||||
for _line in _f:
|
||||
_s = _line.strip()
|
||||
if _s.startswith('//'):
|
||||
continue
|
||||
# Check the most specific name first to avoid false matches.
|
||||
if _s.startswith('#define BSP_LINKER_SCRIPT_FLEXSPI_NOR_HYPERRAM'):
|
||||
_LINKER_SCRIPT_TYPE = 'FLEXSPI_NOR_HYPERRAM'
|
||||
break
|
||||
if _s.startswith('#define BSP_LINKER_SCRIPT_FLEXSPI_NOR'):
|
||||
_LINKER_SCRIPT_TYPE = 'FLEXSPI_NOR'
|
||||
break
|
||||
if _s.startswith('#define BSP_LINKER_SCRIPT_HYPERRAM'):
|
||||
_LINKER_SCRIPT_TYPE = 'HYPERRAM'
|
||||
break
|
||||
if _s.startswith('#define BSP_LINKER_SCRIPT_RAM'):
|
||||
_LINKER_SCRIPT_TYPE = 'RAM'
|
||||
break
|
||||
|
||||
# Base filename (without extension) for the selected linker script.
|
||||
_LINKER_SCRIPT_BASE = {
|
||||
'RAM': 'MIMXRT1189xxxxx_cm7_ram',
|
||||
'HYPERRAM': 'MIMXRT1189xxxxx_cm7_hyperram',
|
||||
'FLEXSPI_NOR': 'MIMXRT1189xxxxx_cm7_flexspi_nor',
|
||||
'FLEXSPI_NOR_HYPERRAM': 'MIMXRT1189xxxxx_cm7_flexspi_nor_hyperram',
|
||||
}[_LINKER_SCRIPT_TYPE]
|
||||
|
||||
|
||||
if PLATFORM == 'gcc':
|
||||
PREFIX = 'arm-none-eabi-'
|
||||
@@ -48,7 +82,10 @@ if PLATFORM == 'gcc':
|
||||
DEVICE = ' -mcpu=' + CPU + ' -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections'
|
||||
CFLAGS = DEVICE + ' -Wall -D__FPU_PRESENT -eentry'
|
||||
AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -Wa,-mimplicit-it=thumb -D__START=entry'
|
||||
LFLAGS = DEVICE + ' -lm -lgcc -lc' + ' -nostartfiles -Wl,--gc-sections,-Map=rtthread.map,-cref,-u,Reset_Handler -T board/linker_scripts/link_ram.lds'
|
||||
|
||||
LINKER_SCRIPT = 'board/linker_scripts/' + _LINKER_SCRIPT_BASE + '.ld'
|
||||
|
||||
LFLAGS = DEVICE + ' -lm -lgcc -lc' + ' -nostartfiles -Wl,--gc-sections,-Map=rtthread.map,-cref,-u,Reset_Handler -T ' + LINKER_SCRIPT
|
||||
|
||||
CPATH = ''
|
||||
LPATH = ''
|
||||
@@ -65,7 +102,7 @@ if PLATFORM == 'gcc':
|
||||
|
||||
POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n'
|
||||
|
||||
# module setting
|
||||
# module setting
|
||||
CXXFLAGS = ' -Woverloaded-virtual -fno-exceptions -fno-rtti '
|
||||
M_CFLAGS = CFLAGS + ' -mlong-calls -fPIC '
|
||||
M_CXXFLAGS = CXXFLAGS + ' -mlong-calls -fPIC'
|
||||
@@ -84,9 +121,12 @@ elif PLATFORM == 'armcc':
|
||||
DEVICE = ' --cpu ' + CPU + '.fp.sp'
|
||||
CFLAGS = DEVICE + ' --apcs=interwork'
|
||||
AFLAGS = DEVICE
|
||||
LFLAGS = DEVICE + ' --libpath "' + EXEC_PATH + '\ARM\ARMCC\lib" --info sizes --info totals --info unused --info veneers --list rtthread.map --scatter "board/linker_scripts/link_ram.scf"'
|
||||
|
||||
LFLAGS += ' --keep *.o(.rti_fn.*) --keep *.o(FSymTab) --keep *.o(VSymTab)'
|
||||
LINKER_SCRIPT = 'board/linker_scripts/' + _LINKER_SCRIPT_BASE + '.scf'
|
||||
|
||||
LFLAGS = DEVICE + ' --libpath "' + EXEC_PATH + '\ARM\ARMCC\lib" --info sizes --info totals --info unused --info veneers --list rtthread.map --scatter "' + LINKER_SCRIPT + '"'
|
||||
|
||||
LFLAGS += ' --keep *.o(.rti_fn.*) --keep *.o(FSymTab) --keep *.o(VSymTab)'
|
||||
|
||||
CFLAGS += ' --diag_suppress=66,1296,186,6314'
|
||||
CFLAGS += ' -I' + EXEC_PATH + '/ARM/RV31/INC'
|
||||
@@ -125,9 +165,13 @@ elif PLATFORM == 'armclang':
|
||||
AFLAGS = DEVICE + ' --apcs=interwork '
|
||||
AFLAGS += ' -x assembler-with-cpp'
|
||||
AFLAGS += ' -Wa,-mimplicit-it=thumb'
|
||||
|
||||
# armlink --scatter accepts the file without extension; append .scf explicitly.
|
||||
LINKER_SCRIPT = 'board/linker_scripts/' + _LINKER_SCRIPT_BASE + '.scf'
|
||||
|
||||
LFLAGS = DEVICE + ' --info sizes --info totals --info unused --info veneers '
|
||||
LFLAGS += ' --list rt-thread.map '
|
||||
LFLAGS += r' --strict --scatter "board/linker_scripts/link_ram" '
|
||||
LFLAGS += r' --strict --scatter "' + LINKER_SCRIPT + '" '
|
||||
CFLAGS += ' -I' + EXEC_PATH + '/ARM/ARMCLANG/include'
|
||||
LFLAGS += ' --libpath=' + EXEC_PATH + '/ARM/ARMCLANG/lib'
|
||||
|
||||
@@ -138,7 +182,7 @@ elif PLATFORM == 'armclang':
|
||||
AFLAGS += ' -g'
|
||||
else:
|
||||
CFLAGS += ' -O2'
|
||||
|
||||
|
||||
CXXFLAGS = CFLAGS
|
||||
CFLAGS += ' -std=c99'
|
||||
|
||||
@@ -185,7 +229,10 @@ elif PLATFORM == 'iccarm':
|
||||
else:
|
||||
CFLAGS += ' -Oh'
|
||||
|
||||
LFLAGS = ' --config "board/linker_scripts/link_ram.icf"'
|
||||
LINKER_SCRIPT = 'board/linker_scripts/' + _LINKER_SCRIPT_BASE + '.icf'
|
||||
|
||||
LFLAGS = ' --config "' + LINKER_SCRIPT + '"'
|
||||
|
||||
LFLAGS += ' --redirect _Printf=_PrintfTiny'
|
||||
LFLAGS += ' --redirect _Scanf=_ScanfSmall'
|
||||
LFLAGS += ' --entry __iar_program_start'
|
||||
@@ -195,9 +242,43 @@ elif PLATFORM == 'iccarm':
|
||||
EXEC_PATH = EXEC_PATH + '/arm/bin/'
|
||||
POST_ACTION = 'ielftool --bin $TARGET rtthread.bin'
|
||||
|
||||
# Map from linker script type to the matching Keil target name.
|
||||
_LINKER_SCRIPT_TO_KEIL_TARGET = {
|
||||
'RAM': 'rtthread_ram',
|
||||
'HYPERRAM': 'rtthread_hyperram',
|
||||
'FLEXSPI_NOR': 'rtthread_flexspi_nor',
|
||||
'FLEXSPI_NOR_HYPERRAM': 'rtthread_flexspi_nor_hyperram',
|
||||
}
|
||||
|
||||
def update_keil_active_target(uvoptx_path='project.uvoptx'):
|
||||
"""Set <IsCurrentTarget> in project.uvoptx to match the selected linker script."""
|
||||
import xml.etree.ElementTree as etree
|
||||
|
||||
active = _LINKER_SCRIPT_TO_KEIL_TARGET.get(_LINKER_SCRIPT_TYPE, 'rtthread_ram')
|
||||
|
||||
if not os.path.exists(uvoptx_path):
|
||||
return
|
||||
|
||||
tree = etree.parse(uvoptx_path)
|
||||
root = tree.getroot()
|
||||
|
||||
for tgt in tree.findall('Target'):
|
||||
tname = tgt.find('TargetName')
|
||||
is_current = tgt.find('TargetOption/OPTFL/IsCurrentTarget')
|
||||
if tname is not None and is_current is not None:
|
||||
is_current.text = '1' if tname.text == active else '0'
|
||||
|
||||
out = open(uvoptx_path, 'w')
|
||||
out.write('<?xml version="1.0" encoding="UTF-8" standalone="no" ?>\n')
|
||||
out.write(etree.tostring(root, encoding='utf-8').decode())
|
||||
out.close()
|
||||
|
||||
print('Keil active target set to: ' + active)
|
||||
|
||||
def dist_handle(BSP_ROOT, dist_dir):
|
||||
import sys
|
||||
cwd_path = os.getcwd()
|
||||
# sys.path.append(os.path.join(os.path.dirname(BSP_ROOT), 'tools'))
|
||||
sys.path.append(os.path.join(os.path.dirname(os.path.dirname(BSP_ROOT)), 'tools'))
|
||||
from sdk_dist import dist_do_building
|
||||
dist_do_building(BSP_ROOT, dist_dir)
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -52,9 +52,12 @@ if GetDepend('BSP_USING_LCD'):
|
||||
src += ['drv_lcd.c']
|
||||
|
||||
if GetDepend('BSP_USING_ETH'):
|
||||
src += ['drv_eth.c']
|
||||
if GetDepend('SOC_IMXRT1180_SERIES'):
|
||||
src += ['drv_netc.c']
|
||||
else:
|
||||
src += ['drv_eth.c']
|
||||
|
||||
if GetDepend('BSP_USING_PHY'):
|
||||
if GetDepend('BSP_USING_PHY') and not GetDepend('SOC_IMXRT1180_SERIES'):
|
||||
src += ['drv_mdio.c']
|
||||
if GetDepend('PHY_USING_KSZ8081'):
|
||||
src += ['drv_ksz8081.c']
|
||||
|
||||
@@ -258,7 +258,7 @@ static void flexspi_clock_init(clock_root_t root, uint8_t src, uint8_t div)
|
||||
CLOCK_SetRootClockMux(root, src);
|
||||
}
|
||||
|
||||
FLEXSPI_RAM_CODE static int rt_hw_imxrt_flexspi_init(void)
|
||||
static int rt_hw_imxrt_flexspi_init(void)
|
||||
{
|
||||
flexspi_config_t config;
|
||||
FLEXSPI_Type *base;
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -371,10 +371,22 @@ static void uart_isr(struct imxrt_uart *uart)
|
||||
LPUART_ClearStatusFlags(uart->uart_base, kLPUART_RxOverrunFlag);
|
||||
}
|
||||
|
||||
if (LPUART_GetStatusFlags(uart->uart_base) & kLPUART_TxDataRegEmptyFlag)
|
||||
if ((LPUART_GetStatusFlags(uart->uart_base) & kLPUART_TxDataRegEmptyFlag) &&
|
||||
(LPUART_GetEnabledInterrupts(uart->uart_base) & kLPUART_TxDataRegEmptyInterruptEnable))
|
||||
{
|
||||
LPUART_DisableInterrupts(uart->uart_base, kLPUART_TxDataRegEmptyInterruptEnable);
|
||||
rt_hw_serial_isr(&uart->serial, RT_SERIAL_EVENT_TX_DONE);
|
||||
/* Feed the next byte from the Serial V2 ring buffer into the TX register.
|
||||
* If the ring buffer is empty, disable the TX interrupt and signal TX_DONE
|
||||
* so the Serial V2 framework can unblock the waiting writer. */
|
||||
uint8_t tx_ch;
|
||||
if (rt_hw_serial_control_isr(&uart->serial, RT_HW_SERIAL_CTRL_GETC, &tx_ch) == RT_EOK)
|
||||
{
|
||||
LPUART_WriteByte(uart->uart_base, tx_ch);
|
||||
}
|
||||
else
|
||||
{
|
||||
LPUART_DisableInterrupts(uart->uart_base, kLPUART_TxDataRegEmptyInterruptEnable);
|
||||
rt_hw_serial_isr(&uart->serial, RT_SERIAL_EVENT_TX_DONE);
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(RT_SERIAL_USING_DMA) && defined(BSP_USING_DMA)
|
||||
@@ -690,7 +702,11 @@ static rt_err_t imxrt_control(struct rt_serial_device *serial, int cmd, void *ar
|
||||
}
|
||||
if (RT_DEVICE_FLAG_TX_BLOCKING == ctrl_arg || RT_DEVICE_FLAG_TX_NON_BLOCKING == ctrl_arg)
|
||||
{
|
||||
LPUART_EnableInterrupts(uart->uart_base, kLPUART_TxDataRegEmptyInterruptEnable);
|
||||
/* Do NOT enable kLPUART_TxDataRegEmptyInterruptEnable here: TX reg is already
|
||||
* empty at open time, enabling it now would fire an immediate spurious TX_DONE
|
||||
* event and corrupt the Serial V2 TX state machine (especially visible on CM7
|
||||
* where IRQ latency is very short). The TX interrupt is enabled on demand by
|
||||
* imxrt_transmit() when size == 0 (Serial V2 "kick TX" convention). */
|
||||
NVIC_SetPriority(uart->irqn, NVIC_EncodePriority(NVIC_GetPriorityGrouping(), 4, 0));
|
||||
EnableIRQ(uart->irqn);
|
||||
break;
|
||||
@@ -738,7 +754,6 @@ static int imxrt_getc(struct rt_serial_device *serial)
|
||||
return ch;
|
||||
}
|
||||
|
||||
#if defined(RT_SERIAL_USING_DMA) && defined(BSP_USING_DMA)
|
||||
static rt_ssize_t imxrt_transmit(struct rt_serial_device *serial,
|
||||
rt_uint8_t *buf, rt_size_t size, rt_uint32_t tx_flag)
|
||||
{
|
||||
@@ -747,6 +762,7 @@ static rt_ssize_t imxrt_transmit(struct rt_serial_device *serial,
|
||||
RT_ASSERT(serial != RT_NULL);
|
||||
uart = rt_container_of(serial, struct imxrt_uart, serial);
|
||||
|
||||
#if defined(RT_SERIAL_USING_DMA) && defined(BSP_USING_DMA)
|
||||
if (uart->dma_flag & RT_DEVICE_FLAG_DMA_TX)
|
||||
{
|
||||
lpuart_transfer_t xfer;
|
||||
@@ -757,37 +773,23 @@ static rt_ssize_t imxrt_transmit(struct rt_serial_device *serial,
|
||||
return (rt_ssize_t)size;
|
||||
return -RT_EIO;
|
||||
}
|
||||
|
||||
if (size == 0)
|
||||
{
|
||||
LPUART_EnableInterrupts(uart->uart_base, kLPUART_TxDataRegEmptyInterruptEnable);
|
||||
return 0;
|
||||
}
|
||||
|
||||
{
|
||||
rt_uint8_t *ptr = buf;
|
||||
while (size--)
|
||||
{
|
||||
LPUART_WriteByte(uart->uart_base, *ptr++);
|
||||
while (!(LPUART_GetStatusFlags(uart->uart_base) & kLPUART_TxDataRegEmptyFlag))
|
||||
;
|
||||
}
|
||||
return (rt_ssize_t)(ptr - buf);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* Interrupt TX path: the Serial V2 framework has already placed data into the
|
||||
* TX ring buffer before calling transmit(). Enable the TX-empty interrupt so
|
||||
* uart_isr will drain the ring buffer byte by byte via RT_HW_SERIAL_CTRL_GETC
|
||||
* and fire RT_SERIAL_EVENT_TX_DONE when the buffer is empty.
|
||||
* Return size immediately so the framework knows the transfer was accepted. */
|
||||
LPUART_EnableInterrupts(uart->uart_base, kLPUART_TxDataRegEmptyInterruptEnable);
|
||||
return (rt_ssize_t)size;
|
||||
}
|
||||
|
||||
static const struct rt_uart_ops imxrt_uart_ops = {
|
||||
imxrt_configure,
|
||||
imxrt_control,
|
||||
imxrt_putc,
|
||||
imxrt_getc,
|
||||
#if defined(RT_SERIAL_USING_DMA) && defined(BSP_USING_DMA)
|
||||
imxrt_transmit,
|
||||
#else
|
||||
RT_NULL
|
||||
#endif
|
||||
};
|
||||
|
||||
int rt_hw_uart_init(void)
|
||||
|
||||
Reference in new issue
Block a user