AnsweredAssumed Answered

RL-TCP Ping Problem

Question asked by aydogdu.ali on Apr 11, 2017

hi,

I was working ping problem on rl-tcp for three days. I want the device to connect ethernet with rl-tcp. But always ping is at timeout. I used ETH_STM32x.c library , STM32F745ZET processor and DP83848 . Is there anybody who has idea? I put the ETH_STM32x.c and Net_Config.c and main.c

 

ETM_STM32x.c file : 

 

#include <Net_Config.h>
#include <stm32f7xx.h>
#include "ETH_STM32x.h"
#include "stm32f7xx_hal.h"
/* The following macro definitions may be used to select the speed
of the physical link:

_10MBIT_ - connect at 10 MBit only
_100MBIT_ - connect at 100 MBit only

By default an autonegotiation of the link speed is used. This may take
longer to connect, but it works for 10MBit and 100MBit physical links. */

/* Net_Config.c */
extern U8 own_hw_adr[];

/* Local variables */
static U8 TxBufIndex;
static U8 RxBufIndex;

/* ENET local DMA Descriptors. */
static RX_Desc Rx_Desc[NUM_RX_BUF];
static TX_Desc Tx_Desc[NUM_TX_BUF];

/* ENET local DMA buffers. */
static U32 rx_buf[NUM_RX_BUF][ETH_BUF_SIZE>>2];
static U32 tx_buf[NUM_TX_BUF][ETH_BUF_SIZE>>2];

struct netif {
/** pointer to next in linked list */
struct netif *next;
uint16_t mtu;
/** number of bytes used in hwaddr */
uint8_t hwaddr_len;
/** link level hardware address of this interface */
uint8_t hwaddr[6];
/** flags (see NETIF_FLAG_ above) */
uint8_t flags;

};

struct netif *netif;

#if defined ( __CC_ARM )
ETH_DMADescTypeDef DMARxDscrTab[ETH_RXBUFNB] __attribute__((at(0x20002000)));/* Ethernet Rx MA Descriptor */

ETH_DMADescTypeDef DMATxDscrTab[ETH_TXBUFNB] __attribute__((at(0x200020A0)));/* Ethernet Tx DMA Descriptor */

uint8_t Rx_Buff[ETH_RXBUFNB][ETH_RX_BUF_SIZE] __attribute__((at(0x20002140))); /* Ethernet Receive Buffer */

uint8_t Tx_Buff[ETH_TXBUFNB][ETH_TX_BUF_SIZE] __attribute__((at(0x20004480))); /* Ethernet Transmit Buffer */

#elif defined ( __ICCARM__ ) /*!< IAR Compiler */
#pragma data_alignment=4

#pragma location=0x20002000
__no_init ETH_DMADescTypeDef DMARxDscrTab[ETH_RXBUFNB];/* Ethernet Rx MA Descriptor */

#pragma location=0x200020A0
__no_init ETH_DMADescTypeDef DMATxDscrTab[ETH_TXBUFNB];/* Ethernet Tx DMA Descriptor */

#pragma location=0x20002140
__no_init uint8_t Rx_Buff[ETH_RXBUFNB][ETH_RX_BUF_SIZE]; /* Ethernet Receive Buffer */

#pragma location=0x20004480
__no_init uint8_t Tx_Buff[ETH_TXBUFNB][ETH_TX_BUF_SIZE]; /* Ethernet Transmit Buffer */

#elif defined ( __GNUC__ ) /*!< GNU Compiler */

ETH_DMADescTypeDef DMARxDscrTab[ETH_RXBUFNB] __attribute__((section(".RxDecripSection")));/* Ethernet Rx MA Descriptor */

ETH_DMADescTypeDef DMATxDscrTab[ETH_TXBUFNB] __attribute__((section(".TxDescripSection")));/* Ethernet Tx DMA Descriptor */

uint8_t Rx_Buff[ETH_RXBUFNB][ETH_RX_BUF_SIZE] __attribute__((section(".RxarraySection"))); /* Ethernet Receive Buffer */

uint8_t Tx_Buff[ETH_TXBUFNB][ETH_TX_BUF_SIZE] __attribute__((section(".TxarraySection"))); /* Ethernet Transmit Buffer */

#endif

/*----------------------------------------------------------------------------
* ENET Ethernet Driver Functions
*----------------------------------------------------------------------------
* Required functions for Ethernet driver module:
* a. Polling mode: - void init_ethernet ()
* - void send_frame (OS_FRAME *frame)
* - void poll_ethernet (void)
* b. Interrupt mode: - void init_ethernet ()
* - void send_frame (OS_FRAME *frame)
* - void int_enable_eth ()
* - void int_disable_eth ()
* - interrupt function
*---------------------------------------------------------------------------*/

/* Local Function Prototypes */
static void rx_descr_init (void);
static void tx_descr_init (void);
static void write_PHY (U32 PhyReg, U16 Value);
static U16 read_PHY (U32 PhyReg);

ETH_HandleTypeDef heth_STM;
ETH_MACInitTypeDef heth_MAC;
ETH_DMAInitTypeDef heth_DMA;
/*--------------------------- init_ethernet ---------------------------------*/

void init_ethernet (void) {
/* Initialize the ETH ethernet controller. */
U32 regv,tout,id1,id2;
U32 regvalue=0;

GPIO_InitTypeDef GPIO_InitStruct;

__HAL_RCC_SYSCFG_CLK_ENABLE();

__HAL_RCC_GPIOA_CLK_ENABLE();
__HAL_RCC_GPIOB_CLK_ENABLE();
__HAL_RCC_GPIOC_CLK_ENABLE();
__HAL_RCC_GPIOD_CLK_ENABLE();
__HAL_RCC_GPIOE_CLK_ENABLE();
__HAL_RCC_GPIOF_CLK_ENABLE();
__HAL_RCC_GPIOH_CLK_ENABLE();
__HAL_RCC_GPIOG_CLK_ENABLE();

__HAL_RCC_ETH_CLK_ENABLE();


GPIO_InitStruct.Pin = GPIO_PIN_1|GPIO_PIN_4|GPIO_PIN_5;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
GPIO_InitStruct.Alternate = GPIO_AF11_ETH;
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);

