From 499b6fe4f5cb414ecd996bae7932625385509efd Mon Sep 17 00:00:00 2001 From: diplfranzhoepfinger Date: Mon, 17 Nov 2025 00:42:50 +0100 Subject: [PATCH 1/2] Improve error logging in _node_queue_tx function Enhanced error message for unmatched dlc and buffer_len. --- components/esp_driver_twai/esp_twai_onchip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/esp_driver_twai/esp_twai_onchip.c b/components/esp_driver_twai/esp_twai_onchip.c index 7a8440842ed..e1d3e00e5eb 100644 --- a/components/esp_driver_twai/esp_twai_onchip.c +++ b/components/esp_driver_twai/esp_twai_onchip.c @@ -1,4 +1,4 @@ -/* +unm/* * SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 @@ -585,7 +585,7 @@ static esp_err_t _node_queue_tx(twai_node_handle_t node, const twai_frame_t *fra { twai_onchip_ctx_t *twai_ctx = __containerof(node, twai_onchip_ctx_t, api_base); if (frame->header.dlc && frame->buffer_len) { - ESP_RETURN_ON_FALSE_ISR(frame->header.dlc == twaifd_len2dlc(frame->buffer_len), ESP_ERR_INVALID_ARG, TAG, "unmatched dlc and buffer_len"); + ESP_RETURN_ON_FALSE_ISR(frame->header.dlc == twaifd_len2dlc(frame->buffer_len), ESP_ERR_INVALID_ARG, TAG, "unmatched dlc(%i) and buffer_len(%i)", frame->header.dlc, twaifd_len2dlc(frame->buffer_len)); } #if !SOC_TWAI_SUPPORT_FD ESP_RETURN_ON_FALSE_ISR(!frame->header.fdf || frame->buffer_len <= TWAI_FRAME_MAX_LEN, ESP_ERR_INVALID_ARG, TAG, "fdf flag or buffer_len not supported"); From aeb27515fc5d3438c666edbe7faa4618f7047d08 Mon Sep 17 00:00:00 2001 From: diplfranzhoepfinger Date: Mon, 17 Nov 2025 00:44:27 +0100 Subject: [PATCH 2/2] Update copyright header in esp_twai_onchip.c --- components/esp_driver_twai/esp_twai_onchip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/esp_driver_twai/esp_twai_onchip.c b/components/esp_driver_twai/esp_twai_onchip.c index e1d3e00e5eb..69f66e8f04b 100644 --- a/components/esp_driver_twai/esp_twai_onchip.c +++ b/components/esp_driver_twai/esp_twai_onchip.c @@ -1,4 +1,4 @@ -unm/* +/* * SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0