cd examples/gnrc_minimal
BOARD=nucleo-f401 make clean all flash term
But I see only the "RIOT network stack example application" message and
no "My address is ...".
From compilation output it seems to be that w5100 is NOT compiled at
all. As I has expected, there is still something missing.
Here are my questions:
1. I have to tweak the build to include the w5100 compilation. How to do
this?
2. I have to use (and initialize) the SPI1 of the nucleo-f401 board. How
to do this?
3. Finally, I have to configure that the the SPI1 of nucleo-f401 it the
'underlying' SPI of w5100 and that the w5100 should be used for
networking. How to do this?
cd examples/gnrc_minimal
BOARD=nucleo-f401 make clean all flash term
You are building your application the right way.
But I see only the "RIOT network stack example application" message and
no "My address is ...".
From compilation output it seems to be that w5100 is NOT compiled at
all. As I has expected, there is still something missing.
Here are my questions:
1. I have to tweak the build to include the w5100 compilation. How to do
this?
Yes, you have to import the module corresponding to the W5100 driver. Simply add
USE_MODULE += w5100
2. I have to use (and initialize) the SPI1 of the nucleo-f401 board. How
to do this?
The initialization is done automatically, since the 'minimal' example uses the 'auto_init' module.
3. Finally, I have to configure that the the SPI1 of nucleo-f401 it the
'underlying' SPI of w5100 and that the w5100 should be used for
networking. How to do this?
You can copy the file drivers/w5100/include/w5100_params.h in examples/minimal and edit the parameters to your needs. Otherwise you can directly edit the file in the drivers directory but this is not considered as good practice.
We know that this part of RIOT is not very well documented. An issue exists to keep track of this weakness [1]
1. I haven't fully understood how to copy
drivers/w5100/include/w5100_params.h and use that. Instead I have
modified the file in-place and added the following
2. I'm not sure if it is my (i.e. main.c) job to initialize SPI and/or
GPIO and/or W5100_PARAM_CS. I've written the init() method in main.c for
this purpose. But maybe it is 'too late' then?!?
Have a look at the board configuration file and especially this line [1]. You are setting CS pin to PB6 and the board uses PA4. Otherwise your code looks good to me.
Maybe Hauke Petersen could help as we wrote the W5100 driver and know Nucleo a bit.
actually, I have never tried my w5100 shield on a nucleo board... I don't know how many versions of this exist, but my shield uses the dedicated ICSP header (not present on nucleo bords) for the SPI pins - so I actually cant tell if it is possible to run this shield on nucleo boards... Always remember, just because something tells us it is Arduino 'compatible' or 'like', it does not mean it will work