w5500 getversion

안녕하세요. w5500칩 기반의 이더넷 쉴드를 이용해 통신을 개발중 입니다.
그런데 mcu에 ip는 할당 되지만, 헤라클레스나 아지텀 같은 통신 프로그램으로 접속을 해보면 접속이 되지 않습니다.

그래서 wiz라이브러리에 있는 getVERSIONR 함수를 이용해 버전 값을 읽어보니 '0X00’이 출력 됩니다.

혹시 이것과 통신이 안되는 것이 관련이 있을까요?
아래는 제 코드와 MCU 스팩 입니다.

WIZ IO라이브러리는 최신 버전을 사용 중이며, 하드웨어 연결도 문제가 없음을 확인한 상황입니다.

MCU: NUCLEO-F411RE
이더넷쉴드: https://www.devicemart.co.kr/goods/view?no=34412

**MAIN.C**
#include "main.h"
#include "spi.h"
#include "usart.h"
#include "gpio.h"

/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include <stdio.h>
#include <string.h>

#include "stm32f4xx_hal.h"
#include "loopback.h"
#include "wiz_init.h"
/* USER CODE END Includes */

/* Private typedef -----------------------------------------------------------*/
/* USER CODE BEGIN PTD */

/* USER CODE END PTD */

/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */
/* USER CODE END PD */

/* Private macro -------------------------------------------------------------*/
/* USER CODE BEGIN PM */
wiz_NetInfo	gWIZNETINFO = {.mac = {0xA8, 0x61, 0x0A, 0xAE, 0x6F, 0xB6},
						   .ip = {192, 168, 0, 75},
						   .sn = {255, 255, 255, 0},
						   .gw = {192, 168, 0, 1},
						   .dns = {0, 0, 0, 0},
						   .dhcp = NETINFO_STATIC};
/* USER CODE END PM */

/* Private variables ---------------------------------------------------------*/

/* USER CODE BEGIN PV */

/* USER CODE END PV */

/* Private function prototypes -----------------------------------------------*/
void SystemClock_Config(void);
/* USER CODE BEGIN PFP */
uint8_t eth0_buf[512];
/* USER CODE END PFP */

/* Private user code ---------------------------------------------------------*/
/* USER CODE BEGIN 0 */

/* USER CODE END 0 */

/**
  * @brief  The application entry point.
  * @retval int
  */
int main(void)
{
  /* USER CODE BEGIN 1 */
	uint8_t ret, NetValue;
  /* USER CODE END 1 */

  /* MCU Configuration--------------------------------------------------------*/

  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
  HAL_Init();

  /* USER CODE BEGIN Init */

  /* USER CODE END Init */

  /* Configure the system clock */
  SystemClock_Config();

  /* USER CODE BEGIN SysInit */

  /* USER CODE END SysInit */

  /* Initialize all configured peripherals */
  MX_GPIO_Init();
  MX_USART2_UART_Init();
  MX_SPI1_Init();
  /* USER CODE BEGIN 2 */
  W5500HardwareReset();
  NetValue = wizSystemInit();
  wizchip_setnetinfo(&gWIZNETINFO);
  print_network_information();

  if(NetValue == 1)
	  printf("\r\nNetwork_Info_Setting_Complete\r\n");
  else
  {
	  while(1)
	  {
		  printf("Network_Setting_ERROR!!\r\n");
		  HAL_Delay(1000);
	  }
  }

  if(getVERSIONR() != 0x04)
	  printf("[%d]VERSION ERROR!!\r\n",getVERSIONR());
  else
	  printf("[%d]VERSION CORRECT\r\n",getVERSIONR());

  /* USER CODE END 2 */

  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
  while (1)
  {
    /* USER CODE END WHILE */

    /* USER CODE BEGIN 3 */
	  ret = loopback_tcps(0, eth0_buf, 11000);

	  /*if(eth0_buf[0] != 0 )
	  {
		  printf("ret = %d, buf = %X[%s]\r\n", ret, eth0_buf[0],eth0_buf);
		  if(eth0_buf[0] == 0x5a)
		  {
			  printf("data = 0x5a \r\n");
			  eth0_buf[0] = 0xA5;
			  ret = send(0, eth0_buf, 1);
		  }
		  else
		  {
			  ret = send(0, eth0_buf, strlen(eth0_buf));
		  }
		  memset(eth0_buf, 0, sizeof(eth0_buf));
	  }*/
  }
  /* USER CODE END 3 */
}

/**
  * @brief System Clock Configuration
  * @retval None
  */
void SystemClock_Config(void)
{
  RCC_OscInitTypeDef RCC_OscInitStruct = {0};
  RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};

  /** Configure the main internal regulator output voltage
  */
  __HAL_RCC_PWR_CLK_ENABLE();
  __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
  /** Initializes the RCC Oscillators according to the specified parameters
  * in the RCC_OscInitTypeDef structure.
  */
  RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
  RCC_OscInitStruct.HSIState = RCC_HSI_ON;
  RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
  RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
  RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
  RCC_OscInitStruct.PLL.PLLM = 16;
  RCC_OscInitStruct.PLL.PLLN = 336;
  RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4;
  RCC_OscInitStruct.PLL.PLLQ = 4;
  if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
  {
    Error_Handler();
  }
  /** Initializes the CPU, AHB and APB buses clocks
  */
  RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
                              |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
  RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
  RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
  RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
  RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;

  if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK)
  {
    Error_Handler();
  }
}

