Quantcast
Channel:
Viewing all articles
Browse latest Browse all 59170

Forum Post: RE: Ethernet relay thru ports 0 and 1 (TRNMR register) and SSP

$
0
0
Hello Warren, Stefaan: I have figured out how to set up the EPTPC module to relay packets. I set up and start the EPTPC module, Then I start NetX as usual for ethernet channel 0, Then I want to attach another driver for ethernet channel 1.  This attached driver will  initialize the hardware for ethernet channel 1 as usual.  The difference is that I have blocked packets to EDMAC1 using the SYNFP1 module.  Now all packets should relay both directions and SYNFP0 should pass all packets to EDMAC0 for processing as per usual. I am having trouble with calling the ethernet driver in the  nx_ip_interface_attach() Function.  I get a status 7 returned from the attach function = Invalid pointer input.  I know this is referencing the void pointer to the driver. Can you help me with the proper syntax to initialize Ethernet channel 1? Here is my code (included are the prototypes for the ip_create and nx_ip_interface_attach functions for reference) // init registers for relay between ethernet channels 0 and 1 R_EPTPC_GEN- TRNMR = 0x00000300; // relay packets both ways using store/forward method // R_EPTPC0- FFLTR is OK from reset. Passes all packets up to edmac 0 without filtering R_EPTPC1- FFLTR = 0x00000004; // do not pass any packets in channel 1 up to edmac unit (relay only on channel 1) // turn on the EPTPC module ... R_BSP_RegisterProtectDisable(BSP_REG_PROTECT_OM_LPC_BATT); R_MSTP- MSTPCRB_b.MSTPB13 = 0; // turn on module R_BSP_RegisterProtectEnable(BSP_REG_PROTECT_OM_LPC_BATT); // Initialize the NetX system. nx_system_initialize(); // Create a packet pool. status = nx_packet_pool_create(&pool_0, "NetX Main Packet Pool", NetX_PACKET_SIZE, packet_pool_area, sizeof(packet_pool_area)); if (status) netx_error_counter++; /* Create an IP instance. */ status = nx_ip_create(&ip_0, "NetX IP Instance 0", gOurIpAddress, 0xFFFFFF00UL, &pool_0, nx_ether_driver_eth0, ip_helper_thread_stack, IP_HELPER_STACK_SIZE, 12); if (status) netx_error_counter++; // attach second interface only to initialize ethernet channel 1. Packets are blocked by SYNFP module /*NOTE changed nx_api.h as follows, then made read only * There should be at least one physical interface. #ifndef NX_MAX_PHYSICAL_INTERFACES // HighPoint set this to 2, then made file read only !!! #define NX_MAX_PHYSICAL_INTERFACES 2 #endif // NX_MAX_PHYSICAL_INTERFACES * */ /* prototypes for reference ... UINT _nxe_ip_create(NX_IP *ip_ptr, CHAR *name, ULONG ip_address, ULONG network_mask, NX_PACKET_POOL *default_pool, VOID (*ip_link_driver)(NX_IP_DRIVER *), VOID *memory_ptr, ULONG memory_size, UINT priority, UINT ip_control_block_size); UINT nx_ip_interface_attach(NX_IP *ip_ptr, CHAR* interface_name, ULONG ip_address, ULONG network_mask, VOID (*ip_link_driver)(struct NX_IP_DRIVER_STRUCT *)); */ status = nx_ip_interface_attach(&ip_0, "dummy_chan_1", gOurDummyIpAddress, 0xFFFFFF00UL, nx_ether_driver_eth1); if (status) netx_error_counter++;   // status returns 7 = invalid pointer input // now all packets should relay from channels 0 and 1 Thanks for your help, Steve Dillier

Viewing all articles
Browse latest Browse all 59170

Trending Articles