forked from yoursunny/esp-fipsy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from MoCoMakers/develop
FipsyV2 - MachX02-1200 Integration
- Loading branch information
Showing
18 changed files
with
4,099 additions
and
304 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
*.o | ||
*.out | ||
/.vscode | ||
/examples/*/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,23 @@ | ||
# Fipsy FPGA Programmer for ESP32 | ||
|
||
**esp-fipsy** library allows programming a [Fipsy FPGA breakout board](https://www.mocomakers.com/fipsy-fpga/) from an ESP32 microcontroller. | ||
This library can only program the fuse table; it does not write the Feature Row or FEABITS. | ||
[TcpFipsyLoader](examples/TcpFipsyLoader/) demonstrates how to use this library. | ||
**esp-fipsy** library allows programming a [Fipsy FPGA breakout board](https://www.fipsyfpga.com/) from an ESP32 microcontroller. | ||
|
||
This library can be used in the Arduino IDE. | ||
|
||
When using this project directly: | ||
1. Visit the documentation for the ESP32 programmer on [https://www.fipsyfpga.com](https://www.fipsyfpga.com) | ||
2. Program the ESP32 as a programmer using the [TcpFipsyLoader](examples/TcpFipsyLoader/). This file demonstrates how to use this library. | ||
3. Once you have the IP address for the ESP32 use the [sendJed.py](scripts/sendJed.py) file to program the device. For example: | ||
|
||
``` | ||
python sendJed.py --file "C:\Users\myuser\Projects\Fipsy-FPGA-edu\Examples\FipsyV2 - XO2-1200\1. Blinky\project_files\Implementation\FipsyBaseline_Implementation.jed" 192.168.1.194 | ||
``` | ||
|
||
For more information please see: [FipsyFPGA.com](https://www.fipsyfpga.com) | ||
|
||
|
||
|
||
|
||
## Acknowledgements | ||
|
||
We would like to thank Junxiao (Sunny) Shi - [yoursunny.com](https://yoursunny.com/) for significant contributions to the ESP32 programmer! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
name=esp-fipsy | ||
version=0.0.20240618 | ||
version=0.0.20241004 | ||
author=Junxiao Shi | ||
maintainer=Junxiao Shi | ||
sentence=Fipsy FPGA programmer. | ||
paragraph=This library programs MocoMakers Fipsy FPGA chip from ESP32 microcontroller. | ||
category=Device Control | ||
url=https://yoursunny.com | ||
url=https://www.fipsyfpga.com | ||
architectures=esp32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
""" | ||
Sends a .jed file to your ESP32 | ||
Example Usage: | ||
python sendJed.py 192.168.1.2 --file 'C:\path\to\yourfiqle.jed' | ||
or | ||
python sendJed.py 192.168.1.2 --port 34779 --file 'C:\path\to\yourfile.jed' | ||
""" | ||
|
||
import socket | ||
import argparse | ||
import os | ||
|
||
def netcat(host, port, content): | ||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | ||
s.connect((host, int(port))) | ||
s.sendall(content) | ||
s.shutdown(socket.SHUT_WR) | ||
while True: | ||
data = s.recv(4096) | ||
if not data: | ||
break | ||
print(repr(data.decode('utf-8'))) | ||
s.close() | ||
|
||
def client(ip, port, filename): | ||
# Check if file exists | ||
if not os.path.isfile(filename): | ||
raise FileNotFoundError(f"File {filename} does not exist.") | ||
|
||
# Check if file ends with .jed | ||
if not filename.endswith('.jed'): | ||
raise ValueError("File must end with .jed extension.") | ||
|
||
# Check if file has non-zero size | ||
if os.path.getsize(filename) == 0: | ||
raise ValueError("File is empty.") | ||
|
||
client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | ||
client_socket.connect((ip, port)) | ||
print("Device connection initiated") | ||
|
||
with open(filename, 'rb') as file: | ||
content = file.read() | ||
netcat(ip, port, content) | ||
|
||
if __name__ == "__main__": | ||
parser = argparse.ArgumentParser(description='Send a .jed file over TCP and print returned text.') | ||
parser.add_argument('ip', type=str, help='The IP address of the ESP32 server.') | ||
parser.add_argument('--port', type=int, default=34779, help='The port number to connect to (default is 34779).') | ||
parser.add_argument('--file', type=str, required=True, help='The path to the .jed file to send.') | ||
|
||
args = parser.parse_args() | ||
|
||
client(args.ip, args.port, args.file) |
Oops, something went wrong.