GPIO_InitStruct.Pin = GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_7;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
GPIO_InitStruct.Alternate = GPIO_AF11_ETH;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);

GPIO_InitStruct.Pin = GPIO_PIN_12|GPIO_PIN_13;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
GPIO_InitStruct.Alternate = GPIO_AF11_ETH;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);

GPIO_InitStruct.Pin = GPIO_PIN_11;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
GPIO_InitStruct.Alternate = GPIO_AF11_ETH;
HAL_GPIO_Init(GPIOG, &GPIO_InitStruct);

///////////////reset/////////////////
HAL_GPIO_WritePin(GPIOD,GPIO_PIN_7,GPIO_PIN_RESET);
GPIO_InitStruct.Pin= GPIO_PIN_7;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);

RCC->APB2ENR |= RCC_APB2ENR_SYSCFGEN;
RCC->AHB1ENR= RCC_AHB1ENR_ETHMACEN;
RCC->AHB1ENR= RCC_AHB1ENR_ETHMACTXEN;
RCC->AHB1ENR= RCC_AHB1ENR_ETHMACRXEN;

HAL_ETH_DeInit(&heth_STM);

///////////////////////////////////MAC/////////////////
heth_STM.Init.AutoNegotiation = ETH_AUTONEGOTIATION_ENABLE;
heth_STM.Init.Speed = ETH_SPEED_100M;
heth_STM.Init.MediaInterface = ETH_MEDIA_INTERFACE_RMII;
heth_STM.Init.DuplexMode = ETH_MODE_FULLDUPLEX;
heth_MAC.LoopbackMode = ETH_LOOPBACKMODE_DISABLE;
heth_MAC.RetryTransmission = ETH_RETRYTRANSMISSION_DISABLE;
heth_MAC.ReceiveAll = ETH_RECEIVEAll_DISABLE;
heth_MAC.BroadcastFramesReception = ETH_BROADCASTFRAMESRECEPTION_ENABLE;
heth_MAC.PromiscuousMode = ETH_PROMISCIOUSMODE_DISABLE;
heth_MAC.MulticastFramesFilter = ETH_MULTICASTFRAMESFILTER_PERFECT;
heth_MAC.UnicastFramesFilter = ETH_UNICASTFRAMESFILTER_PERFECT;
heth_MAC.ChecksumOffload = ETH_CHECKSUMOFFLAOD_ENABLE;
///////////////////////////DMA///////////////////////////
heth_DMA.DropTCPIPChecksumErrorFrame = ETH_DROPTCPIPCHECKSUMERRORFRAME_ENABLE;
heth_DMA.ReceiveStoreForward = ETH_RECEIVESTOREFORWARD_ENABLE;
heth_DMA.TransmitStoreForward = ETH_TRANSMITSTOREFORWARD_ENABLE;
heth_DMA.ForwardErrorFrames = ETH_FORWARDERRORFRAMES_DISABLE;
heth_DMA.ForwardUndersizedGoodFrames = ETH_FORWARDUNDERSIZEDGOODFRAMES_DISABLE;
heth_DMA.SecondFrameOperate = ETH_SECONDFRAMEOPERARTE_ENABLE;
heth_DMA.AddressAlignedBeats = ETH_ADDRESSALIGNEDBEATS_ENABLE;
heth_DMA.FixedBurst = ETH_FIXEDBURST_ENABLE;
heth_DMA.RxDMABurstLength = ETH_RXDMABURSTLENGTH_32BEAT;
heth_DMA.TxDMABurstLength = ETH_TXDMABURSTLENGTH_32BEAT;
heth_DMA.DMAArbitration = ETH_DMAARBITRATION_ROUNDROBIN_RXTX_2_1;

heth_STM.Init.PhyAddress = DP83848_PHY_ADDRESS;

#if 1
HAL_ETH_Init(&heth_STM);

/* MDC Clock range 60-72MHz. */
ETH->MACMIIAR &= MACMIIAR_CR_MASK;
ETH->MACMIIAR |= 0x00000004;

#if 1
/* Put the DP83848C in reset mode */
write_PHY (PHY_REG_BMCR, 0x8000);

/* Wait for hardware reset to end. */
for (tout = 0; tout < 0x10000; tout++) {
regv = read_PHY (PHY_REG_BMCR);
if (!(regv & 0x8800)) {
/* Reset complete, device not Power Down. */
printf("Reset complete, device not Power Down. \r\n");
break;
}
}

/* Check if this is a DP83848C PHY. */
id1 = read_PHY (PHY_REG_IDR1);
id2 = read_PHY (PHY_REG_IDR2);
printf("id1 -> %u id2 -> %u \r\n",id1,id2);

if (((id1 << 16) | (id2 & 0xFFF0)) == DP83848C_ID) {
/* Configure the PHY device */
#if defined (_10MBIT_)
/* Connect at 10MBit */
write_PHY (PHY_REG_BMCR, PHY_FULLD_10M);
#elif defined (_100MBIT_)
/* Connect at 100MBit */
printf("Connect at 100Mbit \r\n");
write_PHY (PHY_REG_BMCR, PHY_FULLD_100M);
#else
/* Use autonegotiation about the link speed. */
write_PHY (PHY_REG_BMCR, PHY_AUTO_NEG);
/* Wait to complete Auto_Negotiation. */
for (tout = 0; tout < 0x10000; tout++) {
regv = read_PHY (PHY_REG_BMSR);
if (regv & 0x0020) {
printf("Autonegotiation Complete. \r\n");
/* Autonegotiation Complete. */
break;
}
}
#endif
}

/* Check the link status. */
for (tout = 0; tout < 0x10000; tout++) {
regv = read_PHY (PHY_REG_STS);
if (regv & 0x0001) {
/* Link is on. */
printf("Link is on. \r\n");
break;
}
}

/* Initialize MAC control register */
ETH->MACCR = MCR_ROD;

/* Configure Full/Half Duplex mode. */
if (regv & 0x0004) {
/* Full duplex is enabled. */
ETH->MACCR |= MCR_DM;
}

