Stm32 연결 문제

W5300 과 STM32 와 연결시 다른 분들도 다들 이런문제에 부딪히는 것 같습니다.
회로는 STM32 이 연결되어 있는 W145SR 관련 회로를 참조하여 설계했습니다.

STM32 어드레스 0 ~ 9 를 W5300 어드레스 0 ~ 9 로 연결하고 CS 핀을 레퍼런스는 PG10 에 연결하였고 저는 PG9 에 연결하였습니다. 이 부분은 초기 DEF_IINCHIP_MAP_BASE 주소를 0x64000000 으로 할것인지 0x68000000 으로 결정하는 부분이기에 크게 의미를 두지 않았습니다.

FSMC 부분이 제대로 동작하는 확인하기 위해 데이터 시트 68 페이지 IR 레지스터 (0xFE, FF) 부분을 읽어 보면 그 값이
0x53, 0x00 으로 읽혀야 한다고 되어 있길래 이와 관련하여 검색을 많이 했습니다.

일단 주소 변경없이 0x640000FE 와 0x640000FF 를 읽어보면
IDR0 : 0001
IDR1 : 0100
이렇게 읽힙니다.

STM32 와 W5300 연결시 16비트와 8비트 접근에 따라 주소 값을 2배로 또는 미리 쉬프트 시키라는 얘기가 있어서
0x64000000 + 0xFE + (12) 와 0x64000000 + 0xFF + (12)

이렇게 해도 마찬 가지 입니다.

아래는 FSMC 설정 부분입니다.
GPIO_InitTypeDef GPIO_InitStructure;
FSMC_NORSRAMInitTypeDef FSMC_NORSRAMInitStructure;
FSMC_NORSRAMTimingInitTypeDef p;

/* Enable FSMC, GPIOD, GPIOE, GPIOF, GPIOG and AFIO clocks */
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_FSMC, ENABLE);
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOD | RCC_APB2Periph_GPIOE |
                        RCC_APB2Periph_GPIOF | RCC_APB2Periph_GPIOG |
                        RCC_APB2Periph_AFIO, ENABLE);  

/*-- GPIO Configuration ------------------------------------------------------*/
/*!< W5300 Data lines configuration */
/*!< NOE and NWE configuration */  
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_4 | GPIO_Pin_5 |
                        GPIO_Pin_8 | GPIO_Pin_9 | GPIO_Pin_10 | GPIO_Pin_14 | 
                        GPIO_Pin_15;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
GPIO_Init(GPIOD, &GPIO_InitStructure);   

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7 | GPIO_Pin_8 | GPIO_Pin_9 | GPIO_Pin_10 | 
                        GPIO_Pin_11 | GPIO_Pin_12 | GPIO_Pin_13 | GPIO_Pin_14 | 
                        GPIO_Pin_15;
GPIO_Init(GPIOE, &GPIO_InitStructure);  

/*!< W5300 Address lines configuration */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3 | 
                        GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_12 | GPIO_Pin_13 | 
                        GPIO_Pin_14 | GPIO_Pin_15;
GPIO_Init(GPIOF, &GPIO_InitStructure);
          
/*!< NE2 configuration */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9; 
//GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_Init(GPIOG, &GPIO_InitStructure);

//CS low
//GPIO_ResetBits(GPIOG, GPIO_Pin_10);

//W5300 Reset
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_Init(GPIOF, &GPIO_InitStructure);


//Heart LED
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_Init(GPIOF, &GPIO_InitStructure);

/*-- FSMC Configuration ------------------------------------------------------*/
p.FSMC_AddressSetupTime = 1;
p.FSMC_AddressHoldTime = 0;
p.FSMC_DataSetupTime = 1;
p.FSMC_BusTurnAroundDuration = 0;
p.FSMC_CLKDivision = 0;
p.FSMC_DataLatency = 0;
p.FSMC_AccessMode = FSMC_AccessMode_A;

FSMC_NORSRAMInitStructure.FSMC_Bank = FSMC_Bank1_NORSRAM2;
FSMC_NORSRAMInitStructure.FSMC_DataAddressMux = FSMC_DataAddressMux_Disable;
FSMC_NORSRAMInitStructure.FSMC_MemoryType = FSMC_MemoryType_SRAM;
FSMC_NORSRAMInitStructure.FSMC_MemoryDataWidth = FSMC_MemoryDataWidth_16b;
FSMC_NORSRAMInitStructure.FSMC_BurstAccessMode = FSMC_BurstAccessMode_Disable;
//FSMC_NORSRAMInitStructure.FSMC_AsynchronousWait = FSMC_AsynchronousWait_Disable;  
FSMC_NORSRAMInitStructure.FSMC_WaitSignalPolarity = FSMC_WaitSignalPolarity_Low;
FSMC_NORSRAMInitStructure.FSMC_WrapMode = FSMC_WrapMode_Disable;
FSMC_NORSRAMInitStructure.FSMC_WaitSignalActive = FSMC_WaitSignalActive_BeforeWaitState;
FSMC_NORSRAMInitStructure.FSMC_WriteOperation = FSMC_WriteOperation_Enable;
FSMC_NORSRAMInitStructure.FSMC_WaitSignal = FSMC_WaitSignal_Disable;
FSMC_NORSRAMInitStructure.FSMC_ExtendedMode = FSMC_ExtendedMode_Disable;
FSMC_NORSRAMInitStructure.FSMC_WriteBurst = FSMC_WriteBurst_Disable;
FSMC_NORSRAMInitStructure.FSMC_ReadWriteTimingStruct = &p;
FSMC_NORSRAMInitStructure.FSMC_WriteTimingStruct = &p;
FSMC_NORSRAMInit(&FSMC_NORSRAMInitStructure);  
/* BANK 2 (of NOR/SRAM Bank 1~4) is enabled */
FSMC_NORSRAMCmd(FSMC_Bank1_NORSRAM2, ENABLE);  

}

조언 부탁드립니다.

값이 정말 안 읽혀 집니다…

어드레스에 2배를 해도 값이 틀리고… 혹시나 값은 넣어 졌는데 제대로 안 읽혀지나 해서 ping 테스트를 해봤지만
여전히 ping 도 안되고.

확인 부탁드립니다.
STM32_W5300.zip (255 KB)

안녕하세요.

오실로스코프로 CS와 address와 data 값이 정상적으로 출력이 되는지를 먼저 확인해 봐야 할 것같습니다.