ENC424J600-master_VERYIMP.zip

  • 快乐的响板
    了解作者
  • C/C++
    开发工具
  • 70KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 0
    下载次数
  • 2021-04-27 16:49
    上传日期
ENC424J600以太网控制器模块支持以下接口之一的操作:串行外围接口(SPI)或并行从端口(PSP)。该Rust库支持将SPI用于所有与Rust嵌入式半板条箱兼容的嵌入式系统。
ENC424J600-master_VERYIMP.zip
  • ENC424J600-master
  • src
  • lib.rs
    8.3KB
  • spi.rs
    6.6KB
  • tx.rs
    2.2KB
  • rx.rs
    3KB
  • smoltcp_phy.rs
    3.7KB
  • .cargo
  • config
    408B
  • nix
  • channel-rust-nightly.toml
    472.5KB
  • rustPlatform.nix
    481B
  • tmux.sh
    574B
  • itm-tools-cargo-lock.patch
    8.4KB
  • itm-tools.nix
    638B
  • examples
  • tx_stm32f407.rs
    3.9KB
  • tcp_stm32f407.rs
    8.2KB
  • memory.x
    332B
  • shell.nix
    4KB
  • openocd.gdb
    185B
  • Cargo.lock
    8.2KB
  • README.md
    6.7KB
  • Cargo.toml
    1.6KB