/* Configure 100MBit/10MBit mode. */
if ((regv & 0x0002) == 0) {
/* 100MBit mode. */
printf("100MBit mode.\r\n");
ETH->MACCR |= MCR_FES;
}
#endif
/* MAC address filtering, accept multicast packets. */
ETH->MACFFR = MFFR_HPF | MFFR_PAM;
ETH->MACFCR = MFCR_ZQPD;

/* Set the Ethernet MAC Address registers */
ETH->MACA0HR = ((U32)own_hw_adr[5] << 8) | (U32)own_hw_adr[4];
ETH->MACA0LR = ((U32)own_hw_adr[3] << 24) | (U32)own_hw_adr[2] << 16 |
((U32)own_hw_adr[1] << 8) | (U32)own_hw_adr[0];

/* Initialize Tx and Rx DMA Descriptors */
rx_descr_init ();
tx_descr_init ();

/* Flush FIFO, start DMA Tx and Rx */
ETH->DMAOMR = DOMR_FTF | DOMR_ST | DOMR_SR;

/* Enable receiver and transmiter */
ETH->MACCR |= MCR_TE | MCR_RE;

/* Reset all interrupts */
ETH->DMASR = 0xFFFFFFFF;

/* Enable Rx and NIS interrupts. */
ETH->DMAIER = INT_NISE | INT_RIE | INT_AISE | INT_RBUIE;
#endif


}

/*--------------------------- int_enable_eth --------------------------------*/

void int_enable_eth (void) {
/* Ethernet Interrupt Enable function. */
NVIC->ISER[1] = 1 << 29;
// NVIC_EnableIRQ(ETH_IRQn);
printf(" int_enable_eth \r\n");
}


/*--------------------------- int_disable_eth -------------------------------*/

void int_disable_eth (void) {
/* Ethernet Interrupt Disable function. */
NVIC->ICER[1] = 1 << 29;
//NVIC_DisableIRQ(ETH_IRQn);
printf(" int_disable_eth \r\n");
}


/*--------------------------- send_frame ------------------------------------*/

void send_frame (OS_FRAME *frame) {
/* Send frame to ETH ethernet controller */
U32 *sp,*dp;
U32 i,j;
printf(" send_frame \r\n");
j = TxBufIndex;
/* Wait until previous packet transmitted. */
while (Tx_Desc[j].CtrlStat & DMA_TX_OWN);

sp = (U32 *)&frame->data[0];
dp = (U32 *)(Tx_Desc[j].Addr & ~3);

/* Copy frame data to ETH IO buffer. */
for (i = (frame->length + 3) >> 2; i; i--) {
*dp++ = *sp++;
}
Tx_Desc[j].Size = frame->length;
Tx_Desc[j].CtrlStat |= DMA_TX_OWN;
if (++j == NUM_TX_BUF) j = 0;
TxBufIndex = j;
/* Start frame transmission. */
ETH->DMASR = DSR_TPSS;
ETH->DMATPDR = 0;
}


/*--------------------------- interrupt_ethernet ----------------------------*/
#if 0
void ETH_IRQHandler (void) {
/* Ethernet Controller Interrupt function. */
OS_FRAME *frame;
U32 i,RxLen;
U32 *sp,*dp;
printf(" ETH_IRQHandler \r\n");
i = RxBufIndex;
do {
/* Valid frame has been received. */
if (Rx_Desc[i].Stat & DMA_RX_ERROR_MASK) {
goto rel;
}
if ((Rx_Desc[i].Stat & DMA_RX_SEG_MASK) != DMA_RX_SEG_MASK) {
goto rel;
}
RxLen = ((Rx_Desc[i].Stat >> 16) & 0x3FFF) - 4;
if (RxLen > ETH_MTU) {
/* Packet too big, ignore it and free buffer. */
goto rel;
}
/* Flag 0x80000000 to skip sys_error() call when out of memory. */
frame = alloc_mem (RxLen | 0x80000000);
/* if 'alloc_mem()' has failed, ignore this packet. */
if (frame != NULL) {
sp = (U32 *)(Rx_Desc[i].Addr & ~3);
dp = (U32 *)&frame->data[0];
for (RxLen = (RxLen + 3) >> 2; RxLen; RxLen--) {
*dp++ = *sp++;
}
put_in_queue (frame);
}
/* Release this frame from ETH IO buffer. */
rel:Rx_Desc[i].Stat = DMA_RX_OWN;

if (++i == NUM_RX_BUF) i = 0;
} while ((Rx_Desc[i].Stat & DMA_RX_OWN) == 0);
RxBufIndex = i;

if (ETH->DMASR & INT_RBUIE) {
/* Rx DMA suspended, resume DMA reception. */
ETH->DMASR = INT_RBUIE;
ETH->DMARPDR = 0;
}
/* Clear the interrupt pending bits. */
ETH->DMASR = INT_NISE | INT_RIE;
}
#endif

/*--------------------------- rx_descr_init ---------------------------------*/

static void rx_descr_init (void) {
/* Initialize Receive DMA Descriptor array. */
U32 i,next;
printf("rx_descr_init \r\n");
RxBufIndex = 0;
for (i = 0, next = 0; i < NUM_RX_BUF; i++) {
if (++next == NUM_RX_BUF) next = 0;
Rx_Desc[i].Stat = DMA_RX_OWN;
Rx_Desc[i].Ctrl = DMA_RX_RCH | ETH_BUF_SIZE;
Rx_Desc[i].Addr = (U32)&rx_buf[i];
Rx_Desc[i].Next = (U32)&Rx_Desc[next];
}
ETH->DMARDLAR = (U32)&Rx_Desc[0];
}

 

/*--------------------------- tx_descr_init ---------------------------------*/

static void tx_descr_init (void) {
/* Initialize Transmit DMA Descriptor array. */
U32 i,next;
printf("tx_descr_init \r\n");
TxBufIndex = 0;
for (i = 0, next = 0; i < NUM_TX_BUF; i++) {
if (++next == NUM_TX_BUF) next = 0;
Tx_Desc[i].CtrlStat = DMA_TX_TCH | DMA_TX_LS | DMA_TX_FS;
Tx_Desc[i].Addr = (U32)&tx_buf[i];
Tx_Desc[i].Next = (U32)&Tx_Desc[next];
}
ETH->DMATDLAR = (U32)&Tx_Desc[0];
}


