Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years ago.
ST Nucleo F411RE support W5100?
I plug the W5100 v5 module on F411RE, and use jumper to connect the D11 with MOSI, D12 with MISO and SCK with D13. Import the WIZnet_Library in our board. But, I never read the right MAC address, IP, gateway, and submask address. Is these code right? Does these work? Thank you in advanced.
Question relating to:
2 Answers
10 years ago.
Many thanks to Bongjun Hur. This problem had be solved. We found the clock cycle time is 0.625us, indicated 1.6MHZ. But in datasheet p66, suggest that minimum SCK time is 70ns, indicated that 14MHz. So we modify the frequency to 12000000 and it's work!
HI I have also problem with F411RE and w5100 eth V5 Shield was tested on arduino - all ok. alo for nucleo i have jumpers for SPI. unfortunetly i can't read mac and never received IP from dhcp. Where you modify spi freq.? in spi.h ?
edit: /// sorry i am using in my project - WIZ820ioInterface i found in WIZnetInterface where to modify spi freq :)
all clear
Regards Robert
posted by 22 Jan 201510 years ago.
Dear Vicky,
Do you change right SPI port information in main.cpp?? I think, first you should modify (or add) as a part of the code to define SPI pins about your main board. See the below~
main.cpp
#define LPC //#define ST_NUCLEO //#define FRDM_KL25Z //#define Seeeduino_Arch #ifdef LPC // LPC1768 & LPC11U24 SPI spi(p5, p6, p7); // mosi, miso, sclk WIZnetInterface eth(&spi, p8, p9); // spi, cs, reset #endif #ifdef ST_NUCLEO // ST Nucleo SPI spi(PA_7, PA_6, PA_5); // mosi, miso, sclk WIZnetInterface eth(&spi, PB_6, PA_10); // spi, cs, reset #endif #ifdef FRDM_KL25Z // Freescale FRDM KL25Z SPI spi(PTD2, PTD3, PTD1); // mosi, miso, sclk WIZnetInterface eth(&spi, PTD0, PTA20); // spi, cs, reset #endif #ifdef Seeeduino_Arch // Seeedstudio Arch SPI spi(P1_22, P1_21, P1_20); // mosi, miso, sclk WIZnetInterface eth(&spi, P0_2, P0_0); // spi, cs, reset Serial pc(P1_13, P1_14); // tx, rx #else Serial pc(USBTX,USBRX); #endif #ifndef USE_DHCP // for static IP setting const char * IP_Addr = "192.168.1.120"; const char * IP_Subnet = "255.255.255.0"; const char * IP_Gateway = "192.168.1.111"; #endif
One more thing to check, Reset Pin~ Surely, all engineer might check this pin first. :)
I have already modified the code. The modified code is as follows:
main.cpp:
20 #define LPC -> #define LPC
21 #define ST_NUCLEO -> #define ST_NUCLEO
64 mbed_mac_address((char *)mac); -> mbed_mac_address((char *)mac);
65 mac[0] = 0x00; mac[1] = 0x08; mac[2] = 0xDC; mac[3] = 0x00; mac[4] = 0x00; mac[5] = 0x00; -> mac[0] = 0x00; mac[1] = 0xAA; mac[2] = 0xBB; mac[3] = 0xCC; mac[4] = 0xDE; mac[5] = 0x00;
wiznet.h :
25 #define USE_W5500 -> #define USE_W5500
27 #define USE_W5100 -> #define USE_W5100
And the result in teraterm is shown below:
Start Initialized, MAC: FF:F0:00:F0:00:0F IP: 255.240.0.240, MASK: 0.240.0.15, GW: 255.240.0.240 Wait for new connection...
Thank you.
posted by 30 Oct 2014Hi Bongjun Hur: I'm partner with Vicky Deng. We are trying the Ethernet function on Nucleo. It's strange why we cannot to set the ip address, MAC, etc. By your code, it looks like simply to modify some code; #define ST_NUCLEO and #define USE_W5100, marked the Line64 of main.cpp, mbed_mac_address((char *)mac);, unmarked Line65 of main.cpp, ac[0] = 0x00; mac[1] = 0x08; mac[2] = 0xDC; mac[3] = 0x00; mac[4] = 0x00; mac[5] = 0x00;. We also try to reduce the speed of SPI, from10000 to 5000, but it was not work. Further, we used Saleae, Logic Analyzer to see the spi signal. The signal of SCK and ENABLE is normal, but the MOSI is 15, 4, 3, 0 loop forever. Please tell how can we do next. Sorry we are graduate students, not professional engineers.
posted by 07 Nov 2014