<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Wiznet5100 ethernet shield on nRF52840</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/25934/wiznet5100-ethernet-shield-on-nrf52840</link><description>Dear Nordic Devzone, 
 I want to run an Arduino Ethernet Shield with the Wiznet5100 on the nRF52840. I was wondering if there was an easier way to do this then having to rewrite the SPI code by myself. 
 www.arduino.cc/.../ArduinoEthernetShieldV1 </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 30 Oct 2017 09:33:26 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/25934/wiznet5100-ethernet-shield-on-nrf52840" /><item><title>RE: Wiznet5100 ethernet shield on nRF52840</title><link>https://devzone.nordicsemi.com/thread/102165?ContentTypeID=1</link><pubDate>Mon, 30 Oct 2017 09:33:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:89f11beb-e073-4ae5-ba5a-3d33221973d9</guid><dc:creator>Amigo</dc:creator><description>&lt;p&gt;DHCP was simplified by example i found in web, but it works incorrect. It needs to rewrite with using timer to Discover DHCP packets. Ping doesnt work now too. Now it works wiyh static IP only. IN Socket.c i rewrite some unimportant places, but it does not matter. In general, you only need next files: socket, w5100, tcpclient. They do not affect the code.You need only redefine SPI pins in NRF5x_SPI and rows in structure with ip, sn, gw in main.c.
