smoltcp-rs / enc424j600 Goto Github PK
View Code? Open in Web Editor NEWsmoltcp driver for the ENC424J600 SPI Ethernet MAC
smoltcp driver for the ENC424J600 SPI Ethernet MAC
Currently, there is no delay code within the driver library itself. To properly initialise the controller, the following delays (in us) should appear in user's own implementation:
init_dev()
and before instantiating SpiEth
, e.g. in tx_stm32f407). [Section 2.7 of the datasheet]SpiEth
, during init_dev()
:
init_dev()
function. [Point 7, Section 8.1 of datasheet]Point 2i & 2ii should be done within the library and the user wouldn't need to care about the delays. In contrast, point 1 is hard to implement within the library since this must be done before instantiating any controller-related objects, e.g. the SPI port abstraction or the SpiEth
controller itself.
We can probably implement 2i & 2ii delays by acquiring some delay functions when init_dev()
is called. Here are some examples:
cortex_m::asm::delay()
) to the SpiEth::new()
constructorSpiEth::init_dev()
functionembedded_hal::blocking::delay::DelayUs
) to the SpiEth::new()
constructorSpiEth::init_dev()
functionUpdate: As of e9a3a5e, the 4th approach is chosen and has been tested on STM32-H407.
With a large MTU / RAW_FRAME_LENGTH_MAX
at 0x1000
, large amount stack space is consumed. Seems that large arrays are allocated onto the stack on transmitting/receiving packets.
On transmitting case, these few lines of code may have contributed to this issue.
Lines 54 to 60 in 010be3e
Lines 161 to 163 in 010be3e
Shrinking RAW_FRAME_LENGTH_MAX
to 1500 have improved this significantly in my case.
Is it worth looking into reusing large arrays? Or even allow static buffers to be supplied by user?
Hi there.
First of all great work, I've managed to this get this crate to work easily on my homebrewn ENC424J600 board.
Currently this is all very much dependent on stm32f4xx-hal
(which is cool ๐) but it doesn't make for a great universal driver, even the embedded-hal
trait is re-exported from there:
Lines 2 to 8 in b38c5ae
The Cargo.toml
is lying, too, since stm32f4xx-hal
is defacto not an optional
dependency. Even just using it from another project which is based on a STM32F4 is not possible at the moment due to this. ๐ข
Hence my question what the plans for the future are.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.