Ethernet Communication

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Ethernet Communication

ソリューションへジャンプ
3,898件の閲覧回数
Govind89
Contributor II

I am new to i.MX RT1170 development and using the EVKBMIMXRT1170 board. I'm working with the built-in example code evkbmimxrt1170_enet_txrx_transfer_cm7 for Ethernet functionality, but I'm finding it difficult to understand how it works.

I would like to request a simpler, bare-metal code example that focuses just on basic Ethernet operations:

  • Ethernet configuration

  • Ethernet initialization

  • Ethernet frame transmission

  • Ethernet frame reception

I need this in API-style simple code without RTOS, using MCUXpresso IDE. Please provide guidance and the simplest base code for Ethernet functionality on my EVKBMIMXRT1170 development board.
i.MX-RT1170 MCUXpresso-IDE 

タグ(2)
0 件の賞賛
返信
1 解決策
3,790件の閲覧回数
mayliu1
NXP Employee
NXP Employee

Hi @Govind89 ,

 

I suggest you can check the example in SDK import Wizard.

mayliu1_0-1746098335143.png

Best Regards

MayLiu

元の投稿で解決策を見る

0 件の賞賛
返信
5 返答(返信)
3,869件の閲覧回数
mayliu1
NXP Employee
NXP Employee

Hi @Govind89 ,

 

Thank you so much for your interest in our products and for using our community.

I think the project you imported is already without FREERTOS, if you want more Ethernet demo, you can check by import  SDK example. 

mayliu1_0-1745898661549.png

If you want know more about the SDK API. you can refer to the document "MCUXpresso SDK API Reference Manual"

https://mcuxpresso.nxp.com/api_doc/dev/329/index.html

Wish it helps you.
If you still have question about it, please kindly let me know.

Wish you a nice day!

Best Regards
MayLiu

0 件の賞賛
返信
3,861件の閲覧回数
Govind89
Contributor II
helle @mayliu1
Thanks for replay

Based on the example, I tried, but I am unable to receive and transmit the frame.

I modified the code to create a simpler version. using evkbmimxrt1170_enet_txrx_transfer_cm7 example code please guide me what will be need to change. i am attech project file.



#include "fsl_debug_console.h"

#include "fsl_silicon_id.h"

#include "fsl_enet.h"

#include "fsl_phy.h"

#include "board.h"



#include "fsl_phyrtl8201.h"



#include "fsl_enet.h"

#include "board.h"



#define EXAMPLE_ENET ENET

#define EXAMPLE_CLOCK_FREQ CLOCK_GetRootClockFreq(kCLOCK_Root_Bus)

#define ENET_RXBD_NUM 4

#define ENET_TXBD_NUM 4

#define ENET_RXBUFF_SIZE ENET_FRAME_MAX_FRAMELEN

#define ENET_TXBUFF_SIZE ENET_FRAME_MAX_FRAMELEN

#define ENET_DATA_LENGTH 1000



/* Buffer descriptors */

AT_NONCACHEABLE_SECTION_ALIGN(enet_rx_bd_struct_t g_rxBuffDescrip[ENET_RXBD_NUM], ENET_BUFF_ALIGNMENT);

AT_NONCACHEABLE_SECTION_ALIGN(enet_tx_bd_struct_t g_txBuffDescrip[ENET_TXBD_NUM], ENET_BUFF_ALIGNMENT);



/* Data buffers */

SDK_ALIGN(uint8_t g_rxDataBuff[ENET_RXBD_NUM][ENET_RXBUFF_SIZE], ENET_BUFF_ALIGNMENT);

SDK_ALIGN(uint8_t g_txDataBuff[ENET_TXBD_NUM][ENET_TXBUFF_SIZE], ENET_BUFF_ALIGNMENT);



/* MAC address */

uint8_t g_macAddr[6] =

{ 0x02, 0x12, 0x13, 0x14, 0x15, 0x16 };



/* ENET handle */

static enet_handle_t g_handle;



static void BuildTestFrame(uint8_t *frame)

