Communication over Ethernet Using Mac address

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Communication over Ethernet Using Mac address

835 Views
Gohil
Contributor I

Hello everyone,

I'm currently working on a project involving an MCU IMXRT1064 and an EVSE CODICO ISO15118 Carrier board, and I need to establish communication between the two over Ethernet. However, I don't have the IP address of either board, so I'm looking to communicate using the MAC Address of the EVSE Board, which is: c4:93:00:48:AC:45.

Here's my current setup:

  • MCU IMXRT1064 is connected to my laptop via USB for power supply.
  • I've connected the MCU to the EVSE board using an Ethernet cable.

I'm seeking guidance on how to send frames to the EVSE over Ethernet in this setup.

SDK Name: SDK_2.x_EVK_MIMXRT1064 SDK Version: 2.13.0

Any assistance or pointers on how to achieve this would be greatly appreciated!

Thank you.

0 Kudos
Reply
4 Replies

726 Views
Gohil
Contributor I

can you please give me any update on above mentioned things.

 

Thanks.

0 Kudos
Reply

775 Views
Gohil
Contributor I

Hi, 

I want to give you an update for my message query.

I found the example code for the transmit the Ethernet frames and I successfully now able to transmit the frames to the EVSE board. Also I receive the response from the EVSE board in the while loop.

But Now I want to do some modification in that example code.

I want to add the Interrupt for the receive frames. But I did not found any reference or call back function for receive the frames.

 

So can you please give me any reference for it as soon as possible. I eagerly waiting for your response.

 

Thanks

 

 

0 Kudos
Reply

702 Views
Sam_Gao
NXP Employee
NXP Employee

Hi @Gohil 

There is no ready-made example, you need to add it by yourself.

The SDK example(enet_txrx_transfer.c) default function is to send/receive buf to verify enet driver&HW via ringbuf method(while loop), if you want to support interrupt for the receive frames, you need to customized by yourself, but there are some comments from my side, hope the below draf code which based on current reference SDK help you more.

enet_txrx_transfer.c:

 

    /* Init the ENET. */
    ENET_Init(EXAMPLE_ENET, &g_handle, &config, &buffConfig[0], &g_macAddr[0], EXAMPLE_CLOCK_FREQ);
 |--> ENET_Up(....handle, config, bufferConfig, ....)
 |--> ENET_SetHandler(....handle, config, bufferConfig....);
 |---> check if rx interrupt happen.
 if (0U != (config->interrupt & (uint32_t)ENET_RX_INTERRUPT))
    {
        ENET_SetRxISRHandler(base, ENET_ReceiveIRQHandler);
    }

Plz note the comments of ENET_Up.

* param base    ENET peripheral base address.
* param handle  ENET handler pointer.
* param config  ENET mac configuration structure pointer.
*   The "enet_config_t" type mac configuration return from ENET_GetDefaultConfig can be used directly. It is also possible to verify the Mac configuration using other methods.

 

Please see more details from `ENET_ReceiveIRQHandler` to check 

/* Check if the receive interrupt happen. */

/*!
 * brief The receive IRQ handler.
 *
 * param base  ENET peripheral base address.
 * param handle The ENET handler pointer.
 */
#if FSL_FEATURE_ENET_QUEUE > 1
void ENET_ReceiveIRQHandler(ENET_Type *base, enet_handle_t *handle, uint32_t ringId)
#else
void ENET_ReceiveIRQHandler(ENET_Type *base, enet_handle_t *handle)
#endif /* FSL_FEATURE_ENET_QUEUE > 1 */
{
    assert(handle != NULL);
    uint32_t mask = (uint32_t)kENET_RxFrameInterrupt | (uint32_t)kENET_RxBufferInterrupt;

/* Check if the receive interrupt happen. */
#if FSL_FEATURE_ENET_QUEUE > 1
    switch (ringId)
    {
        case kENET_Ring1:
            mask = ((uint32_t)kENET_RxFrame1Interrupt | (uint32_t)kENET_RxBuffer1Interrupt);
            break;
        case kENET_Ring2:
            mask = ((uint32_t)kENET_RxFrame2Interrupt | (uint32_t)kENET_RxBuffer2Interrupt);
            break;
        default:
            mask = (uint32_t)kENET_RxFrameInterrupt | (uint32_t)kENET_RxBufferInterrupt;
            break;
    }
#endif /* FSL_FEATURE_ENET_QUEUE > 1 */

    while (0U != (mask & base->EIR))
    {
        /* Clear the transmit interrupt event. */
        base->EIR = mask;

        /* Callback function. */
        if (NULL != handle->callback)
        {
#if FSL_FEATURE_ENET_QUEUE > 1
            handle->callback(base, handle, ringId, kENET_RxEvent, NULL, handle->userData);
#else
            handle->callback(base, handle, kENET_RxEvent, NULL, handle->userData);
#endif /* FSL_FEATURE_ENET_QUEUE > 1 */
        }
    }
}

 

 Have a nice day,

Sam

0 Kudos
Reply

812 Views
Sam_Gao
NXP Employee
NXP Employee

Hi @Gohil 

Thanks for your questions, please clarify which method you want to commnicate with each other?

Plz refer to "boards\evkbmimxrt1060\driver_examples\enet" for more details.

 

Have a nice day

Sam

0 Kudos
Reply