All the Ethernet libraries (UIPEthernet, Ethernet_STM, arduino_uip, Serasidis_EtherCard_STM) can be compiled with the STM32F103.
But none of them compiles with the F4 Discovery (F407).
When i saw “arduino_uip” library in the STM32F4 library folder, i thought that i could use it with the F4 board. But unfortunately it did not compile. Upon my research on the forum, i discovered that it was included in the library only for Netduino. Is this correct?
I definitely need Ethernet on the F4 Discovery, but it looks like there is no available library yet. Is there any chance to get Ethernet on this board?
Are there any modifications needed to do in the library to get it work? If so where can i find information for that ?
What are the compile errors you’ve got ? (maybe some other changes make such errors come to surface)
Last night i have been going trough nearly all your posts regarding Ethernet
I also tried your repo. But still no luck.
please hang on, i will send the error messages in a couple of minutes..
You mentioned SPI error a lot of ime. I get the same SPI class errors but no clue how to solve it.
I also replaced the SPI library from F1 to F4 but still no luck.
Maybe you already found the solution for that which i missed in this forum…
Arduino: 1.6.13 (Windows 7), Board: "STM32 Discovery F407"
C:\Users\sly-VM\Documents\Arduino\hardware\Arduino_STM32-master\STM32F4\libraries\arduino_uip\utility\Enc28J60Network.cpp:40:8: error: 'SPIClass' does not name a type
extern SPIClass SPI;
^
C:\Users\sly-VM\Documents\Arduino\hardware\Arduino_STM32-master\STM32F4\libraries\arduino_uip\utility\Enc28J60Network.cpp: In static member function 'static void Enc28J60Network::init(uint8_t*)':
C:\Users\sly-VM\Documents\Arduino\hardware\Arduino_STM32-master\STM32F4\libraries\arduino_uip\utility\Enc28J60Network.cpp:72:7: error: 'class HardwareSPI' has no member named 'setBitOrder'
SPI.setBitOrder(MSBFIRST);
^
Using library arduino_uip at version 1.04 in folder: C:\Users\sly-VM\Documents\Arduino\hardware\Arduino_STM32-master\STM32F4\libraries\arduino_uip
exit status 1
Error compiling for board STM32 Discovery F407.
(did not edit anything ; except included now the SPI.h in the header.)
Unforunately when i include SPI.h i get the same error posted above.
extern SPIClass SPI;extern SPIClass SPI;Can you show us your sketch?
/Arduino_STM32-master/STM32F4/libraries/arduino_uip/examples/UdpClient/UdpClient.ino
I simply can not understand that it is in the repo but it is not compiling.
I did a fresh Arduino IDE 1.6.12 & SAM 1.6.9 install with no other libraries anywhere installed. Just the Arduino_STM32….
Beside on that, it would be helpful to activate verbose output for compiling to see whether some other warnings/errors are affecting this, too.
So please post here all the warnings, if any, during compilation.
The verbose output is the same.
I was hoping that Martin could lead me to some directions but i guess he is busy.
In short, I’ve never used the arduino_uip examples by themselves, (maybe they need to be tweaked), I was using my own sketch, which is including SPI.h before arduino_uip.h.
For the second error, “error: ‘class HardwareSPI’ has no member named ‘setBitOrder'”, it seems that the wrong SPI is included, because it should not be HardwareSPI class, in STM32F5/libraries/SPI/src/SPI.h the setBitOrder() method is defined there.
Maybe the reason is that you’ve explicitly included HardwareSPI.h, but I think that file is a LeafLab legacy, since SPI class take care of using hardware anyway by including <libmaple/spi.h>
For testing, i replaced the SPI.cpp & SPI.h content which has the ‘setbitorder’ with the HardwareSPI.cpp & HardwareSPI.h cotents.
It does not give SPI errors but alot of DMA converting errors.
So how did you overcome the LeafLab legacy to prevent access to the HardwareSPI?
It would be great if you could share your sketch for understanding how things work.
Those are the ones that already take care of talking with the real hardware.
(The HardwareSPI.cpp/HardwareSPI.h are left over of legacy code, and probably could be deleted completely)
I did not replace the content of original SPI.cpp & SPI.h. I did replace the content of the HardwareSPI ones with the original SPI ones. Just for testing, to see if it compiles, because if it looks to the legacy HardwareSPI files while compiling, i thought to put the original SPI content into the HardwareSPI content would work and maybe somehow can recognise the setbitorder and extern SPI class.
As i said, by replacing, it bypasses the extern SPI class errors and setbitorder errors but can not convert to DMA.
You don’t need those, simply include SPI.h directly.
For the DMA stuff, if I remember, I’ve simply commented out.
It is there simply because F4 SPI is some kind of copy of the F1, and I didn’t ported it.
Maybe you can do the same since the arduino_uip is not using DMA anyway.
I commented the DMA stuff out.
Now it compiles but with the following errors. ( Also , I can not Ping the F4 yet)
libraries\arduino_uip\utility\Enc28J60Network.cpp.o: In function `Enc28J60Network::readOp(unsigned char, unsigned char)':
C:\Users\sly-VM\Documents\Arduino\hardware\Arduino_STM32-master\STM32F4\libraries\arduino_uip\utility/Enc28J60Network.cpp:476: warning: undefined reference to `SPI'
libraries\arduino_uip\utility\Enc28J60Network.cpp.o: In function `Enc28J60Network::writeOp(unsigned char, unsigned char, unsigned char)':
C:\Users\sly-VM\Documents\Arduino\hardware\Arduino_STM32-master\STM32F4\libraries\arduino_uip\utility/Enc28J60Network.cpp:485: warning: undefined reference to `SPI'
libraries\arduino_uip\utility\Enc28J60Network.cpp.o: In function `Enc28J60Network::readBuffer(unsigned short, unsigned char*)':
C:\Users\sly-VM\Documents\Arduino\hardware\Arduino_STM32-master\STM32F4\libraries\arduino_uip\utility/Enc28J60Network.cpp:497: warning: undefined reference to `SPI'
libraries\arduino_uip\utility\Enc28J60Network.cpp.o: In function `Enc28J60Network::writeBuffer(unsigned short, unsigned char*)':
C:\Users\sly-VM\Documents\Arduino\hardware\Arduino_STM32-master\STM32F4\libraries\arduino_uip\utility/Enc28J60Network.cpp:509: warning: undefined reference to `SPI'
libraries\arduino_uip\utility\Enc28J60Network.cpp.o: In function `Enc28J60Network::readByte(unsigned short)':
C:\Users\sly-VM\Documents\Arduino\hardware\Arduino_STM32-master\STM32F4\libraries\arduino_uip\utility/Enc28J60Network.cpp:383: warning: undefined reference to `SPI'
libraries\arduino_uip\utility\Enc28J60Network.cpp.o:C:\Users\sly-VM\Documents\Arduino\hardware\Arduino_STM32-master\STM32F4\libraries\arduino_uip\utility/Enc28J60Network.cpp:392: warning: more undefined references to `SPI' follow
So, you have to instantiate it yourself in your main sketch as “SPIClass SPI(1);”, where 1 is the port number.