/* USER CODE BEGIN 4 */
#pragma GCC push_options
#pragma GCC optimize ("O0")
void delayUS(uint32_t us)
{
	//volatile uint32_t counter = 12*us;
	volatile uint32_t counter = 2*us;
	while(counter--);
}
#pragma GCC pop_options
/* USER CODE END 4 */

/**
  * @brief  This function is executed in case of error occurrence.
  * @retval None
  */
void Error_Handler(void)
{
  /* USER CODE BEGIN Error_Handler_Debug */
  /* User can add his own implementation to report the HAL error return state */
  __disable_irq();
  while (1)
  {
  }
  /* USER CODE END Error_Handler_Debug */
}

#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 CODE BEGIN 6 */
  /* 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) */
  /* USER CODE END 6 */
}
#endif /* USE_FULL_ASSERT */

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/



**wiz_init.c**
#include "wiz_init.h"
#include "usart.h"
#include "spi.h"

int wizSystemInit(void)
{
	int8_t tmp;
	uint8_t memsize[2][8] = {{2,2,2,2,2,2,2,2},{2,2,2,2,2,2,2,2}};

	W5500DeSelect();

	reg_wizchip_cs_cbfunc(W5500Select, W5500DeSelect);
	reg_wizchip_spi_cbfunc(W5500ReadByte, W5500WriteByte);

	//reg_wizchip_spiburst_cbfunc(W5500ReadBurst, W5500WriteBurst);

	if(ctlwizchip(CW_INIT_WIZCHIP,(void*)memsize) == -1)
	{
		printf("W5500 initialized fail.\r\n");
		return -1;
	}

	if(ctlwizchip(CW_GET_PHYLINK, (void*)&tmp) == -1)
	{
		printf("Unknown PHY Link status.\r\n");
	    return -1;
	}

	return 1;
}

void W5500HardwareReset(void)
{
  HAL_GPIO_WritePin(W5500_RESET_Port ,W5500_RESET_Pin,GPIO_PIN_RESET);
  delayUS(510);
  HAL_GPIO_WritePin(W5500_RESET_Port, W5500_RESET_Pin,GPIO_PIN_SET);
}

void W5500WriteByte(uint8_t txByte)
{
	uint8_t rtnByte;

	W5500Select();

    while (HAL_SPI_GetState(&hspi1) != HAL_SPI_STATE_READY);
    HAL_SPI_TransmitReceive(&hspi1,&txByte,&rtnByte,1,10);
}

unsigned char W5500ReadByte(void)
{
    uint8_t txByte = 0xFF;
    uint8_t rtnByte = 0;

    W5500Select();

    while (HAL_SPI_GetState(&hspi1) != HAL_SPI_STATE_READY);
    HAL_SPI_TransmitReceive(&hspi1,&txByte,&rtnByte,1,10);

    return rtnByte;
}

void W5500WriteBurst(uint8_t* pBuf, uint16_t len)
{
	HAL_GPIO_WritePin(SPI1_CS_GPIO_Port, SPI1_CS_Pin, GPIO_PIN_RESET);
    HAL_SPI_Transmit_DMA(&hspi1, pBuf, len);
}

void W5500ReadBurst(uint8_t* pBuf, uint16_t len)
{
    uint8_t dataout=0xAA;

    HAL_GPIO_WritePin(SPI1_CS_GPIO_Port, SPI1_CS_Pin, GPIO_PIN_RESET);
    HAL_SPI_TransmitReceive_DMA(&hspi1, &dataout, pBuf, len);
}

void W5500Select(void)
{
    HAL_GPIO_WritePin(SPI1_CS_GPIO_Port, SPI1_CS_Pin, GPIO_PIN_RESET);
}

void W5500DeSelect(void)
{
	HAL_Delay(10);
    HAL_GPIO_WritePin(SPI1_CS_GPIO_Port, SPI1_CS_Pin, GPIO_PIN_SET);
}

void Critical_enter(void)
{
	__disable_irq();
}

void Critical_exit(void)
{
	__enable_irq();
}

int isLinked(void)
{
	return(getPHYCFGR() & PHYCFGR_LNK_ON);
}

void print_network_information(void)
{
	printf("\r\n==============Net Info==============\r\n");
	printf("Mac address: %02x:%02x:%02x:%02x:%02x:%02x\n\r",gWIZNETINFO.mac[0],gWIZNETINFO.mac[1],gWIZNETINFO.mac[2],gWIZNETINFO.mac[3],gWIZNETINFO.mac[4],gWIZNETINFO.mac[5]);
	printf("IP address : %d.%d.%d.%d\n\r",gWIZNETINFO.ip[0],gWIZNETINFO.ip[1],gWIZNETINFO.ip[2],gWIZNETINFO.ip[3]);
	printf("SM Mask	   : %d.%d.%d.%d\n\r",gWIZNETINFO.sn[0],gWIZNETINFO.sn[1],gWIZNETINFO.sn[2],gWIZNETINFO.sn[3]);
	printf("Gate way   : %d.%d.%d.%d\n\r",gWIZNETINFO.gw[0],gWIZNETINFO.gw[1],gWIZNETINFO.gw[2],gWIZNETINFO.gw[3]);
	printf("DNS Server : %d.%d.%d.%d\n\r",gWIZNETINFO.dns[0],gWIZNETINFO.dns[1],gWIZNETINFO.dns[2],gWIZNETINFO.dns[3]);
	printf("==============Net Info==============\r\n");
}