{

/* Destination MAC (broadcast) */

for (int i = 0; i < 6; i++)

{

frame[i] = 0xFF;

}



/* Source MAC */

memcpy(&frame[6], g_macAddr, 6);



/* EtherType/Length */

frame[12] = 0x08; // IPv4

frame[13] = 0x00;



/* Simple payload */

for (int i = 14; i < ENET_DATA_LENGTH; i++)

{

frame[i] = i % 256;

}

}



void InitEthernet(void)

{

enet_config_t config;



/* Prepare buffer configuration */

enet_buffer_config_t buffConfig =

{

ENET_RXBD_NUM,

ENET_TXBD_NUM,

ENET_RXBUFF_SIZE,

ENET_TXBUFF_SIZE, g_rxBuffDescrip, g_txBuffDescrip, &g_rxDataBuff[0][0], &g_txDataBuff[0][0],

true,

true,

NULL };



/* Get default ENET configuration */

ENET_GetDefaultConfig(&config);

config.miiMode = kENET_RmiiMode;

config.miiSpeed = kENET_MiiSpeed100M;

config.miiDuplex = kENET_MiiFullDuplex;



/* Initialize ENET */

ENET_Init(EXAMPLE_ENET, &g_handle, &config, &buffConfig, g_macAddr, EXAMPLE_CLOCK_FREQ);

ENET_ActiveRead(EXAMPLE_ENET);

}



int main(void)

{

uint8_t txFrame[ENET_DATA_LENGTH];

uint8_t rxBuffer[ENET_RXBUFF_SIZE];



/* Initialize hardware */

BOARD_InitHardware();



/* Initialize Ethernet */

InitEthernet();



/* Build test frame */

BuildTestFrame(txFrame);



while (1)

{

uint32_t frameLength = 0;



/* Check for received frames */

if (ENET_GetRxFrameSize(&g_handle, &frameLength, 0) == kStatus_Success)

{

if (frameLength > 0)

{

/* Read the frame */

if (ENET_ReadFrame(EXAMPLE_ENET, &g_handle, rxBuffer, frameLength, 0, NULL) == kStatus_Success)

{

/* Process received frame here */

}

}

}



/* Send test frame */

status_t ENET_SendFrame(ENET_Type *base, enet_handle_t *handle, const uint8_t *data, uint32_t length, uint8_t ringId,

bool tsFlag, void *context);



ENET_SendFrame(EXAMPLE_ENET, &g_handle, txFrame, ENET_DATA_LENGTH, 0, false, NULL);



/* Small delay */

for (volatile int i = 0; i < 1000000; i++);

}

}











