From 06a5f136b4ccaa5e2b961187de9952ab1ca2909e Mon Sep 17 00:00:00 2001 From: Miles Burchell Date: Wed, 19 Jul 2023 09:59:28 +1000 Subject: [PATCH 1/2] Update r_sci_rx.c Fix SCI Rx/Tx not working if DMA or DTC is enabled for only Rx or only Tx --- source/r_sci_rx/r_sci_rx_vx.xx/r_sci_rx/src/r_sci_rx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/r_sci_rx/r_sci_rx_vx.xx/r_sci_rx/src/r_sci_rx.c b/source/r_sci_rx/r_sci_rx_vx.xx/r_sci_rx/src/r_sci_rx.c index bf23413f..7fe5c609 100644 --- a/source/r_sci_rx/r_sci_rx_vx.xx/r_sci_rx/src/r_sci_rx.c +++ b/source/r_sci_rx/r_sci_rx_vx.xx/r_sci_rx/src/r_sci_rx.c @@ -409,7 +409,8 @@ sci_err_t R_SCI_Open (uint8_t const chan, { #if (TX_DTC_DMACA_ENABLE & 0x01 || TX_DTC_DMACA_ENABLE & 0x02) /* DTC/DMAC don't use the queue */ - if ((SCI_DTC_ENABLE != g_handles[chan]->rom->dtc_dmaca_tx_enable) && (SCI_DMACA_ENABLE != g_handles[chan]->rom->dtc_dmaca_tx_enable)) + if (((SCI_DTC_ENABLE != g_handles[chan]->rom->dtc_dmaca_tx_enable) && (SCI_DMACA_ENABLE != g_handles[chan]->rom->dtc_dmaca_tx_enable)) + || ((SCI_DTC_ENABLE != g_handles[chan]->rom->dtc_dmaca_rx_enable) && (SCI_DMACA_ENABLE != g_handles[chan]->rom->dtc_dmaca_rx_enable))) { err = sci_init_queues(chan); } From baa2f806fce239d87afff01b5b486e40db19742b Mon Sep 17 00:00:00 2001 From: Miles Burchell Date: Wed, 19 Jul 2023 10:02:29 +1000 Subject: [PATCH 2/2] Update r_usb_pdriver.c Fix illegal memory access when FreeRTOS USB fixed memory buffer is full --- .../r_usb_basic_vx.xx/r_usb_basic/src/driver/r_usb_pdriver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/r_usb_basic/r_usb_basic_vx.xx/r_usb_basic/src/driver/r_usb_pdriver.c b/source/r_usb_basic/r_usb_basic_vx.xx/r_usb_basic/src/driver/r_usb_pdriver.c index 7b4b7464..c53e2f11 100644 --- a/source/r_usb_basic/r_usb_basic_vx.xx/r_usb_basic/src/driver/r_usb_pdriver.c +++ b/source/r_usb_basic/r_usb_basic_vx.xx/r_usb_basic/src/driver/r_usb_pdriver.c @@ -1181,7 +1181,7 @@ usb_er_t usb_pstd_transfer_start(usb_utr_t * ptr) rtos_get_fixed_memory(&g_rtos_usb_mpf_id, (void **)&p_tran_data, RTOS_ZERO); - if (NULL == ptr) + if (NULL == ptr || NULL == p_tran_data) { return USB_ERROR; }