/*--------------------------- write_PHY -------------------------------------*/

static void write_PHY (U32 PhyReg, U16 Value) {
/* Write a data 'Value' to PHY register 'PhyReg'. */
U32 tout;
printf(" Write-PhyReg -> %u Value -> %u \r\n",PhyReg,Value);
ETH->MACMIIDR = Value;
ETH->MACMIIAR = DP83848C_DEF_ADR << 11 | PhyReg << 6 | MMAR_MW | MMAR_MB;

/* Wait utill operation completed */
tout = 0;
for (tout = 0; tout < MII_WR_TOUT; tout++) {
if ((ETH->MACMIIAR & MMAR_MB) == 0) {
break;
}
}
}


/*--------------------------- read_PHY --------------------------------------*/

static U16 read_PHY (U32 PhyReg) {
/* Read a PHY register 'PhyReg'. */
U32 tout;
printf(" Read-PhyReg -> %u \r\n", PhyReg);
ETH->MACMIIAR = DP83848C_DEF_ADR << 11 | PhyReg << 6 | MMAR_MB;

/* Wait until operation completed */
tout = 0;
for (tout = 0; tout < MII_RD_TOUT; tout++) {
if ((ETH->MACMIIAR & MMAR_MB) == 0) {
break;
}
}
return (ETH->MACMIIDR & MMDR_MD);
}

/*----------------------------------------------------------------------------
* end of file
*---------------------------------------------------------------------------*/

 

Net_config.c file: 

 

/*----------------------------------------------------------------------------
* RL-ARM - TCPnet
*----------------------------------------------------------------------------
* Name: NET_CONFIG.C
* Purpose: Configuration of RL TCPnet by user
* Rev.: V4.72
*----------------------------------------------------------------------------
* This code is part of the RealView Run-Time Library.
* Copyright (c) 2004-2013 KEIL - An ARM Company. All rights reserved.
*---------------------------------------------------------------------------*/

#include <Net_Config.h>

//-------- <<< Use Configuration Wizard in Context Menu >>> -----------------
//
// <h>System Definitions
// =====================
// <i> Global TCPnet System definitions
// <s.15>Local Host Name
// <i> This is the name under which embedded host
// <i> can be accessed on a local area network.
// <i> Default: "mcb2300"
#define LHOST_NAME "olaylar"

// <o>Memory Pool size <1536-262144:4><#/4>
// <i> This is the size of a memory pool in bytes. Buffers for
// <i> TCPnet packets are allocated from this memory pool.
// <i> Default: 8000 bytes
#define MEM_SIZE 2048

// <o>Tick Timer interval <10=> 10 ms <20=> 20 ms <25=> 25 ms
// <40=> 40 ms <50=> 50 ms <100=> 100 ms
// <200=> 200 ms
// <i> System Tick Timer interval for software timers
// <i> Default: 100 ms
#define TICK_INTERVAL 100

// </h>
// <e>Ethernet Network Interface
// =============================
// <i> Enable or disable Ethernet Network Interface
#define ETH_ENABLE 1

// <h>MAC Address
// ==============
// <i> Local Ethernet MAC Address
// <i> Value FF:FF:FF:FF:FF:FF is not allowed.
// <i> It is an ethernet Broadcast MAC address.
// <o>Address byte 1 <0x00-0xff:2>
// <i> LSB is an ethernet Multicast bit.
// <i> Must be 0 for local MAC address.
// <i> Default: 0x00
#define _MAC1 0x1E

// <o>Address byte 2 <0x00-0xff>
// <i> Default: 0x30
#define _MAC2 0x30

// <o>Address byte 3 <0x00-0xff>
// <i> Default: 0x6C
#define _MAC3 0x6C

// <o>Address byte 4 <0x00-0xff>
// <i> Default: 0x00
#define _MAC4 0xA2

// <o>Address byte 5 <0x00-0xff>
// <i> Default: 0x00
#define _MAC5 0x45

// <o>Address byte 6 <0x00-0xff>
// <i> Default: 0x01
#define _MAC6 0x5E

// </h>
// <h>IP Address
// =============
// <i> Local Static IP Address
// <i> Value 255.255.255.255 is not allowed.
// <i> It is a Broadcast IP address.
// <o>Address byte 1 <0-255>
// <i> Default: 192
#define _IP1 10

// <o>Address byte 2 <0-255>
// <i> Default: 168
#define _IP2 0

// <o>Address byte 3 <0-255>
// <i> Default: 0
#define _IP3 70

// <o>Address byte 4 <0-255>
// <i> Default: 100
#define _IP4 11

// </h>
// <h>Subnet mask
// ==============
// <i> Local Subnet mask
// <o>Mask byte 1 <0-255>
// <i> Default: 255
#define _MSK1 255

// <o>Mask byte 2 <0-255>
// <i> Default: 255
#define _MSK2 255

// <o>Mask byte 3 <0-255>
// <i> Default: 255
#define _MSK3 255

// <o>Mask byte 4 <0-255>
// <i> Default: 0
#define _MSK4 0

// </h>
// <h>Default Gateway
// ==================
// <i> Default Gateway IP Address
// <o>Address byte 1 <0-255>
// <i> Default: 192
#define _GW1 10

// <o>Address byte 2 <0-255>
// <i> Default: 168
#define _GW2 0

// <o>Address byte 3 <0-255>
// <i> Default: 0
#define _GW3 70

// <o>Address byte 4 <0-255>
// <i> Default: 254
#define _GW4 2

// </h>
// <h>Primary DNS Server
// =====================
// <i> Primary DNS Server IP Address
// <o>Address byte 1 <0-255>
// <i> Default: 194
#define _pDNS1 194

// <o>Address byte 2 <0-255>
// <i> Default: 25
#define _pDNS2 25

// <o>Address byte 3 <0-255>
// <i> Default: 2
#define _pDNS3 2

// <o>Address byte 4 <0-255>
// <i> Default: 129
#define _pDNS4 129

// </h>
// <h>Secondary DNS Server
// =======================
// <i> Secondary DNS Server IP Address
// <o>Address byte 1 <0-255>
// <i> Default: 194
#define _sDNS1 194

// <o>Address byte 2 <0-255>
// <i> Default: 25
#define _sDNS2 25