in that i am getting also error undefined reference to `PHY_LinkStatusChange'
0 件の賞賛
返信
3,834件の閲覧回数
mayliu1
NXP Employee
NXP Employee

Hi @Govind89 ,

 

Thanks for your updated information.

I don't recommend modifying the NXP SDK demo code ,because it may introduce additional issues.

Since the NXP SDK demo is already well-optimized , and it was rigorously tested to ensure proper functionality, I suggest you refer to the example code as it is(when the demo runs ok, then you can modify the code you want to test).

Additionally, I suggest you check  the README file for this demo to confirm your development environment is correctly configured.

mayliu1_0-1745985202094.png

Wish it helps you.
If you still have question about it, please kindly let me know.

Wish you a nice day!

Best Regards
MayLiu

0 件の賞賛
返信
3,821件の閲覧回数
Govind89
Contributor II
Thank you for your response. Additionally, I would like to inquire about communication between two RT boards using Ethernet. Both boards have 1 Gbps and 100 Mbps ports available. Could you please advise which example I should follow for this setup?
0 件の賞賛
返信
3,791件の閲覧回数
mayliu1
NXP Employee
NXP Employee

Hi @Govind89 ,

 

I suggest you can check the example in SDK import Wizard.

mayliu1_0-1746098335143.png

Best Regards

MayLiu

0 件の賞賛
返信
%3CLINGO-SUB%20id%3D%22lingo-sub-2088184%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E3%82%A4%E3%83%BC%E3%82%B5%E3%83%8D%E3%83%83%E3%83%88%E9%80%9A%E4%BF%A1%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2088184%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%20class%3D%22%22%3ERT1170%E3%81%AE%E9%96%8B%E7%99%BA%E3%81%A8EVKBMIMXRT1170%E3%83%9C%E3%83%BC%E3%83%89%E3%81%AE%E4%BD%BF%E7%94%A8%20i.MX%20%E3%81%AF%E5%88%9D%E3%82%81%E3%81%A6%E3%81%A7%E3%81%99%E3%80%82%E7%A7%81%E3%81%AF%E7%B5%84%E3%81%BF%E8%BE%BC%E3%81%BF%E3%81%AE%E3%82%A4%E3%83%BC%E3%82%B5%E3%83%8D%E3%83%83%E3%83%88%E6%A9%9F%E8%83%BD%E3%81%AE%E3%82%B5%E3%83%B3%E3%83%97%E3%83%AB%E3%82%B3%E3%83%BC%E3%83%89%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%A6%E3%81%84%E3%81%BE%E3%81%99%E3%81%8C%E3%80%81%E3%81%9D%E3%82%8C%E3%81%8C%E3%81%A9%E3%81%AE%E3%82%88%E3%81%86%E3%81%AB%E6%A9%9F%E8%83%BD%E3%81%99%E3%82%8B%E3%81%8B%E3%82%92%E7%90%86%E8%A7%A3%E3%81%99%E3%82%8B%E3%81%AE%E3%81%AF%E9%9B%A3%E3%81%97%E3%81%84%E3%81%A8%E6%84%9F%E3%81%98%E3%81%A6%E3%81%84%E3%81%BE%E3%81%99%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eevkbmimxrt1170_enet_txrx_transfer_cm7%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20class%3D%22%22%3E%E5%9F%BA%E6%9C%AC%E7%9A%84%E3%81%AA%E3%82%A4%E3%83%BC%E3%82%B5%E3%83%8D%E3%83%83%E3%83%88%E6%93%8D%E4%BD%9C%E3%81%AE%E3%81%BF%E3%81%AB%E7%84%A6%E7%82%B9%E3%82%92%E5%BD%93%E3%81%A6%E3%81%9F%E3%80%81%E3%82%88%E3%82%8A%E5%8D%98%E7%B4%94%E3%81%AA%E3%83%99%E3%82%A2%E3%83%A1%E3%82%BF%E3%83%AB%E3%82%B3%E3%83%BC%E3%83%89%E3%81%AE%E4%BE%8B%E3%82%92%E3%83%AA%E3%82%AF%E3%82%A8%E3%82%B9%E3%83%88%E3%81%97%E3%81%9F%E3%81%84%E3%81%A8%E6%80%9D%E3%81%84%E3%81%BE%E3%81%99%E3%80%82%3C%2FP%3E%3CUL%3E%3CLI%3E%3CP%20class%3D%22%22%3E%E3%82%A4%E3%83%BC%E3%82%B5%E3%83%8D%E3%83%83%E3%83%88%E3%81%AE%E8%A8%AD%E5%AE%9A%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%20class%3D%22%22%3E%E3%82%A4%E3%83%BC%E3%82%B5%E3%83%8D%E3%83%83%E3%83%88%E3%81%AE%E5%88%9D%E6%9C%9F%E5%8C%96%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%20class%3D%22%22%3E%E3%82%A4%E3%83%BC%E3%82%B5%E3%83%8D%E3%83%83%E3%83%88%E3%83%95%E3%83%AC%E3%83%BC%E3%83%A0%E4%BC%9D%E9%80%81%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%20class%3D%22%22%3E%E3%82%A4%E3%83%BC%E3%82%B5%E3%83%8D%E3%83%83%E3%83%88%E3%83%95%E3%83%AC%E3%83%BC%E3%83%A0%E5%8F%97%E4%BF%A1%3C%2FP%3E%3C%2FLI%3E%3C%2FUL%3E%3CP%20class%3D%22%22%3E%E3%81%93%E3%82%8C%E3%81%AF%E3%80%81MCUXpresso%20IDE%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%A6%E3%80%81RTOS%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%AA%E3%81%84API%E3%82%B9%E3%82%BF%E3%82%A4%E3%83%AB%E3%81%AE%E3%82%B7%E3%83%B3%E3%83%97%E3%83%AB%E3%81%AA%E3%82%B3%E3%83%BC%E3%83%89%E3%81%A7%E5%BF%85%E8%A6%81%E3%81%A7%E3%81%99%E3%80%82%E7%A7%81%E3%81%AEEVKBMIMXRT1170%E9%96%8B%E7%99%BA%E3%83%9C%E3%83%BC%E3%83%89%E3%81%A7%E3%82%A4%E3%83%BC%E3%82%B5%E3%83%8D%E3%83%83%E3%83%88%E6%A9%9F%E8%83%BD%E3%81%AE%E3%82%AC%E3%82%A4%E3%83%80%E3%83%B3%E3%82%B9%E3%81%A8%E6%9C%80%E3%82%82%E7%B0%A1%E5%8D%98%E3%81%AA%E3%83%99%E3%83%BC%E3%82%B9%E3%82%B3%E3%83%BC%E3%83%89%E3%82%92%E6%8F%90%E4%BE%9B%E3%81%97%E3%81%A6%E3%81%8F%E3%81%A0%E3%81%95%E3%81%84%E3%80%82%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fc-pwmxy87654%2Fi.MX-RT1170%2Fpd-p%2Fi.MX-RT1170%22%20class%3D%22lia-product-mention%22%20data-product%3D%22519-1%22%20target%3D%22_blank%22%3Ei.MX-RT1170%3C%2FA%3E%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fc-pwmxy87654%2FMCUXpresso-IDE%2Fpd-p%2FMCUXpresso-IDE%22%20class%3D%22lia-product-mention%22%20data-product%3D%223137-1%22%20target%3D%22_blank%22%3EMCUX%E3%83%97%E3%83%AC%E3%83%83%E3%82%BDIDE%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2089827%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%E3%82%A4%E3%83%BC%E3%82%B5%E3%83%8D%E3%83%83%E3%83%88%E9%80%9A%E4%BF%A1%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2089827%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E8%BF%94%E4%BF%A1%E3%81%82%E3%82%8A%E3%81%8C%E3%81%A8%E3%81%86%E3%81%94%E3%81%96%E3%81%84%E3%81%BE%E3%81%99%E3%80%82%E3%81%BE%E3%81%9F%E3%80%81%E3%82%A4%E3%83%BC%E3%82%B5%E3%83%8D%E3%83%83%E3%83%88%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%9F2%E3%81%A4%E3%81%AERT%E3%83%9C%E3%83%BC%E3%83%89%E9%96%93%E3%81%AE%E9%80%9A%E4%BF%A1%E3%81%AB%E3%81%A4%E3%81%84%E3%81%A6%E3%82%82%E3%81%8A%E5%95%8F%E3%81%84%E5%90%88%E3%81%9B%E3%81%97%E3%81%BE%E3%81%99%E3%80%82%E3%81%A9%E3%81%A1%E3%82%89%E3%81%AE%E3%83%9C%E3%83%BC%E3%83%89%E3%81%AB%E3%82%82%E3%80%811%20Gbps%20%E3%83%9D%E3%83%BC%E3%83%88%E3%81%A8%20100%20Mbps%20%E3%83%9D%E3%83%BC%E3%83%88%E3%81%8C%E3%81%82%E3%82%8A%E3%81%BE%E3%81%99%E3%80%82%E3%81%93%E3%81%AE%E8%A8%AD%E5%AE%9A%E3%81%A7%E3%81%A9%E3%81%AE%E4%BE%8B%E3%81%AB%E5%BE%93%E3%81%86%E3%81%B9%E3%81%8D%E3%81%8B%E3%82%A2%E3%83%89%E3%83%90%E3%82%A4%E3%82%B9%E3%81%97%E3%81%A6%E3%81%84%E3%81%9F%E3%81%A0%E3%81%91%E3%81%BE%E3%81%99%E3%81%8B%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2088907%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%E3%82%A4%E3%83%BC%E3%82%B5%E3%83%8D%E3%83%83%E3%83%88%E9%80%9A%E4%BF%A1%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2088907%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E3%83%98%E3%83%AC%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F239163%22%20target%3D%22_blank%22%3E%40mayliu1%3C%2FA%3E%3CBR%20%2F%3E%E3%83%AA%E3%83%97%E3%83%AC%E3%82%A4%E3%82%92%E3%81%82%E3%82%8A%E3%81%8C%E3%81%A8%E3%81%86%3CBR%20%2F%3E%3CBR%20%2F%3E%E4%BE%8B%E3%81%AB%E5%9F%BA%E3%81%A5%E3%81%84%E3%81%A6%E3%80%81%E8%A9%A6%E3%81%97%E3%81%A6%E3%81%BF%E3%81%BE%E3%81%97%E3%81%9F%E3%81%8C%E3%80%81%E3%83%95%E3%83%AC%E3%83%BC%E3%83%A0%E3%82%92%E9%80%81%E5%8F%97%E4%BF%A1%E3%81%A7%E3%81%8D%E3%81%BE%E3%81%9B%E3%82%93%E3%80%82%3CBR%20%2F%3E%3CBR%20%2F%3E%E3%82%B3%E3%83%BC%E3%83%89%E3%82%92%E5%A4%89%E6%9B%B4%E3%81%97%E3%81%A6%E3%80%81%E3%82%88%E3%82%8A%E5%8D%98%E7%B4%94%E3%81%AA%E3%83%90%E3%83%BC%E3%82%B8%E3%83%A7%E3%83%B3%E3%82%92%E4%BD%9C%E6%88%90%E3%81%97%E3%81%BE%E3%81%97%E3%81%9F%E3%80%82evkbmimxrt1170_enet_txrx_transfer_cm7%E3%82%B5%E3%83%B3%E3%83%97%E3%83%AB%E3%82%B3%E3%83%BC%E3%83%89%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%A6%E3%80%81%E4%BD%95%E3%82%92%E5%A4%89%E6%9B%B4%E3%81%99%E3%82%8B%E5%BF%85%E8%A6%81%E3%81%8C%E3%81%82%E3%82%8B%E3%81%AE%E3%81%8B%E3%82%92%E3%82%AC%E3%82%A4%E3%83%89%E3%81%97%E3%81%A6%E3%81%8F%E3%81%A0%E3%81%95%E3%81%84%E3%80%82%E7%A7%81%E3%81%AFATTech%E3%83%97%E3%83%AD%E3%82%B8%E3%82%A7%E3%82%AF%E3%83%88%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%81%A7%E3%81%99%E3%80%82%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%23include%20%E3%80%8Cfsl_debug_console.h%E3%80%8D%3CBR%20%2F%3E%3CBR%20%2F%3E%23include%E3%80%8Cfsl_silicon_id.h%E3%80%8D%3CBR%20%2F%3E%3CBR%20%2F%3E%23include%20%E3%80%8Cfsl_enet.h%E3%80%8D%3CBR%20%2F%3E%3CBR%20%2F%3E%23include%E3%80%8Cfsl_phy.h%E3%80%8D%3CBR%20%2F%3E%3CBR%20%2F%3E%23include%E3%80%8Cboard.h%E3%80%8D%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%23include%20%E3%80%8Cfsl_phyrtl8201.h%E3%80%8D%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%23include%20%E3%80%8Cfsl_enet.h%E3%80%8D%3CBR%20%2F%3E%3CBR%20%2F%3E%23include%E3%80%8Cboard.h%E3%80%8D%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3EENET%20%23define%20EXAMPLE_ENET%3CBR%20%2F%3E%3CBR%20%2F%3E%23define%20EXAMPLE_CLOCK_FREQ%20CLOCK_GetRootClockFreq(kCLOCK_Root_Bus)%3CBR%20%2F%3E%3CBR%20%2F%3E%23define%20ENET_RXBD_NUM%204%3CBR%20%2F%3E%3CBR%20%2F%3E%23define%20ENET_TXBD_NUM%204%3CBR%20%2F%3E%3CBR%20%2F%3E%23define%20ENET_RXBUFF_SIZE%20ENET_FRAME_MAX_FRAMELEN%3CBR%20%2F%3E%3CBR%20%2F%3E%23define%20ENET_TXBUFF_SIZE%20ENET_FRAME_MAX_FRAMELEN%3CBR%20%2F%3E%3CBR%20%2F%3E%23define%20ENET_DATA_LENGTH%201000%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%2F*%20%E3%83%90%E3%83%83%E3%83%95%E3%82%A1%E8%A8%98%E8%BF%B0%E5%AD%90%20*%2F%3CBR%20%2F%3E%3CBR%20%2F%3EAT_NONCACHEABLE_SECTION_ALIGN(enet_rx_bd_struct_t%20g_rxBuffDescrip%5BENET_RXBD_NUM%5D%2C%20ENET_BUFF_ALIGNMENT)%3B%3CBR%20%2F%3E%3CBR%20%2F%3EAT_NONCACHEABLE_SECTION_ALIGN(enet_tx_bd_struct_t%20g_txBuffDescrip%5BENET_TXBD_NUM%5D%2C%20ENET_BUFF_ALIGNMENT)%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%2F*%20%E3%83%87%E3%83%BC%E3%82%BF%E3%83%90%E3%83%83%E3%83%95%E3%82%A1%20*%2F%3CBR%20%2F%3E%3CBR%20%2F%3ESDK_ALIGN(uint8_t%20g_rxDataBuff%5BENET_RXBD_NUM%5D%5BENET_RXBUFF_SIZE%5D%2C%20ENET_BUFF_ALIGNMENT)%3B%3CBR%20%2F%3E%3CBR%20%2F%3ESDK_ALIGN(uint8_t%20g_txDataBuff%5BENET_TXBD_NUM%5D%5BENET_TXBUFF_SIZE%5D%2C%20ENET_BUFF_ALIGNMENT)%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%2F*%20MAC%E3%82%A2%E3%83%89%E3%83%AC%E3%82%B9%20*%2F%3CBR%20%2F%3E%3CBR%20%2F%3Euint8_t%20g_macAddr%5B6%5D%20%3D%3CBR%20%2F%3E%3CBR%20%2F%3E%7B%200x02%2C%200x12%2C%200x13%2C%200x14%2C%200x15%2C%200x16%20%7D%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%2F*%20ENET%E3%83%8F%E3%83%B3%E3%83%89%E3%83%AB%20*%2F%3CBR%20%2F%3E%3CBR%20%2F%3E%E9%9D%99%E7%9A%84enet_handle_t%20g_handle%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3Estatic%20void%20BuildTestFrame(uint8_t%20*%E3%83%95%E3%83%AC%E3%83%BC%E3%83%A0)%3CBR%20%2F%3E%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%3CBR%20%2F%3E%2F*%20%E5%AE%9B%E5%85%88%20MAC%20(%E3%83%96%E3%83%AD%E3%83%BC%E3%83%89%E3%82%AD%E3%83%A3%E3%82%B9%E3%83%88)%20*%2F%3CBR%20%2F%3E%3CBR%20%2F%3Efor%20(int%20i%20%3D%200%3B%20i%20%26lt%3B%206%3B%20i%2B%2B)%3CBR%20%2F%3E%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%3CBR%20%2F%3E%E3%83%95%E3%83%AC%E3%83%BC%E3%83%A0%5Bi%5D%20%3D%200xFF%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%2F*%20%E3%82%BD%E3%83%BC%E3%82%B9%20MAC%20*%2F%3CBR%20%2F%3E%3CBR%20%2F%3Ememcpy(%26amp%3Bframe%5B6%5D%2C%20g_macAddr%2C%206)%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%2F*%20EtherType%2F%E9%95%B7%E3%81%95%20*%2F%3CBR%20%2F%3E%3CBR%20%2F%3E%E3%83%95%E3%83%AC%E3%83%BC%E3%83%A0%5B12%5D%20%3D%200x08%3BIPv4%E3%81%AE%3CBR%20%2F%3E%3CBR%20%2F%3E%E3%83%95%E3%83%AC%E3%83%BC%E3%83%A0%5B13%5D%20%3D%200x00%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%2F*%20%E5%8D%98%E7%B4%94%E3%81%AA%E3%83%9A%E3%82%A4%E3%83%AD%E3%83%BC%E3%83%89%20*%2F%3CBR%20%2F%3E%3CBR%20%2F%3Efor%20(int%20i%20%3D%2014%3B%20i%20%26lt%3B%20ENET_DATA_LENGTH%3B%20i%2B%2B)%3CBR%20%2F%3E%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%3CBR%20%2F%3E%E3%83%95%E3%83%AC%E3%83%BC%E3%83%A0%5Bi%5D%20%3D%20i%20%25%20256%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3Evoid%20InitEthernet(%E3%83%9C%E3%82%A4%E3%83%89)%3CBR%20%2F%3E%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%3CBR%20%2F%3Eenet_config_t%20config%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%2F*%20%E3%83%90%E3%83%83%E3%83%95%E3%82%A1%E6%A7%8B%E6%88%90%E3%81%AE%E6%BA%96%E5%82%99%20*%2F%3CBR%20%2F%3E%3CBR%20%2F%3Eenet_buffer_config_t%20buffConfig%20%3D%3CBR%20%2F%3E%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%3CBR%20%2F%3EENET_RXBD_NUM%E3%80%81%3CBR%20%2F%3E%3CBR%20%2F%3EENET_TXBD_NUM%E3%80%81%3CBR%20%2F%3E%3CBR%20%2F%3EENET_RXBUFF_SIZE%E3%80%81%3CBR%20%2F%3E%3CBR%20%2F%3EENET_TXBUFF_SIZE%E3%80%81g_rxBuffDescrip%E3%80%81g_txBuffDescrip%E3%80%81%26amp%3Bg_rxDataBuff%5B0%5D%5B0%5D%E3%80%81%26amp%3Bg_txDataBuff%5B0%5D%5B0%5D%E3%80%81%3CBR%20%2F%3E%3CBR%20%2F%3E%E7%9C%9F%3CBR%20%2F%3E%3CBR%20%2F%3E%E7%9C%9F%3CBR%20%2F%3E%3CBR%20%2F%3ENULL%20%7D%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%2F*%20%E3%83%87%E3%83%95%E3%82%A9%E3%83%AB%E3%83%88%E3%81%AE%20ENET%20%E8%A8%AD%E5%AE%9A%E3%82%92%E5%8F%96%E5%BE%97%20*%2F%3CBR%20%2F%3E%3CBR%20%2F%3EENET_GetDefaultConfig(%26amp%3Bconfig)%3B%3CBR%20%2F%3E%3CBR%20%2F%3Econfig.miiMode%20%3D%20kENET_RmiiMode%3B%3CBR%20%2F%3E%3CBR%20%2F%3Econfig.miiSpeed%20%3D%20kENET_MiiSpeed100M%3B%3CBR%20%2F%3E%3CBR%20%2F%3Econfig.miiDuplex%20%3D%20kENET_MiiFullDuplex%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%2F*%20ENET%E3%82%92%E5%88%9D%E6%9C%9F%E5%8C%96%E3%81%97%E3%81%BE%E3%81%99%20*%2F%3CBR%20%2F%3E%3CBR%20%2F%3EENET_Init(EXAMPLE_ENET%2C%20%26amp%3Bg_handle%2C%20%26amp%3Bconfig%2C%20%26amp%3BbuffConfig%2C%20g_macAddr%2C%20EXAMPLE_CLOCK_FREQ)%3B%3CBR%20%2F%3E%3CBR%20%2F%3EENET_ActiveRead(EXAMPLE_ENET)%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3Eint%20main(void)%3CBR%20%2F%3E%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%3CBR%20%2F%3Euint8_t%20txFrame%5BENET_DATA_LENGTH%5D%3B%3CBR%20%2F%3E%3CBR%20%2F%3Euint8_t%20rxBuffer%5BENET_RXBUFF_SIZE%5D%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%2F*%20%E3%83%8F%E3%83%BC%E3%83%89%E3%82%A6%E3%82%A7%E3%82%A2%E3%81%AE%E5%88%9D%E6%9C%9F%E5%8C%96%20*%2F%3CBR%20%2F%3E%3CBR%20%2F%3EBOARD_InitHardware()%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%2F*%20%E3%82%A4%E3%83%BC%E3%82%B5%E3%83%8D%E3%83%83%E3%83%88%E3%82%92%E5%88%9D%E6%9C%9F%E5%8C%96%20*%2F%3CBR%20%2F%3E%3CBR%20%2F%3EInitEthernet()%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%2F*%20%E3%83%86%E3%82%B9%E3%83%88%E3%83%95%E3%83%AC%E3%83%BC%E3%83%A0%E3%82%92%E3%83%93%E3%83%AB%E3%83%89%20*%2F%3CBR%20%2F%3E%3CBR%20%2F%3EBuildTestFrame(txFrame)%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E(1)%E3%81%AA%E3%81%8C%E3%82%89%3CBR%20%2F%3E%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%3CBR%20%2F%3Euint32_t%20frameLength%20%3D%200%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%2F*%20%E5%8F%97%E4%BF%A1%E3%81%97%E3%81%9F%E3%83%95%E3%83%AC%E3%83%BC%E3%83%A0%E3%82%92%E7%A2%BA%E8%AA%8D%20*%2F%3CBR%20%2F%3E%3CBR%20%2F%3Eif%20(ENET_GetRxFrameSize(%26amp%3Bg_handle%2C%20%26amp%3BframeLength%2C%200)%20%3D%3D%20kStatus_Success)%3CBR%20%2F%3E%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%3CBR%20%2F%3Eif%20(frameLength%20%26gt%3B%200)%3CBR%20%2F%3E%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%3CBR%20%2F%3E%2F*%20%E3%83%95%E3%83%AC%E3%83%BC%E3%83%A0%E3%82%92%E8%AA%AD%E3%81%BF%E8%BE%BC%E3%82%80%20*%2F%3CBR%20%2F%3E%3CBR%20%2F%3Eif%20(ENET_ReadFrame(EXAMPLE_ENET%2C%20%26amp%3Bg_handle%2C%20rxBuffer%2C%20frameLength%2C%200%2C%20NULL)%20%3D%3D%20kStatus_Success)%3CBR%20%2F%3E%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%3CBR%20%2F%3E%2F*%20%E5%8F%97%E4%BF%A1%E3%81%97%E3%81%9F%E3%83%95%E3%83%AC%E3%83%BC%E3%83%A0%E3%82%92%E3%81%93%E3%81%93%E3%81%A7%E5%87%A6%E7%90%86%E3%81%97%E3%81%BE%E3%81%99%20*%2F%3CBR%20%2F%3E%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%2F*%20%E3%83%86%E3%82%B9%E3%83%88%E3%83%95%E3%83%AC%E3%83%BC%E3%83%A0%E3%82%92%E9%80%81%E4%BF%A1%20*%2F%3CBR%20%2F%3E%3CBR%20%2F%3Estatus_t%20ENET_SendFrame(ENET_Type%20*base%2C%20enet_handle_t%20*handle%2C%20const%20uint8_t%20*data%2C%20uint32_t%E3%81%AE%E9%95%B7%E3%81%95%2C%20uint8_t%20ringId%2C%3CBR%20%2F%3E%3CBR%20%2F%3Ebool%20tsFlag%2C%20void%20*context)%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3EENET_SendFrame(EXAMPLE_ENET%2C%20%26amp%3Bg_handle%2C%20txFrame%2C%20ENET_DATA_LENGTH%2C%200%2C%20false%2C%20NULL)%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%2F*%20%E3%82%8F%E3%81%9A%E3%81%8B%E3%81%AA%E9%81%85%E5%BB%B6%20*%2F%3CBR%20%2F%3E%3CBR%20%2F%3Efor%20(volatile%20int%20i%20%3D%200%3B%20i%20%26lt%3B%201000000%3B%20i%2B%2B)%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%E3%81%9D%E3%81%AE%E7%82%B9%E3%81%A7%E3%80%81%20'PHY_LinkStatusChange'%E3%81%B8%E3%81%AE%E6%9C%AA%E5%AE%9A%E7%BE%A9%E3%81%AE%E5%8F%82%E7%85%A7%E3%82%82%E3%82%A8%E3%83%A9%E3%83%BC%E3%81%8C%E7%99%BA%E7%94%9F%E3%81%97%E3%81%A6%E3%81%84%E3%81%BE%E3%81%99%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E