stm32-rs / stm32f1xx-hal

A Rust embedded-hal HAL impl for the STM32F1 family based on japarics stm32f103xx-hal
Apache License 2.0
575 stars 179 forks source link

Are there any working examples of the enc28j60 out there? #9

Open ninjasource opened 5 years ago

ninjasource commented 5 years ago

Hi, has anyone had any luck getting the enc28j60 example working? I am aware that it was disabled because it was not working on stable. However a nightly cargo build using the following command: cargo build --example enc28j60 --features="stm32f103,rt" gives a linker error as follows:

Compiling stm32f1xx-hal v0.1.1 (C:\Users\xxx\Source\Repos\stm32f1xx-hal) error: linking with 'rust-lld' failed: exit code: 1 ... = note: rust-lld: error: section '.text' will not fit in region 'FLASH': overflowed by 20 bytes rust-lld: error: section '.text' will not fit in region 'FLASH': overflowed by 70 bytes

Its not working on stm32f103xx-hal either.

Compiling with --release gives the following error: error: can't perform LTO when compiling incrementally

burrbull commented 5 years ago

Last two weeks japaric actively worked on jnet and enc28j60. I'm waiting until he publish them.

gbip commented 5 years ago

You can add incremental = false in the [release] section of your Cargo.toml to be able to compile with --release.

ninjasource commented 5 years ago

Thanks Paul, that solved compilation problems and now I don't have linking errors either. Very promising. Right now I am running a stripped down version but I will get in touch if I get the original working.

ninjasource commented 5 years ago

If anyone is interested I found an up to date enc28j60 example for the blue pill here: https://github.com/japaric/jnet/tree/master/firmware

gbip commented 5 years ago

If you are looking for a higher level module (TCP/UDP) there is also a crate for the w5500 !

therealprof commented 5 years ago

We also have lower level networking with examples in the https://github.com/adamgreig/stm32f4-smoltcp-demo

ninjasource commented 5 years ago

Hi Paul, my first attempt was with the w5500 but I abandoned it because I could not get it to work. Not saying that it doesn't work but there was a lack of activity surrounding that crate and it is therefore no good for beginners right now.