// <o>Address byte 3 <0-255>
// <i> Default: 2
#define _sDNS3 2

// <o>Address byte 4 <0-255>
// <i> Default: 130
#define _sDNS4 130

// </h>
// <h>ARP Definitions
// ==================
// <i> Address Resolution Protocol Definitions
// <o>Cache Table size <5-100>
// <i> Number of cached hardware/IP addresses
// <i> Default: 10
#define ARP_TABSIZE 10

// <o>Cache Timeout in seconds <5-255>
// <i> A timeout for a cached hardware/IP addresses
// <i> Default: 150
#define ARP_TIMEOUT 150

// <o>Number of Retries <0-20>
// <i> Number of Retries to resolve an IP address
// <i> before ARP module gives up
// <i> Default: 4
#define ARP_MAXRETRY 4

// <o>Resend Timeout in seconds <1-10>
// <i> A timeout to resend the ARP Request
// <i> Default: 2
#define ARP_RESEND 2

// <q>Send Notification on Address changes
// <i> When this option is enabled, the embedded host
// <i> will send a Gratuitous ARP notification at startup,
// <i> or when the device IP address has changed.
// <i> Default: Disabled
#define ARP_NOTIFY 1

// </h>
// <e>IGMP Group Management
// ========================
// <i> Enable or disable Internet Group Management Protocol
#define IGMP_ENABLE 1 // 0

// <o>Membership Table size <2-50>
// <i> Number of Groups this host can join
// <i> Default: 5
#define IGMP_TABSIZE 5

// </e>
// <q>NetBIOS Name Service
// =======================
// <i> When this option is enabled, the embedded host can be
// <i> accessed by his name on the local LAN using NBNS protocol.
#define NBNS_ENABLE 1

// <e>Dynamic Host Configuration
// =============================
// <i> When this option is enabled, local IP address, Net Mask
// <i> and Default Gateway are obtained automatically from
// <i> the DHCP Server on local LAN.
#define DHCP_ENABLE 0

// <s.40>Vendor Class Identifier
// <i> This value is optional. If specified, it is added
// <i> to DHCP request message, identifying vendor type.
// <i> Default: ""
#define DHCP_VCID ""

// <q>Bootfile Name
// <i> This value is optional. If enabled, the Bootfile Name
// <i> (option 67) is also requested from DHCP server.
// <i> Default: disabled
#define DHCP_BOOTF 0

// <q>NTP Servers
// <i> This value is optional. If enabled, a list of NTP Servers
// <i> (option 42) is also requested from DHCP server.
// <i> Default: disabled
#define DHCP_NTPSRV 0

// </e>
// </e>

// <e>PPP Network Interface
// ========================
// <i> Enable or disable PPP Network Interface
#define PPP_ENABLE 0

// <h>IP Address
// =============
// <i> Local Static IP Address
// <o>Address byte 1 <0-255>
// <i> Default: 192
#define _IP1P 0//192

// <o>Address byte 2 <0-255>
// <i> Default: 168
#define _IP2P 0//168

// <o>Address byte 3 <0-255>
// <i> Default: 125
#define _IP3P 0//202

// <o>Address byte 4 <0-255>
// <i> Default: 1
#define _IP4P 0

// </h>
// <h>Subnet mask
// ==============
// <i> Local Subnet mask
// <o>Mask byte 1 <0-255>
// <i> Default: 255
#define _MSK1P 255

// <o>Mask byte 2 <0-255>
// <i> Default: 255
#define _MSK2P 255

// <o>Mask byte 3 <0-255>
// <i> Default: 255
#define _MSK3P 255

// <o>Mask byte 4 <0-255>
// <i> Default: 0
#define _MSK4P 0

// </h>
// <h>Primary DNS Server
// =====================
// <i> Primary DNS Server IP Address
// <o>Address byte 1 <0-255>
// <i> Default: 194
#define _pDNS1P 0

// <o>Address byte 2 <0-255>
// <i> Default: 25
#define _pDNS2P 0

// <o>Address byte 3 <0-255>
// <i> Default: 2
#define _pDNS3P 0

// <o>Address byte 4 <0-255>
// <i> Default: 129
#define _pDNS4P 0

// </h>
// <h>Secondary DNS Server
// =======================
// <i> Secondary DNS Server IP Address
// <o>Address byte 1 <0-255>
// <i> Default: 194
#define _sDNS1P 0

// <o>Address byte 2 <0-255>
// <i> Default: 25
#define _sDNS2P 0

// <o>Address byte 3 <0-255>
// <i> Default: 2
#define _sDNS3P 0

// <o>Address byte 4 <0-255>
// <i> Default: 130
#define _sDNS4P 0

// </h>
// <e>Logon Authentication
// =======================
// <i> Enable or disable user authentication
#define PPP_AUTHEN 0

// <q>Unsecured password (PAP)
// <i>Allow or use Password Authentication Protocol.
#define PPP_PAPEN 0

// <q>Secured password (CHAP-MD5)
// <i>Request or use Challenge Handshake Authentication
// <i>Protocol with MD5 digest algorithm.
#define PPP_CHAPEN 0

// </e>
// <q>Obtain Client IP address automatically
// =========================================
// <i> This option only applies when PPP Dial-up is used to dial
// <i> to remote PPP Server. If checked, network connection
// <i> dynamically obtains an IP address from remote PPP Server.
#define PPP_GETIP 1 // 1

// <q>Use Default Gateway on remote Network
// ========================================
// <i> This option only applies when both Ethernet and PPP Dial-up
// <i> are used. If checked, data that cannot be sent to local LAN
// <i> is forwarded to Dial-up network instead.
#define PPP_DEFGW 1// 1

// <o>Async Control Character Map <0x0-0xffffffff>
// <i> A bit-map of control characters 0-31, which are
// <i> transmitted escaped as a 2 byte sequence.
// <i> For XON/XOFF set this value to: 0x000A 0000
// <i> Default: 0x00000000
#define PPP_ACCM 0x00000000

// <o>LCP Echo Interval in seconds <0-3600>
// <i> If no frames are received within this interval, PPP sends an
// <i> Echo Request and expects an Echo Response from the peer.
// <i> If the response is not received, the link is terminated.
// <i> A value of 0 disables the LCP Echo test.
// <i> Default: 30
#define PPP_ECHOTOUT 30

