Arduino STM32 Ethernet
1.0.0
W5X00 이더넷 모듈의 Arduino STM32 예.
이 프로젝트는이 라이브러리를 사용합니다.
Platformio는 INI 파일에 따라 필요한 라이브러리를 자동으로 설치합니다.
엄청난!
플랫폼
$ python3 --version
Python 3.7.3
$ sudo apt install python3-pip python3-setuptools
$ python3 -m pip -V
pip 18.1 from /usr/lib/python3/dist-packages/pip (python 3.7)
# pip installed by apt is old, so update to the latest.
$ python3 -m pip install -U pip
$ python3 -m pip -V
pip 20.3.1 from /home/orangepi/.local/lib/python3.7/site-packages/pip (python 3.7)
# Update wheels.
$ python3 -m pip install -U wheel
$ pip3 install -U platformio


라이브러리 내부에서 자동으로 선택됩니다.
| Phy | STM32 | |
|---|---|---|
| 모시 | PA7 | |
| 된장 | PA6 | |
| SCLK | PA5 | |
| 봄 여름 시즌 | PA4 | *1 |
| rst | 다시 놓기 | *2 |
| 3.3v | 3.3v | *3 |
| Gnd | Gnd | *3 |
(*1)
Platformio.ini에서 모든 핀을 지정할 수 있습니다.
(*2)
재설정 핀이 없을 때 당겨집니다.
(*3)
Bluepill 또는 Blackpill 보드는 너무 많은 전류를 공급할 수 없습니다. 외부 전원에서 공급할 때 더 안정적입니다.
+----------+ +----------+ +----------+
|BluePill | |ST-LINK | |HOST |
|BlackPill | | [------------] |
| |------------|SWD-IO [ USB ] |
| |------------|SWD-CLK [------------] |
| |------------|GND | | |
| |------------|3V3 | | |
| | +----------+ | |
| | | |
| | +----------+ | |
+----------+ | PA9|------------|RX | | |
| |---(MOSI)---| GND|------------|GND | | |
| |---(MISO)---| | | | | |
| |---(SCLK)---| | | | | |
| |---(SS)-----| | | USB-TTL [------------] |
| |---(RESET)--| | | [ USB ] |
| | | | | [/dev/ttyUSB0] |
| PHY | | | | [------------] |
| | +----------+ | | | |
| | | | | |
| | +----------+ | | | |
| |---(3V3)----|5v->3.3V |----(5V)----| | | |
| |---(GND)----|Regulator |----(GND)---| | | |
+----------+ +----------+ +----------+ +----------+
+----------+ +----------+ +----------+
|BluePill | |ST-LINK | |HOST |
|BlackPill | | [------------] |
| |------------|SWD-IO [ USB ] |
| |------------|SWD-CLK [------------] |
| |------------|GND | | |
| | | | | |
| | +----------+ | |
| | | |
| [------------------------------------] |
+----------+ | [ USB ] |
| |---(MOSI)---| [------------------------------------] |
| |---(MISO)---| | | |
| |---(SCLK)---| | | |
| |---(SS)-----| |-------+ | |
| |---(RESET)--| |---+ | | |
| | | | | | | |
| PHY | | | | (GND) | |
| | +----------+ (5V) | | |
| | | | | |
| | +----------+ | | | |
| |---(3V3)----|5v->3.3V |---+ | | |
| |---(GND)----|Regulator |-------+ | |
+----------+ +----------+ +----------+
+----------+ +----------+ +----------+
|BluePill | |USB-TTL | |HOST |
|BlackPill | | [------------] |
| |----(5V)----| [ USB ] |
| |----(GND)---| [------------] |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
+----------+ | PA9|------------|RX | | |
| |---(MOSI)---| | | | | |
| |---(MISO)---| | | | | |
| |---(SCLK)---| | | | | |
| |---(SS)-----| |-------+ | | | |
| |---(RESET)--| |---+ | | | | |
| | | | | | | | | |
| PHY | | | | (GND) | | | |
| | +----------+ (5V) | | | | |
| | | | | | | |
| | +----------+ | | | | | |
| |---(3V3)----|5v->3.3V |---+ | | | | |
| |---(GND)----|Regulator |-------+ | | | |
+----------+ +----------+ +----------+ +----------+
+----------+ +----------+
|BluePill | |HOST |
|BlackPill [------------------------------------] |
| [ USB ] |
| [------------------------------------] |
| | | |
| | | |
| | | |
| | | |
| | | |
+----------+ | | | |
| |---(MOSI)---| | | |
| |---(MISO)---| | | |
| |---(SCLK)---| | | |
| |---(SS)-----| |-------+ | |
| |---(RESET)--| |---+ | | |
| | | | | | | |
| PHY | | | | (GND) | |
| | +----------+ (5V) | | |
| | | | | |
| | +----------+ | | | |
| |---(3V3)----|5v->3.3V |---+ | | |
| |---(GND)----|Regulator |-------+ | |
+----------+ +----------+ +----------+
Serial.print Goto Pa9.
git clone https://github.com/nopnop2002/Arduino-STM32-Ethernet
cd Arduino-STM32-Ethernet/DhcpAddressPrinter
pio run -t upload -e bluepill_f103c8
Serial.print는 USB Virtual Com 포트에 출력됩니다.
/dev/ttyacm0이 변경 될 수 있습니다.
git clone https://github.com/nopnop2002/Arduino-STM32-Ethernet
cd Arduino-STM32-Ethernet/DhcpAddressPrinter
pio run -e bluepill_f103c8_usbcon -t upload && pio device monitor -b 115200 -p /dev/ttyACM0
여기를 참조하십시오.