fixes wrong append pointer assignment in minres ethmac driver #3

Merged
eyck merged 1 commits from Airbus/ADS-VP-Demo-FW:main into main 2026-02-08 16:28:52 +00:00
4 changed files with 16 additions and 7 deletions
Showing only changes of commit 124b83418a - Show all commits

View File

@@ -21,6 +21,12 @@ set(NXD_ENABLE_FILE_SERVERS OFF)
set(NX_USER_FILE ${CMAKE_CURRENT_LIST_DIR}/port/threadx/inc/nx_user.h) set(NX_USER_FILE ${CMAKE_CURRENT_LIST_DIR}/port/threadx/inc/nx_user.h)
add_subdirectory(third-party/netxduo) add_subdirectory(third-party/netxduo)
target_link_libraries(netxduo PUBLIC c) target_link_libraries(netxduo PUBLIC c)
if(NX_DEBUG)
target_compile_definitions(netxduo PRIVATE NX_DEBUG NX_DEBUG_PACKET NX_ENABLE_PACKET_DEBUG_INFO)
endif()
if(TX_TRACE)
target_compile_definitions(netxduo PUBLIC TX_ENABLE_EVENT_TRACE)
endif()
############################################################################### ###############################################################################
project(threadx_demo C ASM) project(threadx_demo C ASM)
option(NX_DEBUG "compile netxduo debug output in" OFF) option(NX_DEBUG "compile netxduo debug output in" OFF)

View File

@@ -799,7 +799,7 @@ void _nx_mnrs_network_driver_receive(NX_IP* ip_ptr, NX_PACKET* packet_ptr, UINT
/* Adjust the packet length. */ /* Adjust the packet length. */
packet_ptr->nx_packet_length = packet_ptr->nx_packet_length - NX_ETHERNET_SIZE; packet_ptr->nx_packet_length = packet_ptr->nx_packet_length - NX_ETHERNET_SIZE;
/* Route to the ip receive function. */ /* Route to the ip receive function. */
#ifdef NX_DEBUG_PACKET #ifdef NX_DEBUG
printf("NetX MNRS ETH Driver IP Packet Receive - %s\n", ip_ptr->nx_ip_name); printf("NetX MNRS ETH Driver IP Packet Receive - %s\n", ip_ptr->nx_ip_name);
#endif #endif
_nx_ip_packet_deferred_receive(ip_ptr, packet_ptr); _nx_ip_packet_deferred_receive(ip_ptr, packet_ptr);
@@ -895,8 +895,9 @@ VOID _nx_mnrs_eth_recv_packet(UINT i)
UINT packet_type; UINT packet_type;
/* read the number of bits in the frame and convert it into number of words to read */ /* read the number of bits in the frame and convert it into number of words to read */
bits_received = get_ethmac_mac_rx(nx_mnrs_driver[i].ethmac); bits_received = get_ethmac_mac_rx(nx_mnrs_driver[i].ethmac);
words_to_read = (bits_received + 31) / 32; bytes_received = (bits_received + 7) / 8;
words_to_read = (bits_received + 31) / 32;
if (words_to_read < 4) if (words_to_read < 4)
{ {
for (j = 0; j < words_to_read; j++) for (j = 0; j < words_to_read; j++)
@@ -956,8 +957,8 @@ VOID _nx_mnrs_eth_recv_packet(UINT i)
} }
else else
{ {
packet_ptr->nx_packet_length = (ULONG)bytes_received; packet_ptr->nx_packet_length = bytes_received;
packet_ptr->nx_packet_append_ptr += (ULONG)bytes_received; packet_ptr->nx_packet_append_ptr += bytes_received;
} }
_nx_mnrs_network_driver_receive(ip_ptr, packet_ptr, i); _nx_mnrs_network_driver_receive(ip_ptr, packet_ptr, i);

View File

@@ -776,3 +776,7 @@ extern "C"
#define NX_RAND rand #define NX_RAND rand
#define NX_SRAND srand #define NX_SRAND srand
#endif #endif
// hacky workaround for missing include in netxduo/common/src/nx_ram_network_driver.c
#ifdef NX_DEBUG
#include <stdio.h>
#endif

View File

@@ -103,8 +103,6 @@ typedef unsigned long long ULONG64;
typedef short SHORT; typedef short SHORT;
typedef unsigned short USHORT; typedef unsigned short USHORT;
#define ULONG64_DEFINED #define ULONG64_DEFINED
#define ALIGN_TYPE_DEFINED
#define ALIGN_TYPE ULONG64
/* Define the priority levels for ThreadX. Legal values range /* Define the priority levels for ThreadX. Legal values range
from 32 to 1024 and MUST be evenly divisible by 32. */ from 32 to 1024 and MUST be evenly divisible by 32. */