From 0566f813e8b4edf898e43e4bda34ef635e1cf953 Mon Sep 17 00:00:00 2001 From: yandld <1453363089@qq.com> Date: Wed, 20 Aug 2025 18:31:06 +0800 Subject: [PATCH 1/3] update nxp mcxa driver to support frdm-mcxa346 --- bsp/nxp/mcx/mcxa/Libraries/drivers/drv_adc.c | 4 + bsp/nxp/mcx/mcxa/Libraries/drivers/drv_i2c.c | 65 +++- bsp/nxp/mcx/mcxa/Libraries/drivers/drv_pin.c | 16 +- bsp/nxp/mcx/mcxa/Libraries/drivers/drv_rtc.c | 278 ++++++++++++++++++ bsp/nxp/mcx/mcxa/Libraries/drivers/drv_rtc.h | 0 bsp/nxp/mcx/mcxa/Libraries/drivers/drv_spi.c | 85 ++---- bsp/nxp/mcx/mcxa/Libraries/drivers/drv_uart.c | 4 + 7 files changed, 386 insertions(+), 66 deletions(-) create mode 100644 bsp/nxp/mcx/mcxa/Libraries/drivers/drv_rtc.c create mode 100644 bsp/nxp/mcx/mcxa/Libraries/drivers/drv_rtc.h diff --git a/bsp/nxp/mcx/mcxa/Libraries/drivers/drv_adc.c b/bsp/nxp/mcx/mcxa/Libraries/drivers/drv_adc.c index 94c56fb6725..a2a8987f9f3 100644 --- a/bsp/nxp/mcx/mcxa/Libraries/drivers/drv_adc.c +++ b/bsp/nxp/mcx/mcxa/Libraries/drivers/drv_adc.c @@ -14,6 +14,10 @@ #include "fsl_lpadc.h" #include "fsl_spc.h" +#define DBG_TAG "drv.adc" +#define DBG_LVL DBG_INFO +#include + #ifdef RT_USING_ADC #define DEFAULT_HW_AVG (kLPADC_HardwareAverageCount4) diff --git a/bsp/nxp/mcx/mcxa/Libraries/drivers/drv_i2c.c b/bsp/nxp/mcx/mcxa/Libraries/drivers/drv_i2c.c index 5f79a1828f5..a38ce1a4701 100644 --- a/bsp/nxp/mcx/mcxa/Libraries/drivers/drv_i2c.c +++ b/bsp/nxp/mcx/mcxa/Libraries/drivers/drv_i2c.c @@ -16,16 +16,27 @@ #ifdef RT_USING_I2C +#define DBG_TAG "drv.i2c" +#define DBG_LVL DBG_INFO +#include + enum { #ifdef BSP_USING_I2C0 I2C0_INDEX, #endif +#ifdef BSP_USING_I2C1 + I2C1_INDEX, +#endif +#ifdef BSP_USING_I2C2 + I2C2_INDEX, +#endif +#ifdef BSP_USING_I2C3 + I2C3_INDEX, +#endif }; -#define i2c_dbg rt_kprintf - struct lpc_i2c_bus { struct rt_i2c_bus_device parent; @@ -44,12 +55,58 @@ struct lpc_i2c_bus lpc_obj[] = { .I2C = LPI2C0, .baud = 100000U, +#if (defined(CPU_MCXA346VLH) || defined(CPU_MCXA346VLL) || defined(CPU_MCXA346VLQ) || defined(CPU_MCXA346VPN)) + .clock_attach_id = kFRO_LF_DIV_to_LPI2C0, +#else .clock_attach_id = kFRO12M_to_LPI2C0, +#endif .clock_div_name = kCLOCK_DivLPI2C0, .clock_src = kCLOCK_Fro12M, .name = "i2c0", }, #endif +#ifdef BSP_USING_I2C1 + { + .I2C = LPI2C1, + .baud = 100000U, +#if (defined(CPU_MCXA346VLH) || defined(CPU_MCXA346VLL) || defined(CPU_MCXA346VLQ) || defined(CPU_MCXA346VPN)) + .clock_attach_id = kFRO_LF_DIV_to_LPI2C1, +#else + .clock_attach_id = kFRO12M_to_LPI2C1, +#endif + .clock_div_name = kCLOCK_DivLPI2C1, + .clock_src = kCLOCK_Fro12M, + .name = "i2c1", + }, +#endif +#ifdef BSP_USING_I2C2 + { + .I2C = LPI2C2, + .baud = 100000U, +#if (defined(CPU_MCXA346VLH) || defined(CPU_MCXA346VLL) || defined(CPU_MCXA346VLQ) || defined(CPU_MCXA346VPN)) + .clock_attach_id = kFRO_LF_DIV_to_LPI2C2, +#else + .clock_attach_id = kFRO12M_to_LPI2C2, +#endif + .clock_div_name = kCLOCK_DivLPI2C2, + .clock_src = kCLOCK_Fro12M, + .name = "i2c2", + }, +#endif +#ifdef BSP_USING_I2C3 + { + .I2C = LPI2C3, + .baud = 100000U, +#if (defined(CPU_MCXA346VLH) || defined(CPU_MCXA346VLL) || defined(CPU_MCXA346VLQ) || defined(CPU_MCXA346VPN)) + .clock_attach_id = kFRO_LF_DIV_to_LPI2C3, +#else + .clock_attach_id = kFRO12M_to_LPI2C3, +#endif + .clock_div_name = kCLOCK_DivLPI2C3, + .clock_src = kCLOCK_Fro12M, + .name = "i2c3", + }, +#endif }; static rt_ssize_t lpc_i2c_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) @@ -80,7 +137,7 @@ static rt_ssize_t lpc_i2c_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg if (LPI2C_MasterTransferBlocking(lpc_i2c->I2C, &xfer) != kStatus_Success) { - i2c_dbg("i2c bus read failed!\n"); + LOG_D("i2c bus read failed!\n"); return i; } } @@ -99,7 +156,7 @@ static rt_ssize_t lpc_i2c_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg if (LPI2C_MasterTransferBlocking(lpc_i2c->I2C, &xfer) != kStatus_Success) { - i2c_dbg("i2c bus write failed!\n"); + LOG_D("i2c bus write failed!\n"); return i; } } diff --git a/bsp/nxp/mcx/mcxa/Libraries/drivers/drv_pin.c b/bsp/nxp/mcx/mcxa/Libraries/drivers/drv_pin.c index 115754fce7d..3870e6f5da8 100644 --- a/bsp/nxp/mcx/mcxa/Libraries/drivers/drv_pin.c +++ b/bsp/nxp/mcx/mcxa/Libraries/drivers/drv_pin.c @@ -17,22 +17,25 @@ #ifdef RT_USING_PIN +#define DBG_TAG "drv.pin" +#define DBG_LVL DBG_INFO +#include #define GET_GPIO_PORT(x) ((x) / 32) #define GET_GPIO_PIN(x) ((x) % 32) static struct rt_pin_ops mcx_pin_ops; -static GPIO_Type *GPIO_TYPE_TBL[] = {GPIO0, GPIO1, GPIO2, GPIO3}; -static PORT_Type *PORT_TYPE_TBL[] = {PORT0, PORT1, PORT2, PORT3}; -static IRQn_Type IRQ_TYPE_TBL[] = {GPIO0_IRQn, GPIO1_IRQn, GPIO2_IRQn, GPIO3_IRQn}; +static GPIO_Type *GPIO_TYPE_TBL[] = GPIO_BASE_PTRS; +static PORT_Type *PORT_TYPE_TBL[] = PORT_BASE_PTRS; +static IRQn_Type IRQ_TYPE_TBL[] = GPIO_IRQS; #define PIN2GPIO(x) GPIO_TYPE_TBL[GET_GPIO_PORT(x)] #define PIN2PORT(x) PORT_TYPE_TBL[GET_GPIO_PORT(x)] #define PIN2IRQ(x) IRQ_TYPE_TBL[GET_GPIO_PORT(x)] -struct rt_pin_irq_hdr pin_irq_hdr_tab[32*4] = {0}; +struct rt_pin_irq_hdr pin_irq_hdr_tab[32*5] = {0}; static void mcx_pin_mode(rt_device_t dev, rt_base_t pin, rt_uint8_t mode) { @@ -143,6 +146,11 @@ void GPIO3_IRQHandler(void) pin_irq_handler(3); } +void GPIO4_IRQHandler(void) +{ + pin_irq_handler(4); +} + static rt_err_t mcx_pin_attach_irq(struct rt_device *device, rt_base_t pin, rt_uint8_t mode, void (*hdr)(void *args), void *args) { diff --git a/bsp/nxp/mcx/mcxa/Libraries/drivers/drv_rtc.c b/bsp/nxp/mcx/mcxa/Libraries/drivers/drv_rtc.c new file mode 100644 index 00000000000..374296cdd39 --- /dev/null +++ b/bsp/nxp/mcx/mcxa/Libraries/drivers/drv_rtc.c @@ -0,0 +1,278 @@ +/* + * Copyright (c) 2006-2025, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2025-08-19 Alex Yang Add MCXA346 RTC driver for RT-Thread + */ + +#include +#include +#include + +#ifdef BSP_USING_RTC + +#define DBG_TAG "drv.rtc" +#define DBG_LVL DBG_INFO +#include + +#include "fsl_rtc.h" +#include "fsl_clock.h" + + +/* Get RTC timestamp */ +static time_t get_rtc_timestamp(void) +{ + rtc_datetime_t datetime; + struct tm tm_new; + + /* Get current time from RTC */ + RTC_GetDatetime(RTC0, &datetime); + + tm_new.tm_sec = datetime.second; + tm_new.tm_min = datetime.minute; + tm_new.tm_hour = datetime.hour; + tm_new.tm_mday = datetime.day; + tm_new.tm_mon = datetime.month - 1; + tm_new.tm_year = datetime.year - 1900; + tm_new.tm_isdst = 0; + + LOG_D("get rtc time: %04d-%02d-%02d %02d:%02d:%02d", + datetime.year, datetime.month, datetime.day, + datetime.hour, datetime.minute, datetime.second); + + return mktime(&tm_new); +} + +/* Set RTC timestamp */ +static rt_err_t set_rtc_time_stamp(time_t time_stamp) +{ + rtc_datetime_t datetime; + struct tm *time_tm; + + time_tm = gmtime(&time_stamp); + if (time_tm->tm_year < 70) /* Year should be >= 1970 */ + { + LOG_E("Invalid year: %d", time_tm->tm_year + 1900); + return -RT_ERROR; + } + + /* Convert to RTC datetime format */ + datetime.year = time_tm->tm_year + 1900; + datetime.month = time_tm->tm_mon + 1; + datetime.day = time_tm->tm_mday; + datetime.hour = time_tm->tm_hour; + datetime.minute = time_tm->tm_min; + datetime.second = time_tm->tm_sec; + + /* Set RTC time */ + RTC_StopTimer(RTC0); + + RTC_SetDatetime(RTC0, &datetime); + + RTC_StartTimer(RTC0); + + LOG_D("set rtc time: %04d-%02d-%02d %02d:%02d:%02d", + datetime.year, datetime.month, datetime.day, + datetime.hour, datetime.minute, datetime.second); + + return RT_EOK; +} + +/* RTC configuration */ +static rt_err_t rt_rtc_config(void) +{ + rtc_config_t rtc_config; + + /* Get default RTC configuration */ + RTC_GetDefaultConfig(&rtc_config); + + /* Initialize RTC - Note: RTC_Init returns void, not status */ + RTC_Init(RTC0, &rtc_config); + + /* Start RTC timer */ + RTC_StartTimer(RTC0); + + return RT_EOK; +} + +/* RTC initialization */ +static rt_err_t _rtc_init(void) +{ + + /* Configure RTC */ + if (rt_rtc_config() != RT_EOK) + { + LOG_E("RTC config failed."); + return -RT_ERROR; + } + + LOG_D("RTC initialized successfully"); + return RT_EOK; +} + +/* Get RTC seconds */ +static rt_err_t _rtc_get_secs(time_t *args) +{ + RT_ASSERT(args != RT_NULL); + + *args = get_rtc_timestamp(); + LOG_D("RTC: get rtc_time %x", *args); + + return RT_EOK; +} + +/* Set RTC seconds */ +static rt_err_t _rtc_set_secs(time_t *args) +{ + rt_err_t result = RT_EOK; + + RT_ASSERT(args != RT_NULL); + + if (set_rtc_time_stamp(*args) != RT_EOK) + { + result = -RT_ERROR; + } + LOG_D("RTC: set rtc_time %x", *args); + + return result; +} + +/* Get RTC alarm */ +static rt_err_t _rtc_get_alarm(struct rt_rtc_wkalarm *wkalarm) +{ + rtc_datetime_t datetime; + + RT_ASSERT(wkalarm != RT_NULL); + + /* Get alarm time from RTC */ + RTC_GetAlarm(RTC0, &datetime); + + /* Convert to wkalarm format */ + wkalarm->tm_sec = datetime.second; + wkalarm->tm_min = datetime.minute; + wkalarm->tm_hour = datetime.hour; + wkalarm->tm_mday = datetime.day; + wkalarm->tm_mon = datetime.month - 1; + wkalarm->tm_year = datetime.year - 1900; + + /* Check if alarm is enabled */ + wkalarm->enable = (RTC_GetEnabledInterrupts(RTC0) & kRTC_AlarmInterruptEnable) ? 1 : 0; + + LOG_D("RTC: get alarm %04d-%02d-%02d %02d:%02d:%02d (%s)", + datetime.year, datetime.month, datetime.day, + datetime.hour, datetime.minute, datetime.second, + wkalarm->enable ? "ENABLED" : "DISABLED"); + + return RT_EOK; +} + +/* Set RTC alarm */ +static rt_err_t _rtc_set_alarm(struct rt_rtc_wkalarm *wkalarm) +{ + rtc_datetime_t datetime; + + RT_ASSERT(wkalarm != RT_NULL); + + /* Convert from wkalarm format */ + datetime.year = wkalarm->tm_year + 1900; + datetime.month = wkalarm->tm_mon + 1; + datetime.day = wkalarm->tm_mday; + datetime.hour = wkalarm->tm_hour; + datetime.minute = wkalarm->tm_min; + datetime.second = wkalarm->tm_sec; + + /* Set alarm time */ + RTC_SetAlarm(RTC0, &datetime); + + /* Enable/disable alarm interrupt */ + if (wkalarm->enable) + { + RTC_EnableInterrupts(RTC0, kRTC_AlarmInterruptEnable); + EnableIRQ(RTC_IRQn); /* Use RTC_IRQn instead of RTC0_IRQn */ + LOG_D("RTC alarm enabled"); + } + else + { + RTC_DisableInterrupts(RTC0, kRTC_AlarmInterruptEnable); + LOG_D("RTC alarm disabled"); + } + + LOG_D("RTC: set alarm %04d-%02d-%02d %02d:%02d:%02d", + datetime.year, datetime.month, datetime.day, + datetime.hour, datetime.minute, datetime.second); + + return RT_EOK; +} + +/* RTC operations structure */ +static const struct rt_rtc_ops _rtc_ops = +{ + _rtc_init, + _rtc_get_secs, + _rtc_set_secs, + _rtc_get_alarm, + _rtc_set_alarm, + RT_NULL, /* get_timeval */ + RT_NULL, /* set_timeval */ +}; + +static rt_rtc_dev_t mcxa_rtc_dev; + +/* RTC interrupt handler */ +void RTC_IRQHandler(void) +{ + rt_interrupt_enter(); + + /* Get interrupt status */ + uint32_t status = RTC_GetStatusFlags(RTC0); + + /* Handle alarm interrupt */ + if (status & kRTC_AlarmFlag) + { + /* Clear alarm flag */ + RTC_ClearStatusFlags(RTC0, kRTC_AlarmFlag); + + LOG_D("RTC alarm triggered"); + + /* If alarm framework is available, notify it */ +#ifdef RT_USING_ALARM + /* Send alarm event to alarm thread */ + rt_event_send(&_container.event, 1); +#endif + } + + /* Handle seconds interrupt if needed */ + if (status & kRTC_SecondsInterruptEnable) + { + LOG_D("RTC seconds interrupt"); + } + + rt_interrupt_leave(); +} + +/* Hardware RTC initialization */ +int rt_hw_rtc_init(void) +{ + rt_err_t result; + + /* Set RTC operations */ + mcxa_rtc_dev.ops = &_rtc_ops; + + /* Register RTC device */ + result = rt_hw_rtc_register(&mcxa_rtc_dev, "rtc", RT_DEVICE_FLAG_RDWR, RT_NULL); + if (result != RT_EOK) + { + LOG_E("RTC register failed, err code: %d", result); + return result; + } + + LOG_D("RTC init success"); + return RT_EOK; +} + +INIT_DEVICE_EXPORT(rt_hw_rtc_init); + +#endif /* BSP_USING_RTC */ diff --git a/bsp/nxp/mcx/mcxa/Libraries/drivers/drv_rtc.h b/bsp/nxp/mcx/mcxa/Libraries/drivers/drv_rtc.h new file mode 100644 index 00000000000..e69de29bb2d diff --git a/bsp/nxp/mcx/mcxa/Libraries/drivers/drv_spi.c b/bsp/nxp/mcx/mcxa/Libraries/drivers/drv_spi.c index c93a69cc77b..bace75a19e3 100644 --- a/bsp/nxp/mcx/mcxa/Libraries/drivers/drv_spi.c +++ b/bsp/nxp/mcx/mcxa/Libraries/drivers/drv_spi.c @@ -10,9 +10,13 @@ #include "rtdevice.h" #include "drv_spi.h" #include "fsl_lpspi.h" -#include "fsl_lpspi_edma.h" -#define DMA_MAX_TRANSFER_SIZE (32767) + +#ifdef RT_USING_SPI + +#define DBG_TAG "drv.spi" +#define DBG_LVL DBG_INFO +#include enum { @@ -32,14 +36,6 @@ struct lpc_spi clock_div_name_t clock_div_name; clock_name_t clock_name; - DMA_Type *DMAx; - uint8_t tx_dma_chl; - uint8_t rx_dma_chl; - edma_handle_t dma_tx_handle; - edma_handle_t dma_rx_handle; - dma_request_source_t tx_dma_request; - dma_request_source_t rx_dma_request; - lpspi_master_edma_handle_t spi_dma_handle; rt_sem_t sem; char *name; @@ -50,28 +46,26 @@ static struct lpc_spi lpc_obj[] = #ifdef BSP_USING_SPI0 { .LPSPIx = LPSPI0, +#if (defined(CPU_MCXA346VLH) || defined(CPU_MCXA346VLL) || defined(CPU_MCXA346VLQ) || defined(CPU_MCXA346VPN)) + kFRO_LF_DIV_to_LPSPI0, +#else .clock_attach_id = kFRO12M_to_LPSPI0, +#endif .clock_div_name = kCLOCK_DivLPSPI0, .clock_name = kCLOCK_Fro12M, - .tx_dma_request = kDma0RequestLPSPI0Tx, - .rx_dma_request = kDma0RequestLPSPI0Rx, - .DMAx = DMA0, - .tx_dma_chl = 0, - .rx_dma_chl = 1, .name = "spi0", }, #endif #ifdef BSP_USING_SPI1 { .LPSPIx = LPSPI1, +#if (defined(CPU_MCXA346VLH) || defined(CPU_MCXA346VLL) || defined(CPU_MCXA346VLQ) || defined(CPU_MCXA346VPN)) + kFRO_LF_DIV_to_LPSPI1, +#else .clock_attach_id = kFRO12M_to_LPSPI1, +#endif .clock_div_name = kCLOCK_DivLPSPI1, .clock_name = kCLOCK_Fro12M, - .tx_dma_request = kDma0RequestLPSPI1Tx, - .rx_dma_request = kDma0RequestLPSPI1Rx, - .DMAx = DMA0, - .tx_dma_chl = 0, - .rx_dma_chl = 1, .name = "spi1", }, #endif @@ -93,17 +87,12 @@ static rt_err_t spi_configure(struct rt_spi_device *device, struct rt_spi_config return RT_EOK; } -static void LPSPI_MasterUserCallback(LPSPI_Type *base, lpspi_master_edma_handle_t *handle, status_t status, void *userData) -{ - struct lpc_spi *spi = (struct lpc_spi *)userData; - rt_sem_release(spi->sem); -} static rt_ssize_t spixfer(struct rt_spi_device *device, struct rt_spi_message *message) { - int i; lpspi_transfer_t transfer = {0}; + status_t status; RT_ASSERT(device != RT_NULL); RT_ASSERT(device->bus != RT_NULL); @@ -119,40 +108,25 @@ static rt_ssize_t spixfer(struct rt_spi_device *device, struct rt_spi_message *m transfer.dataSize = message->length; transfer.rxData = (uint8_t *)(message->recv_buf); transfer.txData = (uint8_t *)(message->send_buf); + transfer.configFlags = kLPSPI_MasterPcs0; - /* if(message->length < MAX_DMA_TRANSFER_SIZE)*/ - uint32_t block, remain; - block = message->length / DMA_MAX_TRANSFER_SIZE; - remain = message->length % DMA_MAX_TRANSFER_SIZE; - - for (i = 0; i < block; i++) - { - transfer.dataSize = DMA_MAX_TRANSFER_SIZE; - if (message->recv_buf) transfer.rxData = (uint8_t *)(message->recv_buf + i *DMA_MAX_TRANSFER_SIZE); - if (message->send_buf) transfer.txData = (uint8_t *)(message->send_buf + i *DMA_MAX_TRANSFER_SIZE); - - LPSPI_MasterTransferEDMA(spi->LPSPIx, &spi->spi_dma_handle, &transfer); - rt_sem_take(spi->sem, RT_WAITING_FOREVER); - } + // Use blocking transfer instead of DMA + status = LPSPI_MasterTransferBlocking(spi->LPSPIx, &transfer); - if (remain) + if (message->cs_release) { - transfer.dataSize = remain; - if (message->recv_buf) transfer.rxData = (uint8_t *)(message->recv_buf + i *DMA_MAX_TRANSFER_SIZE); - if (message->send_buf) transfer.txData = (uint8_t *)(message->send_buf + i *DMA_MAX_TRANSFER_SIZE); - - LPSPI_MasterTransferEDMA(spi->LPSPIx, &spi->spi_dma_handle, &transfer); - rt_sem_take(spi->sem, RT_WAITING_FOREVER); + rt_pin_write(device->cs_pin, PIN_HIGH); } - if (message->cs_release) + if (status != kStatus_Success) { - rt_pin_write(device->cs_pin, PIN_HIGH); + return 0; // Transfer failed } return message->length; } + static struct rt_spi_ops lpc_spi_ops = { .configure = spi_configure, @@ -173,23 +147,18 @@ int rt_hw_spi_init(void) lpspi_master_config_t masterConfig; LPSPI_MasterGetDefaultConfig(&masterConfig); - masterConfig.baudRate = 1 * 1000 * 1000; + masterConfig.baudRate = 10 * 1000 * 1000; masterConfig.pcsToSckDelayInNanoSec = 1000000000U / masterConfig.baudRate * 1U; masterConfig.lastSckToPcsDelayInNanoSec = 1000000000U / masterConfig.baudRate * 1U; masterConfig.betweenTransferDelayInNanoSec = 1000000000U / masterConfig.baudRate * 1U; LPSPI_MasterInit(lpc_obj[i].LPSPIx, &masterConfig, CLOCK_GetFreq(lpc_obj[i].clock_name)); - EDMA_CreateHandle(&lpc_obj[i].dma_tx_handle, lpc_obj[i].DMAx, lpc_obj[i].tx_dma_chl); - EDMA_CreateHandle(&lpc_obj[i].dma_rx_handle, lpc_obj[i].DMAx, lpc_obj[i].rx_dma_chl); - - EDMA_SetChannelMux(lpc_obj[i].DMAx, lpc_obj[i].tx_dma_chl, lpc_obj[i].tx_dma_request); - EDMA_SetChannelMux(lpc_obj[i].DMAx, lpc_obj[i].rx_dma_chl, lpc_obj[i].rx_dma_request); - - LPSPI_MasterTransferCreateHandleEDMA(lpc_obj[i].LPSPIx, &lpc_obj[i].spi_dma_handle, LPSPI_MasterUserCallback, &lpc_obj[i], &lpc_obj[i].dma_rx_handle, &lpc_obj[i].dma_tx_handle); - rt_spi_bus_register(&lpc_obj[i].parent, lpc_obj[i].name, &lpc_spi_ops); } return RT_EOK; } INIT_DEVICE_EXPORT(rt_hw_spi_init); + +#endif /* RT_USING_SPI */ + diff --git a/bsp/nxp/mcx/mcxa/Libraries/drivers/drv_uart.c b/bsp/nxp/mcx/mcxa/Libraries/drivers/drv_uart.c index 4c0e4cb414a..9f9969940fd 100644 --- a/bsp/nxp/mcx/mcxa/Libraries/drivers/drv_uart.c +++ b/bsp/nxp/mcx/mcxa/Libraries/drivers/drv_uart.c @@ -14,6 +14,10 @@ #ifdef RT_USING_SERIAL +#define DBG_TAG "drv.uart" +#define DBG_LVL DBG_INFO +#include + struct mcx_uart { struct rt_serial_device *serial; From d75ba0fb47c125e20845cf54837a92d37c5533fc Mon Sep 17 00:00:00 2001 From: yandld <1453363089@qq.com> Date: Wed, 20 Aug 2025 18:31:29 +0800 Subject: [PATCH 2/3] update NXP bsp README --- bsp/nxp/README.md | 45 +++++++++++++++++++++++++++++++++++++++------ 1 file changed, 39 insertions(+), 6 deletions(-) diff --git a/bsp/nxp/README.md b/bsp/nxp/README.md index ef482df7794..aa7f37dc035 100644 --- a/bsp/nxp/README.md +++ b/bsp/nxp/README.md @@ -1,8 +1,41 @@ -# NXP BSP 说明 +# NXP BSP 支持说明 -存放RT-Thread NXP BSP目录,目前支持MCX系列,之前一些老的IC支持(如LPC/Kinetis/I.MXRT)会逐步放到此目录下 +NXP 系列 BSP 目前支持情况如下表所示: -| BSP 文件夹名称 | 开发板名称 | -|:------------------------- |:-------------------------- | -| mcxn | frdm-mcxn947 | -| mcxa | frdm-mcxa153 | +| **BSP 文件夹名称** | **开发板名称** | +|:------------------------------------------------ |:----------------------------------- | +| **MCXN 系列** | | +| [frdm-mcxn947](mcx/mcxn/frdm-mcxn947) | NXP 官方 FRDM-MCXN947 开发板 | +| [frdm-mcxn236](mcx/mcxn/frdm-mcxn236) | NXP 官方 FRDM-MCXN236 开发板 | +| **MCXA 系列** | | +| [frdm-mcxa153](mcx/mcxa/frdm-mcxa153) | NXP 官方 FRDM-MCXA153 开发板 | +| [frdm-mcxa156](mcx/mcxa/frdm-mcxa156) | NXP 官方 FRDM-MCXA156 开发板 | +| [frdm-mcxa346](mcx/mcxa/frdm-mcxa346) | NXP 官方 FRDM-MCXA346 开发板 | +| [frdm-mcxa344](mcx/mcxa/frdm-mcxa344) | NXP 官方 FRDM-MCXA344 开发板 | +| **MCXC 系列** | | +| [frdm-mcxc444](mcx/mcxc/frdm-mcxc444) | NXP 官方 FRDM-MCXC444 开发板 | +| **LPC 系列** | | +| [lpc43xx](lpc/lpc43xx) | NXP LPC43xx 系列开发板 | +| [lpc55sxx](lpc/lpc55sxx) | NXP LPC55Sxx 系列开发板 | +| [lpc176x](lpc/lpc176x) | NXP LPC176x 系列开发板 | +| [lpc178x](lpc/lpc178x) | NXP LPC178x 系列开发板 | +| [lpc408x](lpc/lpc408x) | NXP LPC408x 系列开发板 | +| [lpc824](lpc/lpc824) | NXP LPC824 开发板 | +| [lpc1114](lpc/lpc1114) | NXP LPC1114 开发板 | +| [lpc2148](lpc/lpc2148) | NXP LPC2148 开发板 | +| [lpc2478](lpc/lpc2478) | NXP LPC2478 开发板 | +| [lpc5410x](lpc/lpc5410x) | NXP LPC5410x 系列开发板 | +| [lpc54114-lite](lpc/lpc54114-lite) | NXP LPC54114-Lite 开发板 | +| [lpc54608-lpcxpresso](lpc/lpc54608-lpcxpresso) | NXP 官方 LPC54608-LPCXpresso 开发板 | + +另外,我们还提供了一些热门开发板的上手说明: + +* [NXP FRDM-MCXN947上手指南](https://www.rt-thread.org/document/site/#/rt-thread-version/rt-thread-standard/tutorial/quick-start/frdm_mcxn947/quick-start) +* [NXP FRDM-MCXA156上手指南](https://www.rt-thread.org/document/site/#/rt-thread-version/rt-thread-standard/tutorial/quick-start/frdm_mcxa156/quick-start) + +## 注意事项 + +- MCX 系列是 NXP 最新推出的 MCU 系列,具有高性能和低功耗特性 +- 部分老旧系列(LPC/Kinetis/i.MX RT)正在逐步迁移和更新中 +- 建议优先选择 MCX 系列进行新项目开发 +- 各系列 BSP 的具体支持功能请参考对应目录下的 README 文档 From 79dca79d90e0d4b782110157747e0160f60c9bb3 Mon Sep 17 00:00:00 2001 From: yandld <1453363089@qq.com> Date: Wed, 20 Aug 2025 18:36:01 +0800 Subject: [PATCH 3/3] update frdm-mcxa346 project --- .../applications/drv_spi_sample_rw007.c | 73 ++++ .../mcx/mcxa/frdm-mcxa346/applications/main.c | 41 +- bsp/nxp/mcx/mcxa/frdm-mcxa346/board/Kconfig | 35 +- .../board/MCUX_Config/board/pin_mux.c | 413 ++++++++++++++++-- .../board/MCUX_Config/board/pin_mux.h | 39 ++ bsp/nxp/mcx/mcxa/frdm-mcxa346/board/board.c | 20 +- bsp/nxp/mcx/mcxa/frdm-mcxa346/project.uvoptx | 242 +++++----- bsp/nxp/mcx/mcxa/frdm-mcxa346/project.uvprojx | 35 +- 8 files changed, 693 insertions(+), 205 deletions(-) create mode 100644 bsp/nxp/mcx/mcxa/frdm-mcxa346/applications/drv_spi_sample_rw007.c diff --git a/bsp/nxp/mcx/mcxa/frdm-mcxa346/applications/drv_spi_sample_rw007.c b/bsp/nxp/mcx/mcxa/frdm-mcxa346/applications/drv_spi_sample_rw007.c new file mode 100644 index 00000000000..c2a89b91d4b --- /dev/null +++ b/bsp/nxp/mcx/mcxa/frdm-mcxa346/applications/drv_spi_sample_rw007.c @@ -0,0 +1,73 @@ +#include + +#ifdef BSP_USING_RW007 +#include +#include +#include +#include + +#define BOARD_RW007_DEVICE_NAME "rw007" + +extern void spi_wifi_isr(int vector); + +static void rw007_gpio_init(void) +{ + /* Configure IO */ + rt_pin_mode(BOARD_RW007_RST_PIN, PIN_MODE_OUTPUT); + rt_pin_mode(BOARD_RW007_INT_BUSY_PIN, PIN_MODE_INPUT_PULLDOWN); + + /* Reset rw007 and config mode */ + rt_pin_write(BOARD_RW007_RST_PIN, PIN_LOW); + + rt_thread_delay(rt_tick_from_millisecond(100)); + rt_pin_write(BOARD_RW007_RST_PIN, PIN_HIGH); + + /* Wait rw007 ready(exit busy stat) */ + while (!rt_pin_read(BOARD_RW007_INT_BUSY_PIN)) + { + rt_thread_delay(5); + } + + rt_thread_delay(rt_tick_from_millisecond(200)); + rt_pin_mode(BOARD_RW007_INT_BUSY_PIN, PIN_MODE_INPUT_PULLUP); +} + +int wifi_spi_device_init(void) +{ + int ret = 0; + char sn_version[32]; + + struct rt_spi_device *spi_device = rt_malloc(sizeof(struct rt_spi_device)); + if (!spi_device) return -1; + + rw007_gpio_init(); + ret = rt_spi_bus_attach_device_cspin(spi_device, BOARD_RW007_DEVICE_NAME, BOARD_RW007_SPI_BUS_NAME, BOARD_RW007_CS_PIN, RT_NULL); + if (ret != RT_EOK) return -2; + + rt_hw_wifi_init("rw007"); + + rt_wlan_set_mode(RT_WLAN_DEVICE_STA_NAME, RT_WLAN_STATION); + rt_wlan_set_mode(RT_WLAN_DEVICE_AP_NAME, RT_WLAN_AP); + + rw007_sn_get(sn_version); + rt_kprintf("\nrw007 sn: [%s]\n", sn_version); + rw007_version_get(sn_version); + rt_kprintf("rw007 ver: [%s]\n\n", sn_version); + + return 0; +} +INIT_APP_EXPORT(wifi_spi_device_init); + +static void int_wifi_irq(void *p) +{ + ((void)p); + spi_wifi_isr(0); +} + +void spi_wifi_hw_init(void) +{ + rt_pin_attach_irq(BOARD_RW007_INT_BUSY_PIN, PIN_IRQ_MODE_FALLING, int_wifi_irq, 0); + rt_pin_irq_enable(BOARD_RW007_INT_BUSY_PIN, RT_TRUE); +} + +#endif diff --git a/bsp/nxp/mcx/mcxa/frdm-mcxa346/applications/main.c b/bsp/nxp/mcx/mcxa/frdm-mcxa346/applications/main.c index 8d71eaf6468..27f2ffc6697 100644 --- a/bsp/nxp/mcx/mcxa/frdm-mcxa346/applications/main.c +++ b/bsp/nxp/mcx/mcxa/frdm-mcxa346/applications/main.c @@ -9,18 +9,27 @@ * 2019-10-24 Magicoe first version * 2020-01-10 Kevin/Karl Add PS demo * 2020-09-21 supperthomas fix the main.c + * 2025-08-18 Alex Yang Add P1_7 button with LED blink control * */ #include #include "drv_pin.h" -#define LED_PIN ((3*32)+18) +#define LED_PIN ((3*32)+18) /* Original LED pin */ +#define BUTTON_PIN ((1*32)+7) /* P1_7 button pin */ -int main(void) -{ +static rt_bool_t led_state = RT_FALSE; /* Current LED state */ +/* Button interrupt callback function */ +void button_irq_callback(void *args) +{ + rt_kprintf("SW2 pressed\n"); +} + +int main(void) +{ #if defined(__CC_ARM) rt_kprintf("using armcc, version: %d\n", __ARMCC_VERSION); #elif defined(__clang__) @@ -31,16 +40,26 @@ int main(void) rt_kprintf("using gcc, version: %d.%d\n", __GNUC__, __GNUC_MINOR__); #endif - rt_kprintf("MCXA346 HelloWorld\r\n"); - rt_pin_mode(LED_PIN, PIN_MODE_OUTPUT); /* Set GPIO as Output */ + rt_kprintf("FRDM-MCXA346\r\n"); + + /* Configure LED pin as output */ + rt_pin_mode(LED_PIN, PIN_MODE_OUTPUT); + rt_pin_write(LED_PIN, PIN_LOW); + + /* Configure button pin as input with pull-up */ + rt_pin_mode(BUTTON_PIN, PIN_MODE_INPUT_PULLUP); + + /* Attach interrupt to button pin */ + rt_pin_attach_irq(BUTTON_PIN, PIN_IRQ_MODE_FALLING, button_irq_callback, RT_NULL); + rt_pin_irq_enable(BUTTON_PIN, PIN_IRQ_ENABLE); while (1) { - rt_pin_write(LED_PIN, PIN_HIGH); /* Set GPIO output 1 */ - rt_thread_mdelay(500); /* Delay 500mS */ - rt_pin_write(LED_PIN, PIN_LOW); /* Set GPIO output 0 */ - rt_thread_mdelay(500); /* Delay 500mS */ + /* Toggle LED state */ + led_state = !led_state; + + rt_pin_write(LED_PIN, led_state ? PIN_HIGH : PIN_LOW); + + rt_thread_mdelay(500); } } - -// end file diff --git a/bsp/nxp/mcx/mcxa/frdm-mcxa346/board/Kconfig b/bsp/nxp/mcx/mcxa/frdm-mcxa346/board/Kconfig index 09b0826e971..b4fbf9377c0 100644 --- a/bsp/nxp/mcx/mcxa/frdm-mcxa346/board/Kconfig +++ b/bsp/nxp/mcx/mcxa/frdm-mcxa346/board/Kconfig @@ -40,11 +40,8 @@ menu "On-chip Peripheral Drivers" default y if BSP_USING_I2C - config BSP_USING_I2C0 - bool "Enable Flexcomm0 I2C" - default y - config BSP_USING_I2C1 - bool "Enable Flexcomm1 I2C" + config BSP_USING_I2C3 + bool "Enable Flexcomm3 I2C" default y endif @@ -67,26 +64,8 @@ menu "On-chip Peripheral Drivers" default y if BSP_USING_ADC - config BSP_USING_ADC0_CH0 - bool "Enable ADC0 Channel0" - default y - - config BSP_USING_ADC0_CH1 - bool "Enable ADC0 Channel1" - default n - - config BSP_USING_ADC0_CH8 - bool "Enable ADC0 Channel8" - default n - - - config BSP_USING_ADC0_CH13 - bool "Enable ADC0 Channel13" - default n - - - config BSP_USING_ADC0_CH26 - bool "Enable ADC0 Channel26" + config BSP_USING_ADC0_CH22 + bool "Enable ADC0 Channel22" default n endif @@ -162,15 +141,15 @@ menu "Board extended module Drivers" config BOARD_RW007_CS_PIN hex "CS pin index" - default 0x46 + default 107 config BOARD_RW007_INT_BUSY_PIN hex "INT/BUSY pin index" - default 0x71 + default 109 config BOARD_RW007_RST_PIN hex "RESET pin index" - default 0x2F + default 131 endif diff --git a/bsp/nxp/mcx/mcxa/frdm-mcxa346/board/MCUX_Config/board/pin_mux.c b/bsp/nxp/mcx/mcxa/frdm-mcxa346/board/MCUX_Config/board/pin_mux.c index 1f560bdf9d1..03b612b08b6 100644 --- a/bsp/nxp/mcx/mcxa/frdm-mcxa346/board/MCUX_Config/board/pin_mux.c +++ b/bsp/nxp/mcx/mcxa/frdm-mcxa346/board/MCUX_Config/board/pin_mux.c @@ -14,6 +14,7 @@ #include "fsl_common.h" #include "fsl_port.h" +#include "fsl_edma.h" #include "pin_mux.h" @@ -22,34 +23,40 @@ void BOARD_InitBootPins(void) BOARD_InitPins(); } +static void release_reset_array(const reset_ip_name_t *resets, uint32_t count) +{ + for (uint32_t i = 0; i < count; i++) { + RESET_ReleasePeripheralReset(resets[i]); + } +} + void BOARD_InitPins(void) { - /* Enable all PORT clocks */ - CLOCK_EnableClock(kCLOCK_GatePORT0); - CLOCK_EnableClock(kCLOCK_GatePORT1); - CLOCK_EnableClock(kCLOCK_GatePORT2); - CLOCK_EnableClock(kCLOCK_GatePORT3); - - /* Enable all GPIO clocks */ - CLOCK_EnableClock(kCLOCK_GateGPIO0); - CLOCK_EnableClock(kCLOCK_GateGPIO1); - CLOCK_EnableClock(kCLOCK_GateGPIO2); - CLOCK_EnableClock(kCLOCK_GateGPIO3); - - /* Release all PORT resets */ - RESET_ReleasePeripheralReset(kPORT0_RST_SHIFT_RSTn); - RESET_ReleasePeripheralReset(kPORT1_RST_SHIFT_RSTn); - RESET_ReleasePeripheralReset(kPORT2_RST_SHIFT_RSTn); - RESET_ReleasePeripheralReset(kPORT3_RST_SHIFT_RSTn); - - RESET_ReleasePeripheralReset(kGPIO0_RST_SHIFT_RSTn); - RESET_ReleasePeripheralReset(kGPIO1_RST_SHIFT_RSTn); - RESET_ReleasePeripheralReset(kGPIO2_RST_SHIFT_RSTn); - RESET_ReleasePeripheralReset(kGPIO3_RST_SHIFT_RSTn); - - RESET_ReleasePeripheralReset(kLPUART0_RST_SHIFT_RSTn); - RESET_ReleasePeripheralReset(kLPUART1_RST_SHIFT_RSTn); - RESET_ReleasePeripheralReset(kLPUART2_RST_SHIFT_RSTn); + static const clock_ip_name_t port_clocks[] = PORT_CLOCKS; + static const clock_ip_name_t gpio_clocks[] = GPIO_CLOCKS; + + // Enable clocks + for (uint32_t i = 0; i < ARRAY_SIZE(port_clocks); i++) { + CLOCK_EnableClock(port_clocks[i]); + CLOCK_EnableClock(gpio_clocks[i]); + } + + // SDK predefined reset arrays + static const reset_ip_name_t port_resets[] = PORT_RSTS_N; + static const reset_ip_name_t gpio_resets[] = GPIO_RSTS_N; + static const reset_ip_name_t uart_resets[] = LPUART_RSTS; + static const reset_ip_name_t i2c_resets[] = LPI2C_RSTS; + static const reset_ip_name_t spi_resets[] = LPSPI_RSTS; + static const reset_ip_name_t dma_resets[] = DMA_RSTS_N; + + // Release resets + release_reset_array(port_resets, ARRAY_SIZE(port_resets)); + release_reset_array(gpio_resets, ARRAY_SIZE(gpio_resets)); + release_reset_array(uart_resets, ARRAY_SIZE(uart_resets)); + release_reset_array(i2c_resets, ARRAY_SIZE(i2c_resets)); + release_reset_array(spi_resets, ARRAY_SIZE(spi_resets)); + release_reset_array(dma_resets, ARRAY_SIZE(dma_resets)); + const port_pin_config_t port2_2_pin35_config = {/* Internal pull-up resistor is enabled */ .pullSelect = kPORT_PullUp, @@ -125,5 +132,357 @@ void BOARD_InitPins(void) /* Pin Control Register fields [15:0] are not locked */ .lockRegister = kPORT_UnlockRegister}; /* PORT3_18 (pin 86) is configured as P3_18 */ - PORT_SetPinConfig(PORT3, 18, &LED_RED); + PORT_SetPinConfig(BOARD_INITLEDSPINS_LED_RED_PORT, BOARD_INITLEDSPINS_LED_RED_PIN, &LED_RED); + + const port_pin_config_t LED_GREEN = {/* Internal pull-up/down resistor is disabled */ + .pullSelect = kPORT_PullDisable, + /* Low internal pull resistor value is selected. */ + .pullValueSelect = kPORT_LowPullResistor, + /* Fast slew rate is configured */ + .slewRate = kPORT_FastSlewRate, + /* Passive input filter is disabled */ + .passiveFilterEnable = kPORT_PassiveFilterDisable, + /* Open drain output is disabled */ + .openDrainEnable = kPORT_OpenDrainDisable, + /* Low drive strength is configured */ + .driveStrength = kPORT_LowDriveStrength, + /* Normal drive strength is configured */ + .driveStrength1 = kPORT_NormalDriveStrength, + /* Pin is configured as P3_19 */ + .mux = kPORT_MuxAlt0, + /* Digital input enabled */ + .inputBuffer = kPORT_InputBufferEnable, + /* Digital input is not inverted */ + .invertInput = kPORT_InputNormal, + /* Pin Control Register fields [15:0] are not locked */ + .lockRegister = kPORT_UnlockRegister}; + /* PORT3_19 (pin 85) is configured as P3_19 */ + PORT_SetPinConfig(BOARD_INITLEDSPINS_LED_GREEN_PORT, BOARD_INITLEDSPINS_LED_GREEN_PIN, &LED_GREEN); + + const port_pin_config_t LED_BLUE = {/* Internal pull-up/down resistor is disabled */ + .pullSelect = kPORT_PullDisable, + /* Low internal pull resistor value is selected. */ + .pullValueSelect = kPORT_LowPullResistor, + /* Fast slew rate is configured */ + .slewRate = kPORT_FastSlewRate, + /* Passive input filter is disabled */ + .passiveFilterEnable = kPORT_PassiveFilterDisable, + /* Open drain output is disabled */ + .openDrainEnable = kPORT_OpenDrainDisable, + /* Low drive strength is configured */ + .driveStrength = kPORT_LowDriveStrength, + /* Normal drive strength is configured */ + .driveStrength1 = kPORT_NormalDriveStrength, + /* Pin is configured as P3_21 */ + .mux = kPORT_MuxAlt0, + /* Digital input enabled */ + .inputBuffer = kPORT_InputBufferEnable, + /* Digital input is not inverted */ + .invertInput = kPORT_InputNormal, + /* Pin Control Register fields [15:0] are not locked */ + .lockRegister = kPORT_UnlockRegister}; + /* PORT3_21 (pin 82) is configured as P3_21 */ + PORT_SetPinConfig(BOARD_INITLEDSPINS_LED_BLUE_PORT, BOARD_INITLEDSPINS_LED_BLUE_PIN, &LED_BLUE); + + + const port_pin_config_t port1_8_pin1_config = {/* Internal pull-up/down resistor is disabled */ + .pullSelect = kPORT_PullDisable, + /* Low internal pull resistor value is selected. */ + .pullValueSelect = kPORT_LowPullResistor, + /* Fast slew rate is configured */ + .slewRate = kPORT_FastSlewRate, + /* Passive input filter is disabled */ + .passiveFilterEnable = kPORT_PassiveFilterDisable, + /* Open drain output is disabled */ + .openDrainEnable = kPORT_OpenDrainDisable, + /* Low drive strength is configured */ + .driveStrength = kPORT_LowDriveStrength, + /* Normal drive strength is configured */ + .driveStrength1 = kPORT_NormalDriveStrength, + /* Pin is configured as LPI2C2_SDA */ + .mux = kPORT_MuxAlt3, + /* Digital input enabled */ + .inputBuffer = kPORT_InputBufferEnable, + /* Digital input is not inverted */ + .invertInput = kPORT_InputNormal, + /* Pin Control Register fields [15:0] are not locked */ + .lockRegister = kPORT_UnlockRegister}; + /* PORT1_8 (pin 1) is configured as LPI2C2_SDA */ + PORT_SetPinConfig(PORT1, 8U, &port1_8_pin1_config); + + const port_pin_config_t port1_9_pin2_config = {/* Internal pull-up/down resistor is disabled */ + .pullSelect = kPORT_PullDisable, + /* Low internal pull resistor value is selected. */ + .pullValueSelect = kPORT_LowPullResistor, + /* Fast slew rate is configured */ + .slewRate = kPORT_FastSlewRate, + /* Passive input filter is disabled */ + .passiveFilterEnable = kPORT_PassiveFilterDisable, + /* Open drain output is disabled */ + .openDrainEnable = kPORT_OpenDrainDisable, + /* Low drive strength is configured */ + .driveStrength = kPORT_LowDriveStrength, + /* Normal drive strength is configured */ + .driveStrength1 = kPORT_NormalDriveStrength, + /* Pin is configured as LPI2C2_SCL */ + .mux = kPORT_MuxAlt3, + /* Digital input enabled */ + .inputBuffer = kPORT_InputBufferEnable, + /* Digital input is not inverted */ + .invertInput = kPORT_InputNormal, + /* Pin Control Register fields [15:0] are not locked */ + .lockRegister = kPORT_UnlockRegister}; + /* PORT1_9 (pin 2) is configured as LPI2C2_SCL */ + PORT_SetPinConfig(PORT1, 9U, &port1_9_pin2_config); + + const port_pin_config_t port3_27_pin74_config = {/* Internal pull-up/down resistor is disabled */ + .pullSelect = kPORT_PullDisable, + /* Low internal pull resistor value is selected. */ + .pullValueSelect = kPORT_LowPullResistor, + /* Fast slew rate is configured */ + .slewRate = kPORT_FastSlewRate, + /* Passive input filter is disabled */ + .passiveFilterEnable = kPORT_PassiveFilterDisable, + /* Open drain output is disabled */ + .openDrainEnable = kPORT_OpenDrainDisable, + /* Low drive strength is configured */ + .driveStrength = kPORT_LowDriveStrength, + /* Normal drive strength is configured */ + .driveStrength1 = kPORT_NormalDriveStrength, + /* Pin is configured as LPI2C3_SCL */ + .mux = kPORT_MuxAlt2, + /* Digital input enabled */ + .inputBuffer = kPORT_InputBufferEnable, + /* Digital input is not inverted */ + .invertInput = kPORT_InputNormal, + /* Pin Control Register fields [15:0] are not locked */ + .lockRegister = kPORT_UnlockRegister}; + /* PORT3_27 (pin 74) is configured as LPI2C3_SCL */ + PORT_SetPinConfig(PORT3, 27U, &port3_27_pin74_config); + + const port_pin_config_t port3_28_pin73_config = {/* Internal pull-up/down resistor is disabled */ + .pullSelect = kPORT_PullDisable, + /* Low internal pull resistor value is selected. */ + .pullValueSelect = kPORT_LowPullResistor, + /* Fast slew rate is configured */ + .slewRate = kPORT_FastSlewRate, + /* Passive input filter is disabled */ + .passiveFilterEnable = kPORT_PassiveFilterDisable, + /* Open drain output is disabled */ + .openDrainEnable = kPORT_OpenDrainDisable, + /* Low drive strength is configured */ + .driveStrength = kPORT_LowDriveStrength, + /* Normal drive strength is configured */ + .driveStrength1 = kPORT_NormalDriveStrength, + /* Pin is configured as LPI2C3_SDA */ + .mux = kPORT_MuxAlt2, + /* Digital input enabled */ + .inputBuffer = kPORT_InputBufferEnable, + /* Digital input is not inverted */ + .invertInput = kPORT_InputNormal, + /* Pin Control Register fields [15:0] are not locked */ + .lockRegister = kPORT_UnlockRegister}; + /* PORT3_28 (pin 73) is configured as LPI2C3_SDA */ + PORT_SetPinConfig(PORT3, 28U, &port3_28_pin73_config); + + + const port_pin_config_t port1_0_pin135_config = {/* Internal pull-up/down resistor is disabled */ + .pullSelect = kPORT_PullDisable, + /* Low internal pull resistor value is selected. */ + .pullValueSelect = kPORT_LowPullResistor, + /* Fast slew rate is configured */ + .slewRate = kPORT_FastSlewRate, + /* Passive input filter is disabled */ + .passiveFilterEnable = kPORT_PassiveFilterDisable, + /* Open drain output is disabled */ + .openDrainEnable = kPORT_OpenDrainDisable, + /* Low drive strength is configured */ + .driveStrength = kPORT_LowDriveStrength, + /* Normal drive strength is configured */ + .driveStrength1 = kPORT_NormalDriveStrength, + /* Pin is configured as LPSPI0_SDO */ + .mux = kPORT_MuxAlt2, + /* Digital input enabled */ + .inputBuffer = kPORT_InputBufferEnable, + /* Digital input is not inverted */ + .invertInput = kPORT_InputNormal, + /* Pin Control Register fields [15:0] are not locked */ + .lockRegister = kPORT_UnlockRegister}; + /* PORT1_0 (pin 135) is configured as LPSPI0_SDO */ + PORT_SetPinConfig(PORT1, 0U, &port1_0_pin135_config); + + const port_pin_config_t port1_1_pin136_config = {/* Internal pull-up/down resistor is disabled */ + .pullSelect = kPORT_PullDisable, + /* Low internal pull resistor value is selected. */ + .pullValueSelect = kPORT_LowPullResistor, + /* Fast slew rate is configured */ + .slewRate = kPORT_FastSlewRate, + /* Passive input filter is disabled */ + .passiveFilterEnable = kPORT_PassiveFilterDisable, + /* Open drain output is disabled */ + .openDrainEnable = kPORT_OpenDrainDisable, + /* Low drive strength is configured */ + .driveStrength = kPORT_LowDriveStrength, + /* Normal drive strength is configured */ + .driveStrength1 = kPORT_NormalDriveStrength, + /* Pin is configured as LPSPI0_SCK */ + .mux = kPORT_MuxAlt2, + /* Digital input enabled */ + .inputBuffer = kPORT_InputBufferEnable, + /* Digital input is not inverted */ + .invertInput = kPORT_InputNormal, + /* Pin Control Register fields [15:0] are not locked */ + .lockRegister = kPORT_UnlockRegister}; + /* PORT1_1 (pin 136) is configured as LPSPI0_SCK */ + PORT_SetPinConfig(PORT1, 1U, &port1_1_pin136_config); + + const port_pin_config_t port1_2_pin137_config = {/* Internal pull-up/down resistor is disabled */ + .pullSelect = kPORT_PullDisable, + /* Low internal pull resistor value is selected. */ + .pullValueSelect = kPORT_LowPullResistor, + /* Fast slew rate is configured */ + .slewRate = kPORT_FastSlewRate, + /* Passive input filter is disabled */ + .passiveFilterEnable = kPORT_PassiveFilterDisable, + /* Open drain output is disabled */ + .openDrainEnable = kPORT_OpenDrainDisable, + /* Low drive strength is configured */ + .driveStrength = kPORT_LowDriveStrength, + /* Normal drive strength is configured */ + .driveStrength1 = kPORT_NormalDriveStrength, + /* Pin is configured as LPSPI0_SDI */ + .mux = kPORT_MuxAlt2, + /* Digital input enabled */ + .inputBuffer = kPORT_InputBufferEnable, + /* Digital input is not inverted */ + .invertInput = kPORT_InputNormal, + /* Pin Control Register fields [15:0] are not locked */ + .lockRegister = kPORT_UnlockRegister}; + /* PORT1_2 (pin 137) is configured as LPSPI0_SDI */ + PORT_SetPinConfig(PORT1, 2U, &port1_2_pin137_config); + + const port_pin_config_t port1_3_pin138_config = {/* Internal pull-up/down resistor is disabled */ + .pullSelect = kPORT_PullDisable, + /* Low internal pull resistor value is selected. */ + .pullValueSelect = kPORT_LowPullResistor, + /* Fast slew rate is configured */ + .slewRate = kPORT_FastSlewRate, + /* Passive input filter is disabled */ + .passiveFilterEnable = kPORT_PassiveFilterDisable, + /* Open drain output is disabled */ + .openDrainEnable = kPORT_OpenDrainDisable, + /* Low drive strength is configured */ + .driveStrength = kPORT_LowDriveStrength, + /* Normal drive strength is configured */ + .driveStrength1 = kPORT_NormalDriveStrength, + /* Pin is configured as LPSPI0_PCS0 */ + .mux = kPORT_MuxAlt2, + /* Digital input enabled */ + .inputBuffer = kPORT_InputBufferEnable, + /* Digital input is not inverted */ + .invertInput = kPORT_InputNormal, + /* Pin Control Register fields [15:0] are not locked */ + .lockRegister = kPORT_UnlockRegister}; + /* PORT1_3 (pin 138) is configured as LPSPI0_PCS0 */ + PORT_SetPinConfig(PORT1, 3U, &port1_3_pin138_config); + + const port_pin_config_t port3_10_pin96_config = {/* Internal pull-up/down resistor is disabled */ + .pullSelect = kPORT_PullDisable, + /* Low internal pull resistor value is selected. */ + .pullValueSelect = kPORT_LowPullResistor, + /* Fast slew rate is configured */ + .slewRate = kPORT_FastSlewRate, + /* Passive input filter is disabled */ + .passiveFilterEnable = kPORT_PassiveFilterDisable, + /* Open drain output is disabled */ + .openDrainEnable = kPORT_OpenDrainDisable, + /* Low drive strength is configured */ + .driveStrength = kPORT_LowDriveStrength, + /* Normal drive strength is configured */ + .driveStrength1 = kPORT_NormalDriveStrength, + /* Pin is configured as LPSPI1_SCK */ + .mux = kPORT_MuxAlt2, + /* Digital input enabled */ + .inputBuffer = kPORT_InputBufferEnable, + /* Digital input is not inverted */ + .invertInput = kPORT_InputNormal, + /* Pin Control Register fields [15:0] are not locked */ + .lockRegister = kPORT_UnlockRegister}; + /* PORT3_10 (pin 96) is configured as LPSPI1_SCK */ + PORT_SetPinConfig(PORT3, 10U, &port3_10_pin96_config); + + const port_pin_config_t port3_11_pin95_config = {/* Internal pull-up/down resistor is disabled */ + .pullSelect = kPORT_PullDisable, + /* Low internal pull resistor value is selected. */ + .pullValueSelect = kPORT_LowPullResistor, + /* Fast slew rate is configured */ + .slewRate = kPORT_FastSlewRate, + /* Passive input filter is disabled */ + .passiveFilterEnable = kPORT_PassiveFilterDisable, + /* Open drain output is disabled */ + .openDrainEnable = kPORT_OpenDrainDisable, + /* Low drive strength is configured */ + .driveStrength = kPORT_LowDriveStrength, + /* Normal drive strength is configured */ + .driveStrength1 = kPORT_NormalDriveStrength, + /* Pin is configured as LPSPI1_PCS0 */ + .mux = kPORT_MuxAlt2, + /* Digital input enabled */ + .inputBuffer = kPORT_InputBufferEnable, + /* Digital input is not inverted */ + .invertInput = kPORT_InputNormal, + /* Pin Control Register fields [15:0] are not locked */ + .lockRegister = kPORT_UnlockRegister}; + /* PORT3_11 (pin 95) is configured as LPSPI1_PCS0 */ + PORT_SetPinConfig(PORT3, 11U, &port3_11_pin95_config); + + const port_pin_config_t port3_8_pin98_config = {/* Internal pull-up/down resistor is disabled */ + .pullSelect = kPORT_PullDisable, + /* Low internal pull resistor value is selected. */ + .pullValueSelect = kPORT_LowPullResistor, + /* Fast slew rate is configured */ + .slewRate = kPORT_FastSlewRate, + /* Passive input filter is disabled */ + .passiveFilterEnable = kPORT_PassiveFilterDisable, + /* Open drain output is disabled */ + .openDrainEnable = kPORT_OpenDrainDisable, + /* Low drive strength is configured */ + .driveStrength = kPORT_LowDriveStrength, + /* Normal drive strength is configured */ + .driveStrength1 = kPORT_NormalDriveStrength, + /* Pin is configured as LPSPI1_SDO */ + .mux = kPORT_MuxAlt2, + /* Digital input enabled */ + .inputBuffer = kPORT_InputBufferEnable, + /* Digital input is not inverted */ + .invertInput = kPORT_InputNormal, + /* Pin Control Register fields [15:0] are not locked */ + .lockRegister = kPORT_UnlockRegister}; + /* PORT3_8 (pin 98) is configured as LPSPI1_SDO */ + PORT_SetPinConfig(PORT3, 8U, &port3_8_pin98_config); + + const port_pin_config_t port3_9_pin97_config = {/* Internal pull-up/down resistor is disabled */ + .pullSelect = kPORT_PullDisable, + /* Low internal pull resistor value is selected. */ + .pullValueSelect = kPORT_LowPullResistor, + /* Fast slew rate is configured */ + .slewRate = kPORT_FastSlewRate, + /* Passive input filter is disabled */ + .passiveFilterEnable = kPORT_PassiveFilterDisable, + /* Open drain output is disabled */ + .openDrainEnable = kPORT_OpenDrainDisable, + /* Low drive strength is configured */ + .driveStrength = kPORT_LowDriveStrength, + /* Normal drive strength is configured */ + .driveStrength1 = kPORT_NormalDriveStrength, + /* Pin is configured as LPSPI1_SDI */ + .mux = kPORT_MuxAlt2, + /* Digital input enabled */ + .inputBuffer = kPORT_InputBufferEnable, + /* Digital input is not inverted */ + .invertInput = kPORT_InputNormal, + /* Pin Control Register fields [15:0] are not locked */ + .lockRegister = kPORT_UnlockRegister}; + /* PORT3_9 (pin 97) is configured as LPSPI1_SDI */ + PORT_SetPinConfig(PORT3, 9U, &port3_9_pin97_config); } diff --git a/bsp/nxp/mcx/mcxa/frdm-mcxa346/board/MCUX_Config/board/pin_mux.h b/bsp/nxp/mcx/mcxa/frdm-mcxa346/board/MCUX_Config/board/pin_mux.h index e81cc050214..a1b26915021 100644 --- a/bsp/nxp/mcx/mcxa/frdm-mcxa346/board/MCUX_Config/board/pin_mux.h +++ b/bsp/nxp/mcx/mcxa/frdm-mcxa346/board/MCUX_Config/board/pin_mux.h @@ -17,6 +17,45 @@ * @{ */ +/* Symbols to be used with GPIO driver */ +#define BOARD_INITLEDSPINS_LED_RED_GPIO GPIO3 /*!<@brief GPIO peripheral base pointer */ +#define BOARD_INITLEDSPINS_LED_RED_GPIO_PIN 18U /*!<@brief GPIO pin number */ +#define BOARD_INITLEDSPINS_LED_RED_GPIO_PIN_MASK (1U << 18U) /*!<@brief GPIO pin mask */ + +/* Symbols to be used with PORT driver */ +#define BOARD_INITLEDSPINS_LED_RED_PORT PORT3 /*!<@brief PORT peripheral base pointer */ +#define BOARD_INITLEDSPINS_LED_RED_PIN 18U /*!<@brief PORT pin number */ +#define BOARD_INITLEDSPINS_LED_RED_PIN_MASK (1U << 18U) /*!<@brief PORT pin mask */ + /* @} */ + +/*! @name PORT3_19 (number 85), LED_GREEN + @{ */ + +/* Symbols to be used with GPIO driver */ +#define BOARD_INITLEDSPINS_LED_GREEN_GPIO GPIO3 /*!<@brief GPIO peripheral base pointer */ +#define BOARD_INITLEDSPINS_LED_GREEN_GPIO_PIN 19U /*!<@brief GPIO pin number */ +#define BOARD_INITLEDSPINS_LED_GREEN_GPIO_PIN_MASK (1U << 19U) /*!<@brief GPIO pin mask */ + +/* Symbols to be used with PORT driver */ +#define BOARD_INITLEDSPINS_LED_GREEN_PORT PORT3 /*!<@brief PORT peripheral base pointer */ +#define BOARD_INITLEDSPINS_LED_GREEN_PIN 19U /*!<@brief PORT pin number */ +#define BOARD_INITLEDSPINS_LED_GREEN_PIN_MASK (1U << 19U) /*!<@brief PORT pin mask */ + /* @} */ + +/*! @name PORT3_21 (number 82), LED_BLUE + @{ */ + +/* Symbols to be used with GPIO driver */ +#define BOARD_INITLEDSPINS_LED_BLUE_GPIO GPIO3 /*!<@brief GPIO peripheral base pointer */ +#define BOARD_INITLEDSPINS_LED_BLUE_GPIO_PIN 21U /*!<@brief GPIO pin number */ +#define BOARD_INITLEDSPINS_LED_BLUE_GPIO_PIN_MASK (1U << 21U) /*!<@brief GPIO pin mask */ + +/* Symbols to be used with PORT driver */ +#define BOARD_INITLEDSPINS_LED_BLUE_PORT PORT3 /*!<@brief PORT peripheral base pointer */ +#define BOARD_INITLEDSPINS_LED_BLUE_PIN 21U /*!<@brief PORT pin number */ +#define BOARD_INITLEDSPINS_LED_BLUE_PIN_MASK (1U << 21U) /*!<@brief PORT pin mask */ + /* @} */ + /*********************************************************************************************************************** * API **********************************************************************************************************************/ diff --git a/bsp/nxp/mcx/mcxa/frdm-mcxa346/board/board.c b/bsp/nxp/mcx/mcxa/frdm-mcxa346/board/board.c index 06bc6957533..0de583f1684 100644 --- a/bsp/nxp/mcx/mcxa/frdm-mcxa346/board/board.c +++ b/bsp/nxp/mcx/mcxa/frdm-mcxa346/board/board.c @@ -63,16 +63,7 @@ void rt_hw_board_init() #endif } -/** - * This function will called when memory fault. - */ -void MemManage_Handler(void) -{ - extern void HardFault_Handler(void); - rt_kprintf("Memory Fault!\n"); - HardFault_Handler(); -} void rt_hw_us_delay(rt_uint32_t us) { @@ -103,3 +94,14 @@ void rt_hw_us_delay(rt_uint32_t us) } } } + +/** + * This function will called when memory fault. + */ +void MemManage_Handler(void) +{ + extern void HardFault_Handler(void); + + rt_kprintf("Memory Fault!\n"); + HardFault_Handler(); +} diff --git a/bsp/nxp/mcx/mcxa/frdm-mcxa346/project.uvoptx b/bsp/nxp/mcx/mcxa/frdm-mcxa346/project.uvoptx index aec1d10843c..56d3a78b4df 100644 --- a/bsp/nxp/mcx/mcxa/frdm-mcxa346/project.uvoptx +++ b/bsp/nxp/mcx/mcxa/frdm-mcxa346/project.uvoptx @@ -194,6 +194,18 @@ 0 0 0 + applications\drv_spi_sample_rw007.c + drv_spi_sample_rw007.c + 0 + 0 + + + 1 + 2 + 1 + 0 + 0 + 0 applications\main.c main.c 0 @@ -209,7 +221,7 @@ 0 2 - 2 + 3 1 0 0 @@ -221,7 +233,7 @@ 2 - 3 + 4 1 0 0 @@ -233,7 +245,7 @@ 2 - 4 + 5 1 0 0 @@ -245,7 +257,7 @@ 2 - 5 + 6 1 0 0 @@ -257,7 +269,7 @@ 2 - 6 + 7 1 0 0 @@ -269,7 +281,7 @@ 2 - 7 + 8 1 0 0 @@ -281,7 +293,7 @@ 2 - 8 + 9 1 0 0 @@ -293,7 +305,7 @@ 2 - 9 + 10 1 0 0 @@ -313,7 +325,7 @@ 0 3 - 10 + 11 1 0 0 @@ -325,7 +337,7 @@ 3 - 11 + 12 1 0 0 @@ -337,7 +349,7 @@ 3 - 12 + 13 1 0 0 @@ -349,7 +361,7 @@ 3 - 13 + 14 1 0 0 @@ -361,7 +373,7 @@ 3 - 14 + 15 1 0 0 @@ -373,7 +385,7 @@ 3 - 15 + 16 1 0 0 @@ -385,7 +397,7 @@ 3 - 16 + 17 1 0 0 @@ -397,7 +409,7 @@ 3 - 17 + 18 1 0 0 @@ -409,7 +421,7 @@ 3 - 18 + 19 1 0 0 @@ -421,7 +433,7 @@ 3 - 19 + 20 1 0 0 @@ -433,7 +445,7 @@ 3 - 20 + 21 1 0 0 @@ -445,7 +457,7 @@ 3 - 21 + 22 1 0 0 @@ -457,7 +469,7 @@ 3 - 22 + 23 1 0 0 @@ -469,7 +481,7 @@ 3 - 23 + 24 1 0 0 @@ -481,7 +493,7 @@ 3 - 24 + 25 1 0 0 @@ -493,7 +505,7 @@ 3 - 25 + 26 1 0 0 @@ -505,7 +517,7 @@ 3 - 26 + 27 1 0 0 @@ -517,7 +529,7 @@ 3 - 27 + 28 1 0 0 @@ -529,7 +541,7 @@ 3 - 28 + 29 1 0 0 @@ -541,7 +553,7 @@ 3 - 29 + 30 1 0 0 @@ -555,13 +567,13 @@ Drivers - 1 + 0 0 0 0 4 - 30 + 31 1 0 0 @@ -573,7 +585,7 @@ 4 - 31 + 32 1 0 0 @@ -585,7 +597,7 @@ 4 - 32 + 33 1 0 0 @@ -597,7 +609,7 @@ 4 - 33 + 34 1 0 0 @@ -609,7 +621,7 @@ 4 - 34 + 35 1 0 0 @@ -629,7 +641,7 @@ 0 5 - 35 + 36 1 0 0 @@ -641,31 +653,31 @@ 5 - 36 + 37 1 0 0 0 - ..\..\..\..\..\components\finsh\shell.c - shell.c + ..\..\..\..\..\components\finsh\msh_parse.c + msh_parse.c 0 0 5 - 37 + 38 1 0 0 0 - ..\..\..\..\..\components\finsh\msh_parse.c - msh_parse.c + ..\..\..\..\..\components\finsh\shell.c + shell.c 0 0 5 - 38 + 39 1 0 0 @@ -685,7 +697,7 @@ 0 6 - 39 + 40 1 0 0 @@ -697,7 +709,7 @@ 6 - 40 + 41 1 0 0 @@ -709,7 +721,7 @@ 6 - 41 + 42 1 0 0 @@ -721,7 +733,7 @@ 6 - 42 + 43 1 0 0 @@ -733,7 +745,7 @@ 6 - 43 + 44 1 0 0 @@ -745,7 +757,7 @@ 6 - 44 + 45 1 0 0 @@ -757,7 +769,7 @@ 6 - 45 + 46 1 0 0 @@ -769,7 +781,7 @@ 6 - 46 + 47 1 0 0 @@ -781,7 +793,7 @@ 6 - 47 + 48 1 0 0 @@ -793,7 +805,7 @@ 6 - 48 + 49 1 0 0 @@ -805,7 +817,7 @@ 6 - 49 + 50 1 0 0 @@ -817,7 +829,7 @@ 6 - 50 + 51 1 0 0 @@ -829,7 +841,7 @@ 6 - 51 + 52 1 0 0 @@ -841,7 +853,7 @@ 6 - 52 + 53 1 0 0 @@ -853,7 +865,7 @@ 6 - 53 + 54 1 0 0 @@ -873,61 +885,61 @@ 0 7 - 54 + 55 1 0 0 0 - ..\..\..\..\..\src\klibc\kstring.c - kstring.c + ..\..\..\..\..\src\klibc\kerrno.c + kerrno.c 0 0 7 - 55 + 56 1 0 0 0 - ..\..\..\..\..\src\klibc\kerrno.c - kerrno.c + ..\..\..\..\..\src\klibc\kstdio.c + kstdio.c 0 0 7 - 56 + 57 1 0 0 0 - ..\..\..\..\..\src\klibc\rt_vsnprintf_tiny.c - rt_vsnprintf_tiny.c + ..\..\..\..\..\src\klibc\kstring.c + kstring.c 0 0 7 - 57 + 58 1 0 0 0 - ..\..\..\..\..\src\klibc\kstdio.c - kstdio.c + ..\..\..\..\..\src\klibc\rt_vsscanf.c + rt_vsscanf.c 0 0 7 - 58 + 59 1 0 0 0 - ..\..\..\..\..\src\klibc\rt_vsscanf.c - rt_vsscanf.c + ..\..\..\..\..\src\klibc\rt_vsnprintf_tiny.c + rt_vsnprintf_tiny.c 0 0 @@ -941,7 +953,7 @@ 0 8 - 59 + 60 1 0 0 @@ -953,7 +965,7 @@ 8 - 60 + 61 1 0 0 @@ -965,7 +977,7 @@ 8 - 61 + 62 1 0 0 @@ -977,7 +989,7 @@ 8 - 62 + 63 2 0 0 @@ -989,7 +1001,7 @@ 8 - 63 + 64 1 0 0 @@ -1001,7 +1013,7 @@ 8 - 64 + 65 2 0 0 @@ -1013,7 +1025,7 @@ 8 - 65 + 66 1 0 0 @@ -1033,7 +1045,7 @@ 0 9 - 66 + 67 1 0 0 @@ -1045,7 +1057,7 @@ 9 - 67 + 68 1 0 0 @@ -1057,7 +1069,7 @@ 9 - 68 + 69 1 0 0 @@ -1069,7 +1081,7 @@ 9 - 69 + 70 1 0 0 @@ -1081,7 +1093,7 @@ 9 - 70 + 71 1 0 0 @@ -1093,7 +1105,7 @@ 9 - 71 + 72 1 0 0 @@ -1105,7 +1117,7 @@ 9 - 72 + 73 1 0 0 @@ -1117,7 +1129,7 @@ 9 - 73 + 74 1 0 0 @@ -1129,7 +1141,7 @@ 9 - 74 + 75 1 0 0 @@ -1141,7 +1153,7 @@ 9 - 75 + 76 1 0 0 @@ -1153,7 +1165,7 @@ 9 - 76 + 77 1 0 0 @@ -1165,7 +1177,7 @@ 9 - 77 + 78 1 0 0 @@ -1177,7 +1189,7 @@ 9 - 78 + 79 1 0 0 @@ -1189,7 +1201,7 @@ 9 - 79 + 80 1 0 0 @@ -1201,7 +1213,7 @@ 9 - 80 + 81 1 0 0 @@ -1213,7 +1225,7 @@ 9 - 81 + 82 1 0 0 @@ -1225,7 +1237,7 @@ 9 - 82 + 83 1 0 0 @@ -1237,7 +1249,7 @@ 9 - 83 + 84 1 0 0 @@ -1249,7 +1261,7 @@ 9 - 84 + 85 1 0 0 @@ -1261,7 +1273,7 @@ 9 - 85 + 86 1 0 0 @@ -1273,7 +1285,7 @@ 9 - 86 + 87 1 0 0 @@ -1285,7 +1297,7 @@ 9 - 87 + 88 1 0 0 @@ -1297,7 +1309,7 @@ 9 - 88 + 89 1 0 0 @@ -1309,7 +1321,7 @@ 9 - 89 + 90 1 0 0 @@ -1321,7 +1333,7 @@ 9 - 90 + 91 1 0 0 @@ -1333,7 +1345,7 @@ 9 - 91 + 92 1 0 0 @@ -1345,7 +1357,7 @@ 9 - 92 + 93 1 0 0 @@ -1357,7 +1369,7 @@ 9 - 93 + 94 1 0 0 @@ -1369,7 +1381,7 @@ 9 - 94 + 95 1 0 0 @@ -1381,7 +1393,7 @@ 9 - 95 + 96 1 0 0 @@ -1393,7 +1405,7 @@ 9 - 96 + 97 1 0 0 @@ -1405,7 +1417,7 @@ 9 - 97 + 98 1 0 0 @@ -1417,7 +1429,7 @@ 9 - 98 + 99 1 0 0 @@ -1429,7 +1441,7 @@ 9 - 99 + 100 1 0 0 @@ -1441,7 +1453,7 @@ 9 - 100 + 101 1 0 0 @@ -1453,7 +1465,7 @@ 9 - 101 + 102 1 0 0 diff --git a/bsp/nxp/mcx/mcxa/frdm-mcxa346/project.uvprojx b/bsp/nxp/mcx/mcxa/frdm-mcxa346/project.uvprojx index 53c74411bd2..a4553409c63 100644 --- a/bsp/nxp/mcx/mcxa/frdm-mcxa346/project.uvprojx +++ b/bsp/nxp/mcx/mcxa/frdm-mcxa346/project.uvprojx @@ -338,9 +338,9 @@ 0 --target=arm-arm-none-eabi - CPU_MCXA346VLQ, __STDC_LIMIT_MACROS, DEBUG, RT_USING_LIBC, __RTTHREAD__, RT_USING_ARMLIBC, __CLK_TCK=RT_TICK_PER_SECOND + __RTTHREAD__, CPU_MCXA346VLQ, RT_USING_ARMLIBC, DEBUG, __STDC_LIMIT_MACROS, RT_USING_LIBC, __CLK_TCK=RT_TICK_PER_SECOND - packages\nxp-mcx-series-latest\MCXA346;..\..\..\..\..\components\libc\compilers\common\extension\fcntl\octal;packages\nxp-mcx-series-latest\MCXA346\periph2;..\..\..\..\..\components\drivers\include;..\..\..\..\..\components\drivers\include;..\..\..\..\..\libcpu\arm\common;..\..\..\..\..\components\libc\compilers\common\extension;applications;board\MCUX_Config\board;..\..\..\..\..\components\drivers\include;.;..\..\..\..\..\components\drivers\phy;..\..\..\..\..\components\libc\posix\io\epoll;packages\nxp-mcx-series-latest\MCXA346\drivers;packages\nxp-mcx-cmsis-latest\Core\Include;..\..\..\..\..\libcpu\arm\cortex-m33;..\..\..\..\..\components\libc\posix\io\poll;..\..\..\..\..\components\drivers\include;..\..\..\..\..\components\drivers\include;..\..\..\..\..\include;..\..\..\..\..\components\drivers\include;..\..\..\..\..\components\drivers\include;..\..\..\..\..\components\libc\posix\ipc;..\..\..\..\..\components\drivers\include;..\..\..\..\..\components\libc\posix\io\eventfd;..\..\..\..\..\components\finsh;packages\nxp-mcx-series-latest\MCXA346\components\codec;..\..\..\..\..\components\drivers\include;..\Libraries\drivers;..\..\..\..\..\components\libc\compilers\common\include;..\..\..\..\..\components\drivers\spi;..\Libraries\drivers\config;..\..\..\..\..\components\drivers\smp_call;board;..\..\..\..\..\components\drivers\include + ..\..\..\..\..\components\drivers\include;applications;..\..\..\..\..\components\drivers\include;..\..\..\..\..\components\libc\posix\io\poll;..\..\..\..\..\components\libc\compilers\common\extension;..\..\..\..\..\components\drivers\include;..\..\..\..\..\components\drivers\smp_call;..\Libraries\drivers\config;..\..\..\..\..\components\drivers\spi;..\..\..\..\..\components\drivers\include;.;..\..\..\..\..\libcpu\arm\common;packages\nxp-mcx-cmsis-latest\Core\Include;packages\nxp-mcx-series-latest\MCXA346\drivers;..\..\..\..\..\components\drivers\include;..\..\..\..\..\components\drivers\include;..\..\..\..\..\components\libc\posix\io\eventfd;..\..\..\..\..\components\drivers\include;packages\nxp-mcx-series-latest\MCXA346\periph2;..\..\..\..\..\libcpu\arm\cortex-m33;..\..\..\..\..\components\libc\posix\ipc;..\..\..\..\..\components\finsh;packages\nxp-mcx-series-latest\MCXA346;..\..\..\..\..\components\libc\compilers\common\extension\fcntl\octal;..\Libraries\drivers;..\..\..\..\..\components\drivers\include;..\..\..\..\..\include;..\..\..\..\..\components\libc\posix\io\epoll;board\MCUX_Config\board;..\..\..\..\..\components\drivers\include;packages\nxp-mcx-series-latest\MCXA346\components\codec;..\..\..\..\..\components\drivers\include;..\..\..\..\..\components\libc\compilers\common\include;board;..\..\..\..\..\components\drivers\phy @@ -384,6 +384,11 @@ Applications + + drv_spi_sample_rw007.c + 1 + applications\drv_spi_sample_rw007.c + main.c 1 @@ -1600,14 +1605,14 @@ ..\..\..\..\..\components\finsh\cmd.c - shell.c + msh_parse.c 1 - ..\..\..\..\..\components\finsh\shell.c + ..\..\..\..\..\components\finsh\msh_parse.c - msh_parse.c + shell.c 1 - ..\..\..\..\..\components\finsh\msh_parse.c + ..\..\..\..\..\components\finsh\shell.c msh.c @@ -2464,31 +2469,31 @@ klibc - - kstring.c - 1 - ..\..\..\..\..\src\klibc\kstring.c - kerrno.c 1 ..\..\..\..\..\src\klibc\kerrno.c - rt_vsnprintf_tiny.c + kstdio.c 1 - ..\..\..\..\..\src\klibc\rt_vsnprintf_tiny.c + ..\..\..\..\..\src\klibc\kstdio.c - kstdio.c + kstring.c 1 - ..\..\..\..\..\src\klibc\kstdio.c + ..\..\..\..\..\src\klibc\kstring.c rt_vsscanf.c 1 ..\..\..\..\..\src\klibc\rt_vsscanf.c + + rt_vsnprintf_tiny.c + 1 + ..\..\..\..\..\src\klibc\rt_vsnprintf_tiny.c +