[riot-users] Using a W5100 with nucleo-f401...
aannoaanno at gmail.com
Tue Jun 13 19:35:31 CEST 2017
@Alex: Thank you very much for your support!
I've moved my code to
- the code is a modified version of RIOT/examples/gnrc_networking.
However, it is still not working, i.e. when I try
> make flash
The minicom terminal tells me:
> [w5100] error: no SPI connection
Here are the points are not sure about:
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
#define W5100_PARAM_SPI (SPI_DEV(0)) // ???
#define W5100_PARAM_SPI_CLK (SPI_CLK_5MHZ)
#define W5100_PARAM_CS (GPIO_PIN(PORT_B, 6)) // PB_6
#define W5100_PARAM_EVT (GPIO_PIN(PORT_A, 10)) // PA_10
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?!?
Am 12.06.2017 um 19:14 schrieb Alexandre Abadie:
> Adding a missing information in my previous reply about adding the module (sorry):
> Simply add USE_MODULE += w5100 in the application Makefile: examples/minimal/Makefile.
> ----- Mail original -----
>> Welcome and thanks for your interest in RIOT !
>> ----- Mail original -----
>>> I would like to run the gnrc_minimal example on my nucleo-f401 board.
>>> The board does not have ethernet BUT I use the arduino W5100 shield with
>>> it (https://www.arduino.cc/en/Main/ArduinoEthernetShieldV1). Hence
>>> 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
>> Yes, you have to import the module corresponding to the W5100 driver. Simply
>> 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 
>>  https://github.com/RIOT-OS/RIOT/issues/7001
>>> Kind regards,
More information about the users