内容介绍
# ENC424J600 Driver ## General Instructions The ENC424J600 Ethernet controller module supports operation in one of the following interfaces: Serial Peripheral Interace (SPI), or Parallel Slave Port (PSP). This Rust library supports the use of SPI for all embedded systems compatible with the Rust [`embedded-hal`](https://crates.io/crates/embedded-hal) crate. On ENC424J600, the **INTn/SPISEL** pin is multiplexed with an **interrupt function** (INTn) and an **interface selection function** (SPISEL). During power-up, to select SPI as the interface, INTn/SPISEL needs to latch a logic high for 1-10 us, driven outside of ENC424J600. After ENC424J600 has been initialsed, the same pin can be used to indicate occurrence of interrupt with a logic low, or idling with a logic high, driven by ENC424J600. Therefore, on the microcontroller side, the mode of driving the pin should be chosen by design: it should be **tri-stated** if interrupt is enabled, or **push-pull** otherwise. To help facilitate the user, we provide a [`nix-shell`](https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html#idm140737320154096) environment and a set of Shell scripts to perform certain tasks, such as creating a ready-to-use [`tmux`](https://github.com/tmux/tmux/wiki) session for debugging an STM32 microcontroller, as well as compiling and running STM32-based examples. ### Instructions for STM32F407 Examples Currently, the provided examples are for STM32F4xx microcontrollers using the Rust [`stm32f4xx-hal`](https://crates.io/crates/stm32f4xx-hal) crate. These examples assume that the **SPI1** port is connected to the Ethernet module, and the **GPIO PA1** pin is connected to its SPISEL pin. Since no interrupts are involved, GPIO PA1 is configured as a **push-pull** output to only initialise the controller. The program output is logged via ITM stimulus port 0. ## Examples ### Endless Pinging - `tx_stm32f407` This program demonstrates the Ethernet TX capability on an STM32F407 board. Once loaded and initialised, a specific ping packet is sent (broadcasted) every 100ms. Such a packet has the following properties: * Destination MAC Address: ff-ff-ff-ff-ff-ff * Source MAC Address: 08-60-6e-44-42-95 * Destination IP Address: 192.168.1.231 * Source IP Address: 192.168.1.100 * Frame Length in Bytes: 64 #### How-to 1. Connect your STM32F407 device to the computer. Without changing any code, you may use an STLink V2 debugger. 2. Create a `tmux` session for debugging: ```sh $ nix-shell [nix-shell]$ run-tmux-env ``` 3. When the `tmux` session is ready, on the top-right pane, compile and run the example program: ```sh [nix-shell]$ tx_stm32f407 ``` 4. Observe the output on the left pane. If you wish to debug manually, run `run-help` to see the list of all available commands. #### Expected Output (Note: the MAC address is an example only.) ``` Eth TX Pinging on STM32-F407 via NIC100/ENC424J600 Ethernet initialised. MAC Address = 04-91-62-3e-fc-1e Promiscuous Mode ON Sending packet (len=64): dest=ff-ff-ff-ff-ff-ff src=08-60-6e-44-42-95 data=08060001 08000604 ... Packet sent Sending packet (len=64): dest=ff-ff-ff-ff-ff-ff src=08-60-6e-44-42-95 data=08060001 08000604 ... Packet sent ... ``` ### TCP Echoing & Greeting - `tcp_stm32f407` This program demonstrates the TCP connectivity using **smoltcp** on an STM32F407 board. Once loaded and initialised, two TCP sockets will be opened on a specific IPv4 address. These sockets are: 1. **Echoing port - 1234** * This socket receives raw data on all incoming TCP packets on the said port and prints them back on the output. * Note that this socket has a time-out of 10s. 2. **Greeting port - 4321** * This socket waits for a single incoming TCP packet on the said port, and sends a TCP packet holding a text of greeting on the port. * Note that once a greeting is sent, the socket is closed immediately. Further packets received by the controller are dropped until the initiator disconnects from the port. #### How-to 1. Connect your STM32F407 device to the computer. Without changing any code, you may use an STLink V2 debugger. 2. Create a `tmux` session for debugging: ```sh $ nix-shell [nix-shell]$ run-tmux-env ``` 3. When the `tmux` session is ready, on the top-right pane, compile and run the example program. Choose your own IPv4 address and prefix length: ```sh [nix-shell]$ tcp_stm32f407 <ip> <prefix> ``` 4. To test the TCP ports, switch to the bottom-right pane (with <kbd>Ctrl</kbd>+<kbd>B</kbd>, followed by an arrow key) and use utilities like NetCat (`nc`): ```sh $ nc <ip> <port-number> ``` Multiple instances of Netcat can run to use all the ports simultaneously. Use Ctrl+C to disconnect from the port manually (especially for the greeting port). 5. Observe the output on the left pane. If you wish to debug manually, run `run-help` to see the list of all available commands. #### Expected Output (Note: the IP address, MAC address and timestamps shown below are examples only.) ITM output at the initial state: ``` Eth TCP Server on STM32-F407 via NIC100/ENC424J600 Ethernet initialised. Timer initialised. MAC Address = 04-91-62-3e-fc-1e TCP sockets will listen at 192.168.1.77/24 [0.0s] Listening to port 1234 for echoing, time-out in 10s [0.0s] Listening to port 4321 for greeting, please connect to the port ``` The user connects to port 1234 and sends two packets with the following commands: ```sh $ nc 192.168.1.77 1234 Hello World! Bye World! ``` The following is appended to the ITM output: ``` [12.950s] Received packet: Ok("Hello world!\n") [19.0s] Received packet: Ok("Bye world!\n") ``` The user then connects port 4321 with the following command, and immediately receives the following message on their console: ```sh $ nc 192.168.1.77 4321 Welcome to the server demo for STM32-F407! ``` The following is appended to the ITM output: ``` [24.200s] Greeting sent, socket closed ``` After 10 seconds of the user not sending any more packets on port 1234, the following is appended to the ITM output; meanwhile, the socket is closed by `nc` for the user: ``` [29.0s] Listening to port 1234 for echoing, time-out in 10s ``` The user can now re-connect to port 1234 again. For port 4321, without closing the port by exiting `nc`, the user keeps sending any packets with the utility. Since the Ethernet controller has already closed the socket, these new packets are dropped and the following error messages are appended to the ITM output: ``` [35.950s] Poll error: Dropped [36.150s] Poll error: Dropped ... ``` The user then disconnects from port 4321 by exiting `nc`, and the following message is appended to the ITM output: ``` [40.200s] Listening to port 4321 for greeting, please connect to the port ``` The user can now re-connect to port 4321 again.
评论
    相关推荐
    • SIM800C_MQTT.rar
      使用SIM800C模块,使用MQTT协议,连接中国移动onenet平台,能实现数据的订阅、发布、存储等
    • android从bootloader到launcher启动流程整理
      讲述android 开机流程 从boot rom---bootloader---init--zygote---systemserver---ams 并附上自己整理的每个流程的流程图 ,清晰熟悉android 启动流程
    • matlabpam代码-dsp-library:用于光通信的MATLABDSP函数库
      matlab pam代码 DSP库 该项目包含几种不同的功能,可将DSP算法应用于光通信。 这些功能适用于相干和非相干(PAM,DMT)光通信。 大多数功能是相互独立的。 因此,该代码中的功能可以轻松使用,并与其他DSP功能结合使用。 用法 功能列表以及简短说明在文件中。 输入和输出参数的描述在每个函数的标题中。 讯号 通常,输入(和输出)信号在第一维度上具有时间(例如,列向量),而第二维度用于一次管理多个信号(例如,不同的极化,不同的参数等)。 之所以选择这种约定,是因为MATLAB通过将列保留在内存的连续部分中来存储矩阵,因此,这种约定比其他方法(行向量)要快。 参数 大多数功能使用参数结构作为输入参数。 函数中使用的参数的描述通常在标头中,而coherent-dsp函数的默认参数在文件中。 参考 执照 此代码在下发布。
    • 有关多目标跟踪的PHD滤波的一些资料
      一些关于多目标跟踪的新的文献,主要是有关概率假设密度(PHD)的
    • 基于python开发的全国新工商采集工具 v1.2版本
      这个软件是通过scrapy爬虫框架结合代理IP池再加上request模拟请求技术以及验证码识别技术,可以做到日更新采集全国新工商信息。采集的数据自动存储在mysql数据库表里,可下载全量1.8亿多企业工商基本信息和36维度的详细信息.支持sql和excel导出数据包格式。
    • 卷积神经网络
      这是卷积神经网络的一个实际用例,已经调试好了,能够在matlab上成功运行,适合从事卷积神经网络(CNN)研究的人员学习使用。
    • matlab匹配滤波代码-matlab_for_thesis:Matlab博士学位论文代码
      matlab匹配滤波代码博士论文的MATLAB代码 博士论文的MATLAB代码的一部分,“井田双色散水下声通道中的多载波通信”。 函数下的func_JingTian文件夹 FUNC_JINGTIAN包含多载波通信中一些通常需要的功能: OFDM调制/解调模块,包括几种数据辅助的信道估计方法和差分解调; 快速实现GFDM和C-FBMC调制/解调,分别包括时域和频域的迫零(ZF)和匹配滤波(MF)均衡; 为OFDM信道估计中使用的压缩感测方法计算字典的功能; 增加信道效应,施加宽带多普勒失真的功能; 通过线性调频Z变换(CZT)以任意精度对频域中的信号进行重采样; Hermite函数合成的信号之间的交叉歧义函数的计算。 演示文件夹 以下列出了四个演示 demo1:使用基本追踪(BP)算法形式的压缩感知方法对OFDM进行稀疏2-D信道估计; demo2:比较基本数据辅助OFDM信道估计算法,包括常规频域插值和基于IDFT的变换域方法; demo3:圆形滤波器组多载波(C-FBMC / OQAM)的基于DFT特征向量的原型滤波器合成; demo4:用于广义频分复用(GFDM)的辅助日期辅助无干
    • Aerosim Blockset
      The AeroSim aeronautical simulation blockset provides a complete set of tools for the rapid development of nonlinear 6-degree of freedom aircraft dynamic models. In addition to the basic aircraft dynamics blocks, the library also includes complete aircraft models which can be customized through parameter files.
    • OFDM的MATLAB仿真
      1.使用Matlab实现一个OFDM系统。 OFDM系统具体参数参照LTE标准,具体为: 系统带宽:5MHz; OFDM符号长度:0.0714ms; 子载波间隔:15kHz; CP长度:OFDM符号长度的7 ; FFT点数:512; 2.选择一种降低OFDM系统峰均比的算法,在1的基础上实现,并分析其性能。
    • matlab开发-级联H桥多电平转换三相
      matlab开发-级联H桥多电平转换三相。级联H桥多电平逆变器三相仿真