WIZnet Developer Forum

w6100 evb code

Can’t get example code to function. According my logic analyzer, SPI seems to not be working properly. Getting all zeroes when running register dump and getnetinfo. I’m running Keil V5. Tried the stmcube example with no joy as well. I’ve included my project code.

Thanks,
edtpcecDay3Codefred.zip (18.0 KB)

Hi, edtp.

I think you set just one byte read and write functions like this. “reg_wizchip_spi_cbfunc(spi_rb, spi_wb,0,0);
wiznet spi interface supports burst read and write.
In the getnetinfo function, many functions use burst read/write like WIZCHIP_READ_BUF/ WIZCHIP_WRITE_BUF.
You must set this function, too.

Thanks.

Hello edtp,

Please refer to this attached zip file (W6100 Loopback Keil Project).

And you can find the W6100 EVB example on this repository: https://github.com/WIZnet-ioLibrary.

20191010_W6100EVB_loopback_Hal.zip (2.8 MB)

Hi, dkay
Switched on DMA and now I have SPI response.
Thank you.

However, the WIZnet team really needs to post a DHCP example for Keil and STMCube.

Thanks, taylor.
You post was helpful.
As I posted to dkay, the wiznet team should post an STMcube DHCP example.
I’m finding the learning curve on the 6100 library is quite steep even with prior 5500 experience.

I am pleased with the team’s choice of microcontroller for the 6100 evb.

TrueStudio 9.1 HAL 드라이버를 사용하고 있는데… 유사한 증상이있어 자료를 찾다가 궁금한 점이 있어 문의드립니다.
void W6100Initialze(void) 안에 현재
reg_wizchip_spi_cbfunc(W6100SpiReadByte, W6100SpiWriteByte, 0, 0); 이렇게 되어 있는데 구체적으로 어떤 function을 선언해 줘야하는것인가요?
Hercules로 확인해 보면
PHY OK.
Register value after W6100 initialize!
VERSION(200) = 00
Mac address: 00:00:00:00:00:00
IP address : 0.0.0.0
SM Mask : 0.0.0.0
Gate way : 0.0.0.0
DNS Server : 168.126.63.1
GW6 : 0000:0000:0000:0000:0000:0000:0000:0000
LLA : 0000:0000:0000:0000:0000:0000:0000:0000
GUA : 0000:0000:0000:0000:0000:0000:0000:0000
SUB6 : 0000:0000:0000:0000:0000:0000:0000:0000

NETCFGLOCK : 1
0:Opened, UDP loopback, port [50000] as IPv4 mode
이렇게 나오는데, #define DMA를 wizchip_init.h 파일에 선언해 주면…
PHY OK.
Register value after W6100 initialize!
VERSION(200) = 00
Mac address: 00:08:dc:ff:ff:ff
IP address : 192.168.177.25
SM Mask : 255.255.255.0
Gate way : 192.168.177.1
DNS Server : 168.126.63.1
GW6 : 0000:0000:0000:0000:0000:0000:0000:0000
LLA : FE80:0000:0000:0000:0208:DCFF:FE57:5725
GUA : 0000:0000:0000:0000:0000:0000:0000:0000
SUB6 : FFFF:FFFF:FFFF:FFFF:0000:0000:0000:0000

NETCFGLOCK : 0
이렇게 표시가 됩니다.

자체 해결했습니다… HAL 사용자중에 저와같은 경우가 있을것 같아 기록으로 남깁니다…

STMCube로 Truestudio HAL Driver를 사용하는것으로 설정하면. . . . .
MX_GPIO_Init();
MX_DMA_Init();
MX_ADC1_Init();
MX_IWDG_Init();
MX_RTC_Init();
MX_SPI1_Init();
MX_SPI2_Init();
MX_TIM4_Init();
MX_USART1_UART_Init();
MX_USART2_UART_Init();
MX_USART6_UART_Init();
이런식으로 메인함수에서 여러 설정과 함께 SPI가 먼저 선언됩니다.

20191010_W6100EVB_loopback_Hal.zip에서 설명한대로
spi_set_func(&hspi2);
BoardInitialze();
ctlwizchip(CW_SYS_UNLOCK,& syslock);
ctlnetwork(CN_SET_NETINFO,&gWIZNETINFO);

printf(“VERSION(%x) = %.2x \r\n”, VER,getVER());
print_network_information();
위와 같이 그대로 따라 했으면 되었을텐데 SPI가 먼저 선언되는 바람에 BoardInitialze();에서 spiInitailize();를 생략했기 때문이었습니다…

아래와 같이 정리를 하니 예제에 나와있는것 같이 잘 초기화가 진행되었습니다.
spi_set_func(&hspi1);
MX_SPI1_Init(); //먼저있던 SPI1을 이부분에서 선언…
W6100Initialze();

ctlwizchip(CW_SYS_UNLOCK,& syslock);
ctlnetwork(CN_SET_NETINFO,&gWIZNETINFO);

printf(“Register value after W6100 initialize!\r\n”);

printf(“VERSION(%x) = %.2x \r\n”, VER,getVER());
print_network_information();
그대로 따라했으면 되었을것을 괜힌 HAL을 탓했습니다…

1 Like

Copyright © 2017 WIZnet Co., Ltd. All Rights Reserved.