// <o>Number of Retries <0-20>
// <i> How many times PPP will try to retransmit data
// <i> before giving up. Increase this value for links
// <i> with low baud rates or high latency.
// <i> Default: 3
#define PPP_MAXRETRY 3

// <o>Retry Timeout in seconds <1-10>
// <i> If no response received within this time frame,
// <i> PPP module will try to resend the data again.
// <i> Default: 2
#define PPP_RETRYTOUT 2

// </e>
// <e>SLIP Network Interface
// ========================
// <i> Enable or disable SLIP Network Interface
#define SLIP_ENABLE 0

// <h>IP Address
// =============
// <i> Local Static IP Address
// <o>Address byte 1 <0-255>
// <i> Default: 192
#define _IP1S 192

// <o>Address byte 2 <0-255>
// <i> Default: 168
#define _IP2S 168

// <o>Address byte 3 <0-255>
// <i> Default: 225
#define _IP3S 225

// <o>Address byte 4 <0-255>
// <i> Default: 1
#define _IP4S 1

// </h>
// <h>Subnet mask
// ==============
// <i> Local Subnet mask
// <o>Mask byte 1 <0-255>
// <i> Default: 255
#define _MSK1S 255

// <o>Mask byte 2 <0-255>
// <i> Default: 255
#define _MSK2S 255

// <o>Mask byte 3 <0-255>
// <i> Default: 255
#define _MSK3S 255

// <o>Mask byte 4 <0-255>
// <i> Default: 0
#define _MSK4S 0

// </h>
// <h>Primary DNS Server
// =====================
// <i> Primary DNS Server IP Address
// <o>Address byte 1 <0-255>
// <i> Default: 194
#define _pDNS1S 194

// <o>Address byte 2 <0-255>
// <i> Default: 25
#define _pDNS2S 25

// <o>Address byte 3 <0-255>
// <i> Default: 2
#define _pDNS3S 2

// <o>Address byte 4 <0-255>
// <i> Default: 129
#define _pDNS4S 129

// </h>
// <h>Secondary DNS Server
// =======================
// <i> Secondary DNS Server IP Address
// <o>Address byte 1 <0-255>
// <i> Default: 194
#define _sDNS1S 194

// <o>Address byte 2 <0-255>
// <i> Default: 25
#define _sDNS2S 25

// <o>Address byte 3 <0-255>
// <i> Default: 2
#define _sDNS3S 2

// <o>Address byte 4 <0-255>
// <i> Default: 130
#define _sDNS4S 130

// </h>
// <q>Use Default Gateway on remote Network
// ========================================
// <i> This option only applies when both Ethernet and SLIP Dial-up
// <i> are used. If checked, data that cannot be sent to local LAN
// <i> is forwarded to Dial-up network instead.
#define SLIP_DEFGW 1

// </e>
// <e>UDP Sockets
// ==============
// <i> Enable or disable UDP Sockets
#define UDP_ENABLE 1

// <o>Number of UDP Sockets <1-20>
// <i> Number of available UDP sockets
// <i> Default: 5
#define UDP_NUMSOCKS 3

// </e>
// <e>TCP Sockets
// ==============
// <i> Enable or disable TCP Sockets
#define TCP_ENABLE 1

// <o>Number of TCP Sockets <1-20>
// <i> Number of available TCP sockets
// <i> Default: 5
#define TCP_NUMSOCKS 7

// <o>Number of Retries <0-20>
// <i> How many times TCP module will try to retransmit data
// <i> before giving up. Increase this value for high-latency
// <i> and low_throughput networks.
// <i> Default: 5
#define TCP_MAXRETRY 5

// <o>Retry Timeout in seconds <1-10>
// <i> If data frame not acknowledged within this time frame,
// <i> TCP module will try to resend the data again.
// <i> Default: 4
#define TCP_RETRYTOUT 4

// <o>Default Connect Timeout in seconds <1-600>
// <i> Default TCP Socket Keep Alive timeout. When it expires
// <i> with no TCP data frame send, TCP Connection is closed.
// <i> Default: 120
#define TCP_DEFTOUT 120

// <o>Maximum Segment Size <536-1460>
// <i> The Maximum Segment Size specifies the maximum
// <i> number of bytes in the TCP segment's Data field.
// <i> Default: 1460
#define TCP_MAXSEGSZ 1460

// <o>Receive Window Size <536-65535>
// <i> Receive Window Size specifies the size of data,
// <i> that the socket is able to buffer in flow-control mode.
// <i> Default: 4380
#define TCP_RECWINSZ 4380

/* TCP fixed timeouts */
#define TCP_INIT_RETRY_TOUT 1 /* TCP initial Retransmit period in sec. */
#define TCP_SYN_RETRY_TOUT 2 /* TCP SYN frame retransmit period in sec. */
#define TCP_CONRETRY 7 /* Number of retries to establish a conn. */

// </e>
// <e>HTTP Server
// ==============
// <i> Enable or disable HTTP Server
#define HTTP_ENABLE 1

// <o>Number of HTTP Sessions <1-10>
// <i> Number of simultaneously active HTTP Sessions.
// <i> Default: 3
#define HTTP_NUMSESS 3

// <o>Port Number <1-65535>
// <i> Listening port number.
// <i> Default: 80
#define HTTP_PORTNUM 80

// <s.50>Server-Id header
// <i> This value is optional. If specified, it overrides
// <i> the default HTTP Server header from the library.
// <i> Default: ""
#define HTTP_SRVID ""

// <e>Enable User Authentication
// <i> When enabled, the user will have to authenticate
// <i> himself by username and password before accessing
// <i> any page on this Embedded WEB server.
#define HTTP_ENAUTH 1

// <s.20>Authentication Realm
// <i> Default: "Embedded WEB Server"
#define HTTP_AUTHREALM "Embedded WEB Server"

// <s.15>Authentication Username
// <i> Default: "admin"
#define HTTP_AUTHUSER "admin"

// <s.15>Authentication Password
// <i> Default: ""
#define HTTP_AUTHPASSW ""