Here is example of using tcp client:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    if(tcpclient_open(s, ip, port))
{
	return true;
}
else
{
	return false;
}

    if(tcpclient_sendbytes(s, packet, length))
{
	....		
}
else{
           ....
}

    if(tcpclient_recivedata(s, data_buf_rx, data_buf_len))
{
             ...
}
else
{
            ...
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wiznet5100 ethernet shield on nRF52840</title><link>https://devzone.nordicsemi.com/thread/102166?ContentTypeID=1</link><pubDate>Mon, 30 Oct 2017 09:23:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e7ecd3d8-a14e-45e2-b781-d6e82612b54c</guid><dc:creator>ToasTer86</dc:creator><description>&lt;p&gt;I checked out the code, did you make any alterations in &amp;quot;socket.c / dhcp.c &amp;quot;?
Thanks in advance&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wiznet5100 ethernet shield on nRF52840</title><link>https://devzone.nordicsemi.com/thread/102164?ContentTypeID=1</link><pubDate>Mon, 30 Oct 2017 09:16:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca38072c-e938-491a-b9e8-408dc3a6c8fd</guid><dc:creator>ToasTer86</dc:creator><description>&lt;p&gt;Hey thanks for the response, I have been working on this the last few weeks. Got DHCP and DNS working, and got the application layer (HTTP post&amp;amp;get) working last week.&lt;/p&gt;
&lt;p&gt;One thing I noticed with that when using socket 3, I can&amp;#39;t send and receive data correctly.
Have you had any problems with this?&lt;/p&gt;
&lt;p&gt;Thanks for any response, will take a look at your code.&lt;/p&gt;
&lt;p&gt;ToasTer&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wiznet5100 ethernet shield on nRF52840</title><link>https://devzone.nordicsemi.com/thread/102163?ContentTypeID=1</link><pubDate>Sat, 28 Oct 2017 08:12:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0387ca70-4783-4bd1-a609-a50a9b112421</guid><dc:creator>Amigo</dc:creator><description>&lt;p&gt;i connected W5100 shield to nrf52832 sev board. Here is my sources you can try.
&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/W5100.rar"&gt;W5100.rar&lt;/a&gt;
&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/NRF5x_5F00_SPI.c"&gt;NRF5x_SPI.c&lt;/a&gt;
&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/NRF5x_5F00_SPI.h"&gt;NRF5x_SPI.h&lt;/a&gt;
mian  code:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#include &amp;quot;NRF5x_SPI.h&amp;quot;
#include &amp;quot;w5100.h&amp;quot;
#include &amp;quot;socket.h&amp;quot;
#include &amp;quot;tcpclient.h&amp;quot;

W5100_CFG my_cfg = {
{0x8A, 0x26, 0xF4, 0x1A, 0xD0, 0x93},		// MAC address
{192, 168, 1, 3},						// IP address
{255, 255, 255, 0},							// Subnet mask
{192, 168, 1, 1},							// Gateway

{192, 168, 1, 127},// Dest iP
SOCKET_PORT // Dest port};

extern uint8_t destip[4];
extern uint16_t destport;
extern uint8_t data_buf_rx[255];
extern uint8_t data_buf_tx[255];
uint8_t ip[4];
uint8_t sn[4];
uint8_t gw[4];
uint8_t mac[6];
uint8_t mode = 1; //0 - DHCP, 1 - no DHCP
uint8_t my_socket = 0;
uint8_t err;
uint8_t tcpdata[] = {0x01, 0x02, 0x03, 0x0A, 0x6B, 0x0C};
uint8_t counter = 0; 

int main(void)
{
....
SPI_Init();
ethernet_config();
    ...
}

void ethernet_config(void)
{
Serial_Print((uint8_t*)&amp;quot;\r\nConfig static IP mode...\r\n&amp;quot;);

iinchip_init();
nrf_delay_ms(1000);
sysinit(1, 1);
nrf_delay_ms(1000);

setSIPR(my_cfg.ip_addr);
setGAR( my_cfg.gtw_addr);
setSUBR(my_cfg.sub_mask);
setSHAR(my_cfg.mac_addr);
nrf_delay_ms(100);

getSIPR(ip);
getSUBR(sn);
getGAR(gw);
getSHAR(mac);

memcpy(destip, my_cfg.remip, 4);
destport = my_cfg.remport;

sprintf(debug_str, &amp;quot;\r\nMY IP: %d.%d.%d.%d\r\n&amp;quot;, ip[0], ip[1], ip[2], ip[3]);
Serial_Print((uint8_t*)debug_str);

sprintf(debug_str, &amp;quot;SUB NET: %d.%d.%d.%d\r\n&amp;quot;, sn[0], sn[1], sn[2], sn[3]);
Serial_Print((uint8_t*)debug_str);

sprintf(debug_str, &amp;quot;GW: %d.%d.%d.%d\r\n&amp;quot;, gw[0], gw[1], gw[2], gw[3]);
Serial_Print((uint8_t*)debug_str);

sprintf(debug_str, &amp;quot;MAC: %2X:%2X:%2X:%2X:%2X:%2X\r\n&amp;quot;, mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
Serial_Print((uint8_t*)debug_str);	

Serial_Print((uint8_t*)&amp;quot;\r\nW5100 configured!\r\n&amp;quot;);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wiznet5100 ethernet shield on nRF52840</title><link>https://devzone.nordicsemi.com/thread/102154?ContentTypeID=1</link><pubDate>Thu, 19 Oct 2017 11:08:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c8a58890-a972-49b6-9155-c6448db5ef86</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Great to hear that the issue is solved :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wiznet5100 ethernet shield on nRF52840</title><link>https://devzone.nordicsemi.com/thread/102162?ContentTypeID=1</link><pubDate>Thu, 19 Oct 2017 11:07:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c051a5e6-af50-4770-89a7-18a306d36142</guid><dc:creator>ToasTer86</dc:creator><description>&lt;p&gt;Was able to verify my data with the logic analyzer, after doing some study in the Wiznet5100 datasheet I found an important detail I forgot.
Wiz5100 does not communicate on SPI mode 3 but only mode 0. So after changing that I got my ethernet working and was able to ping the Wiznet 5100.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wiznet5100 ethernet shield on nRF52840</title><link>https://devzone.nordicsemi.com/thread/102156?ContentTypeID=1</link><pubDate>Wed, 18 Oct 2017 15:22:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b9a15ca-1be3-4d49-b87a-3d6b0d17805b</guid><dc:creator>ToasTer86</dc:creator><description>&lt;p&gt;going to get myself a logic analyzer and check the pins. Have to make sure the nRF52840 is sending out data.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wiznet5100 ethernet shield on nRF52840</title><link>https://devzone.nordicsemi.com/thread/102160?ContentTypeID=1</link><pubDate>Wed, 18 Oct 2017 13:59:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a8657678-c228-420b-ad1a-2d6ccb810082</guid><dc:creator>ToasTer86</dc:creator><description>&lt;p&gt;Found this image of the wiz5100 ether net shield &lt;a href="http://i.stack.imgur.com/9mk4A.jpg"&gt;link text&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Using this layout I changed the pins to correspond to that layout:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define ARDUINO_13_PIN              NRF_GPIO_PIN_MAP(1, 15)  // Digital pin 13
#define ARDUINO_12_PIN              NRF_GPIO_PIN_MAP(1, 14)  // Digital pin 12
#define ARDUINO_11_PIN              NRF_GPIO_PIN_MAP(1, 13)  // Digital pin 11
#define ARDUINO_10_PIN              NRF_GPIO_PIN_MAP(1, 12)  // Digital pin 10

                        .Pin_SCK                = ARDUINO_13_PIN,
                        .Pin_MOSI               = ARDUINO_11_PIN,
                        .Pin_MISO               = ARDUINO_12_PIN,
                        .Pin_CSN                = ARDUINO_10_PIN};	
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;now the print out of my terminal has changed, to :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;=== W5100 NET CONF ===
MAC: 00:00:00:00:00:00
SIP: 0.0.0.0
GAR: 0.0.0.0
SUB: 0.0.0.0
DNS: 8.8.8.8
======================
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wiznet5100 ethernet shield on nRF52840</title><link>https://devzone.nordicsemi.com/thread/102159?ContentTypeID=1</link><pubDate>Wed, 18 Oct 2017 12:35:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3db1a371-9c40-4ca4-853a-517e11d0b8a4</guid><dc:creator>ToasTer86</dc:creator><description>&lt;p&gt;Hi Sigurd, thanks again.&lt;/p&gt;
&lt;p&gt;Yep I just figured that out before you messaged, I am sorry.
Right now I am using this as well as a kind of logbook for what I have done.&lt;/p&gt;
&lt;p&gt;So now it is still printing out&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;=== W5100 NET CONF ===
MAC: FF:FF:FF:FF:FF:FF
SIP: 255.255.255.255
GAR: 255.255.255.255
SUB: 255.255.255.255
DNS: 8.8.8.8
======================
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;in the &lt;code&gt;network_init();&lt;/code&gt; function on user_ethernet.c line 81 the gWIZNETINFO variable is filled before setting the 	&lt;code&gt;ctlnetwork(CN_SET_NETINFO, (void*)&amp;amp;gWIZNETINFO);&lt;/code&gt; function. But after the set &amp;amp; get &lt;code&gt;ctlnetwork(CN_GET_NETINFO, (void*)&amp;amp;gWIZNETINFO);&lt;/code&gt; gWIZNETINFO  is empty again.&lt;/p&gt;
&lt;p&gt;So will trouble shoot that now.&lt;/p&gt;
&lt;p&gt;Really seems like I am getting somewhere at least. Thanks again Sigurd for all your help up till now.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wiznet5100 ethernet shield on nRF52840</title><link>https://devzone.nordicsemi.com/thread/102158?ContentTypeID=1</link><pubDate>Wed, 18 Oct 2017 12:23:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5fda1b2f-eafe-4b78-9a4c-aba4a582c5a7</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Looking at the function &lt;a href="https://github.com/hooni1020/BLE_to_TCP_W5500_Shield/blob/4d18552962fbe42ab688f011c52241ee2992529b/ioLibrary_Driver/Ethernet/wizchip_conf.c#L589"&gt;wizphy_getphylink()&lt;/a&gt; in wizchip_conf.c line 575, it seems that if you have defined the board to be anything else than 5500 or 5200, it will return -1, and you will get the Unknown PHY Link stauts printed.&lt;/p&gt;
&lt;p&gt;In &lt;a href="https://github.com/hooni1020/BLE_to_TCP_W5500_Shield/blob/4d18552962fbe42ab688f011c52241ee2992529b/ioLibrary_Driver/Ethernet/wizchip_conf.h#L549"&gt;wizchip_conf.h line 589&lt;/a&gt;, you also have this comment &amp;quot;&lt;em&gt;get the link status of phy in WIZCHIP. No use in W5100&lt;/em&gt;&amp;quot;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wiznet5100 ethernet shield on nRF52840</title><link>https://devzone.nordicsemi.com/thread/102157?ContentTypeID=1</link><pubDate>Wed, 18 Oct 2017 11:59:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f72a883f-7a1b-4249-8840-398629aba5e2</guid><dc:creator>ToasTer86</dc:creator><description>&lt;p&gt;I was able to find the wizchip_conf.c file and change the wiznet chip to the 5100.&lt;/p&gt;
&lt;p&gt;Now I am getting contino  &lt;code&gt;printf(&amp;quot;Unknown PHY Link stauts.\r\n&amp;quot;);&lt;/code&gt; from the user_ethernet.c file at line 68.&lt;/p&gt;
&lt;p&gt;Will try to trouble shoot this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wiznet5100 ethernet shield on nRF52840</title><link>https://devzone.nordicsemi.com/thread/102152?ContentTypeID=1</link><pubDate>Wed, 18 Oct 2017 10:51:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:87d977d4-a390-4a38-bf2b-aeba8880d6c8</guid><dc:creator>ToasTer86</dc:creator><description>&lt;p&gt;Hey Sigurd,&lt;/p&gt;
&lt;p&gt;Thanks for responding, I was using different pins. Because I thought I the pins had to be used corresponding to the pins identified on the Ethernet Shield (wiznet 5100). I tried changing the pins of the rest and the both the SER_APP_SPIM0_SS_PIN to 1.13 and 0.3 pins.&lt;/p&gt;
&lt;p&gt;I also got UART running now and can see some console output from the library you send me earlier. It seems that it is not recognizing the Wiznet5100.
Console output below from the &lt;code&gt;network_init();&lt;/code&gt; function&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;W5500 NET CONF
MAC: FF:FF:FF:FF:FF:FF
SIP: 255.255.255.255
GAR: 255.255.255.255
SUB: 255.255.255.255
DNS: 8.8.8.8
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So it seems that things are going wrong with the SPI, if I check the example you send me they are using different pins.&lt;/p&gt;
&lt;p&gt;Will try the debugging but at this moment I do not have a logic analyzer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wiznet5100 ethernet shield on nRF52840</title><link>https://devzone.nordicsemi.com/thread/102155?ContentTypeID=1</link><pubDate>Wed, 18 Oct 2017 08:41:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:59da2d01-c3f7-4fb7-893c-84259ab2ba87</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Frist make sure that the SPI pins are connected correctly.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;SER_APP_SPIM0_SCK_PIN  = P0.27&lt;/li&gt;
&lt;li&gt;SER_CON_SPIS_MOSI_PIN = P0.02&lt;/li&gt;
&lt;li&gt;SER_CON_SPIS_MISO_PIN = P0.26&lt;/li&gt;
&lt;li&gt;SER_APP_SPIM0_SS_PIN = P1.13&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There have been some bugs in some libraries with using the port 1 pins in previous SDK version, so you could try to use a different pin for SER_APP_SPIM0_SS_PIN , you could try to use e.g NRF_GPIO_PIN_MAP(0,3) instead of P1.13.&lt;/p&gt;
&lt;p&gt;If you have access to a logic analyzer(e.g saleae logic), you should take look at the data being sent over the SPI lines.&lt;/p&gt;
&lt;p&gt;You could also try debugging, set the optimization level to 0, place some breakpoints, and see if the code is working as it should.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wiznet5100 ethernet shield on nRF52840</title><link>https://devzone.nordicsemi.com/thread/102161?ContentTypeID=1</link><pubDate>Tue, 17 Oct 2017 16:16:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cbbda316-3ee9-43f2-8b19-f5d38cba4065</guid><dc:creator>ToasTer86</dc:creator><description>&lt;p&gt;Dear Sigurd,&lt;/p&gt;
&lt;p&gt;Using the link you provided I am now able to compile the whole library and functions.&lt;/p&gt;
&lt;p&gt;In the user_spi.c I changed the spi0_master_init() function to correspond with the SCK, MOSI, MISO, CSN pin layout on the nRF52840 :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;void spi0_master_init()
{
    SPIConfig_t spi_info = {.Config.Fields.BitOrder = SPI_BITORDER_MSB_LSB,
                        .Config.Fields.Mode     = SPI_MODE3,
                        .Frequency              = SPI_FREQ_8MBPS,
                        .Pin_SCK                = SER_APP_SPIM0_SCK_PIN,
                        .Pin_MOSI               = SER_CON_SPIS_MOSI_PIN,
                        .Pin_MISO               = SER_CON_SPIS_MISO_PIN,
                        .Pin_CSN                = SER_APP_SPIM0_SS_PIN};	
    spi_master_init(SPI0,&amp;amp;spi_info);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Although at this moment I am kind of lost. I followed the example and also called :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;	user_ethernet_init();
	network_init();
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But I can&amp;#39;t ping the board.
Any tips to help me ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wiznet5100 ethernet shield on nRF52840</title><link>https://devzone.nordicsemi.com/thread/102153?ContentTypeID=1</link><pubDate>Fri, 13 Oct 2017 14:10:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:66a511c3-e3cf-47f8-ac7c-f7c2e1f96328</guid><dc:creator>ToasTer86</dc:creator><description>&lt;p&gt;Hey, thanks so much for your quick answer.
I will give this a shot this weekend. Will most likely have to retro fit it, but I should be able to do that.&lt;/p&gt;
&lt;p&gt;Thanks again,&lt;/p&gt;
&lt;p&gt;Mark&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wiznet5100 ethernet shield on nRF52840</title><link>https://devzone.nordicsemi.com/thread/102151?ContentTypeID=1</link><pubDate>Fri, 13 Oct 2017 14:06:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3a3ea91f-41f4-4b2b-aa02-57a2824a34be</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can find a nRF5x SPI library for the WIZnet 5500 chip at &lt;a href="https://github.com/hooni1020/BLE_to_TCP_W5500_Shield/tree/master/examples/ble_central/ble_uart_c_to_tcpc/Wiznet"&gt;this github page&lt;/a&gt;. This should be a good starting point.&lt;/p&gt;
&lt;p&gt;Also see &lt;a href="https://devzone.nordicsemi.com/blogs/1065/wiznets-ble-to-tcp-gateway/"&gt;this blog post&lt;/a&gt; about WIZnet&amp;#39;s BLE to TCP Gateway.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>