// </e>
// </e>
// <e>Telnet Server
// ================
// <i> Enable or disable Telnet Server
#define TNET_ENABLE 1

// <o>Number of Telnet Connections <1-10>
// <i> Number of simultaneously active Telnet Connections.
// <i> Default: 1
#define TNET_NUMSESS 1

// <o>Port Number <1-65535>
// <i> Listening port number.
// <i> Default: 23
#define TNET_PORTNUM 23

// <o>Idle Connection Timeout in seconds <0-3600>
// <i> When timeout expires, the connection is closed.
// <i> A value of 0 disables disconnection on timeout.
// <i> Default: 120
#define TNET_IDLETOUT 120

// <q>Disable Echo
// <i> When disabled, the server will not echo
// <i> characters it receives.
// <i> Default: Not disabled
#define TNET_NOECHO 0

// <e>Enable User Authentication
// <i> When enabled, the user will have to authenticate
// <i> himself by username and password before access
// <i> to the system is allowed.
#define TNET_ENAUTH 1

// <s.15>Authentication Username
// <i> Default: "admin"
#define TNET_AUTHUSER "admin"

// <s.15>Authentication Password
// <i> Default: ""
#define TNET_AUTHPASSW ""

// </e>
// </e>
// <e>TFTP Server
// ==============
// <i> Enable or disable TFTP Server
#define TFTP_ENABLE 0

// <o>Number of TFTP Sessions <1-10>
// <i> Number of simultaneously active TFTP Sessions
// <i> Default: 1
#define TFTP_NUMSESS 1

// <o>Port Number <1-65535>
// <i> Listening port number.
// <i> Default: 69
#define TFTP_PORTNUM 69

// <q>Enable Firewall Support
// <i> Use the same Port Number to receive
// <i> requests and send answers to clients.
// <i> Default: Not Enabled
#define TFTP_ENFWALL 0

// <o>Inactive Session Timeout in seconds <5-120>
// <i> When timeout expires TFTP Session is closed.
// <i> Default: 15
#define TFTP_DEFTOUT 15

// <o>Number of Retries <1-10>
// <i> How many times TFTP Server will try to
// <i> retransmit the data before giving up.
// <i> Default: 4
#define TFTP_MAXRETRY 4

// </e>
// <e>TFTP Client
// ==============
// <i> Enable or disable TFTP Client
#define TFTPC_ENABLE 0

// <o>Block Size <128=>128 <256=>256 <512=>512
// <1024=>1024 <1428=>1428
// <i> Size of transfer block in bytes.
// <i> Default: 512
#define TFTPC_BLOCKSZ 512

// <o>Number of Retries <1-10>
// <i> How many times TFTP Client will try to
// <i> retransmit the data before giving up.
// <i> Default: 4
#define TFTPC_MAXRETRY 4

// <o>Retry Timeout <2=>200 ms <5=>500 ms <10=>1 sec
// <20=>2 sec <50=>5 sec <100=>10 sec
// <i> If data frame not acknowledged within this time frame,
// <i> TFTP Client will try to resend the data again.
// <i> Default: 500 ms
#define TFTPC_RETRYTO 5

// </e>
// <e>FTP Server
// ==============
// <i> Enable or disable FTP Server
#define FTP_ENABLE 0

// <o>Number of FTP Sessions <1-10>
// <i> Number of simultaneously active FTP Sessions
// <i> Default: 1
#define FTP_NUMSESS 3

// <o>Port Number <1-65535>
// <i> Listening port number.
// <i> Default: 21
#define FTP_PORTNUM 21

// <s.50>Welcome Message
// <i> This value is optional. If specified,
// <i> it overrides the default welcome message.
// <i> Default: ""
#define FTP_WELMSG ""

// <o>Idle Session Timeout in seconds <0-3600>
// <i> When timeout expires, the connection is closed.
// <i> A value of 0 disables disconnection on timeout.
// <i> Default: 120
#define FTP_IDLETOUT 120

// <e>Enable User Authentication
// <i> When enabled, the user will have to authenticate
// <i> himself by username and password before access
// <i> to the system is allowed.
#define FTP_ENAUTH 1

// <s.15>Authentication Username
// <i> Default: "admin"
#define FTP_AUTHUSER "admin"

// <s.15>Authentication Password
// <i> Default: ""
#define FTP_AUTHPASSW ""

// </e>
// </e>
// <e>FTP Client
// =============
// <i> Enable or disable FTP Client
#define FTPC_ENABLE 0

// <o>Response Timeout in seconds <1-120>
// <i> This is a time for FTP Client to wait for a response from
// <i> the Server. If timeout expires, Client aborts operation.
// <i> Default: 10
#define FTPC_DEFTOUT 10

// <q>Passive mode (PASV)
// <i> The client initiates a data connection to the server.
// <i> Default: Not passive (Active)
#define FTPC_PASVMODE 0

// </e>
// <e>DNS Client
// =============
// <i> Enable or disable DNS Client
#define DNS_ENABLE 0

// <o>Cache Table size <5-100>
// <i> Number of cached DNS host names/IP addresses
// <i> Default: 20
#define DNS_TABSIZE 20

// </e>
// <e>SMTP Client
// ==============
// <i> Enable or disable SMTP Client
#define SMTP_ENABLE 0

// <o>Response Timeout in seconds <5-120>
// <i> This is a time for SMTP Client to wait for a response from
// <i> SMTP Server. If timeout expires, Client aborts operation.
// <i> Default: 20
#define SMTP_DEFTOUT 20

// </e>
// <e>SNMP Agent
// =============
// <i> Enable or disable SNMP Agent
#define SNMP_ENABLE 0

// <s.15>Community Name
// <i> Defines where an SNMP message is destined for.
// <i> Default: "public"
#define SNMP_COMMUNITY "public"

// <o>Port Number <1-65535>
// <i> Listening port number.
// <i> Default: 161
#define SNMP_PORTNUM 161

// <o>Trap Port Number <1-65535>
// <i> Port number for Trap operations.
// <i> Default: 162
#define SNMP_TRAPPORT 162

// <h>Trap Server
// ==============
// <i> Trap Server IP Address
// <o>Address byte 1 <0-255>
// <i> Default: 192
#define SNMP_TRAPIP1 192

// <o>Address byte 2 <0-255>
// <i> Default: 168
#define SNMP_TRAPIP2 168

// <o>Address byte 3 <0-255>
// <i> Default: 0
#define SNMP_TRAPIP3 202

// <o>Address byte 4 <0-255>
// <i> Default: 100
#define SNMP_TRAPIP4 0

// </h>
// </e>
// <e>SNTP Client
// ==============
// <i> Enable or disable SNTP Client
#define SNTP_ENABLE 0

// <q>Broadcast Mode
// =================
// <i> Enable this option, if you have NTP/SNTP server
// <i> on LAN, which is broadcasting NTP time messages.
// <i> Disable this option to access public NTP server.
// <i> Default: disabled
#define SNTP_BCMODE 0

// <h>NTP Server
// =============
// <i> Server IP Address
// <o>Address byte 1 <0-255>
// <i> Default: 217
#define SNTP_SRVIP1 217

// <o>Address byte 2 <0-255>
// <i> Default: 79
#define SNTP_SRVIP2 79

// <o>Address byte 3 <0-255>
// <i> Default: 179
#define SNTP_SRVIP3 179

// <o>Address byte 4 <0-255>
// <i> Default: 106
#define SNTP_SRVIP4 106

// </h>
// </e>
// <e>BSD Socket Interface
// =======================
// <i> Enable or disable Berkeley Socket Programming Interface
#define BSD_ENABLE 0

// <o>Number of BSD Sockets <1-20>
// <i> Number of available Berkeley Sockets
// <i> Default: 2
#define BSD_NUMSOCKS 2

// <o>Number of Streaming Server Sockets <0-20>
// <i> Defines a number of Streaming (TCP) Server sockets,
// <i> that listen for an incoming connection from the client.
// <i> Default: 1
#define BSD_SRVSOCKS 1

// <o>Receive Timeout in seconds <0-600>
// <i> A timeout for socket receive in blocking mode.
// <i> Timeout value of 0 means indefinite timeout.
// <i> Default: 20
#define BSD_RCVTOUT 20

// <q>Hostname Resolver
// <i> Enable or disable Berkeley style hostname resolver.
#define BSD_GETHOSTEN 0

// </e>
//------------- <<< end of configuration section >>> -----------------------

/*----------------------------------------------------------------------------
* Fatal Error Handler
*---------------------------------------------------------------------------*/

void sys_error (ERROR_CODE code) {
/* This function is called when a fatal error is encountered. The normal */
/* program execution is not possible anymore. Add your crytical error .*/
/* handler code here. */

switch (code) {
case ERR_MEM_ALLOC:
/* Out of memory. */
break;

case ERR_MEM_FREE:
/* Trying to release non existing memory block. */
break;

case ERR_MEM_CORRUPT:
/* Memory Link pointer is Corrupted. */
/* More data written than the size of allocated mem block. */
break;

case ERR_MEM_LOCK:
/* Locked Memory management function (alloc/free) re-entered. */
/* RTX multithread protection malfunctioning, not implemented */
/* or interrupt disable is not functioning correctly. */
break;

case ERR_UDP_ALLOC:
/* Out of UDP Sockets. */
break;

case ERR_TCP_ALLOC:
/* Out of TCP Sockets. */
break;

case ERR_TCP_STATE:
/* TCP State machine in undefined state. */
break;
}

/* End-less loop */
while (1);
}

/*----------------------------------------------------------------------------
* TCPnet Config Functions
*---------------------------------------------------------------------------*/

#define __NET_CONFIG__

#include <Net_lib.c>

/*----------------------------------------------------------------------------
* end of file
*---------------------------------------------------------------------------*/

 

main.c

 

#include "cmsis_os.h" // freertos

#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

#include "stm32f7xx.h"
#include "stm32f7xx_hal.h"

#include "stm32f7xx_hal_uart.h"
#include "stm32f7xx_hal_tim.h"
#include "stm32f7xx_hal_tim_ex.h"


#if 0 // keil rtl-tcp ppp
#include <RTL.h>
#include <Net_Config.h>
//http://www.keil.com/pack/doc/mw/Network/html/group__using__ppp__interfaces__conf.html
//http://www.keil.com/pack/doc/mw/Network/html/group__net_p_p_p___func.html
//http://www.keil.com/support/man/docs/rlarm/rlarm_ppp_listen.htm
//rtl den devam etmek lazim. zor.
#endif

#if 1
#include "mx_inits.h"
#endif

#if 1
#include <RTL.h>
#include <Net_Config.h>
#include "Serial.h"
#include "UartDriver.h"
#endif

bool tick;
uint32_t timerCounter=0;

void ping_host(void);
static void ping_cback(U8 event);

static void ping_cback(U8 event)
{
switch(event)
{
case ICMP_EVT_SUCCESS:
printf("remote host responded to ping \r\n");
break;
case ICMP_EVT_TIMEOUT:
printf("ping timeout \r\n");
break;

}
}

void ping_host(void)
{
U8 hostip[4] = {10,0,70,2};
if(icmp_ping(&hostip[0],ping_cback) == __TRUE)
{
printf("ping started \r\n");
}
else
printf("ping not started \r\n");
}

static void timer_poll()
{
if(SysTick->CTRL & 0x10000)
{
timer_tick();
tick = __TRUE;
}
}

int main(void)
{
/* Enable the CPU Cache */
CPU_CACHE_Enable();

HAL_Init();

/* Configure the system clock to 200 MHz */
SystemClock_Config();

MX_GPIO_Init();

printf("\n\r init_tcpnet_ \n\r");

init_TcpNet();
// ping_host();
while(1)
{
main_TcpNet();
timer_poll();
}

}

void Start_PPP_RLTCP_Task(void const * argument)
{

}


#ifdef USE_FULL_ASSERT
/**
* @brief Reports the name of the source file and the source line number
* where the assert_param error has occurred.
* @param file: pointer to the source file name
* @param line: assert_param error line source number
* @retval None
*/
void assert_failed(uint8_t* file, uint32_t line)
{
/* User can add his own implementation to report the file name and line number,
ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */

/* Infinite loop */
while (1)
{
}
}
#endif

 

 

Outcomes