You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dear add.
I use PY32F003
Im upload code ok, firmware flash succesfully but MCU not work.
But i use keilc and use stlink upload ok and it work( blink led).
Please help me !
thanks
My code python:
import tkinter as tk
import subprocess
import time
import serial
from serial.tools.list_ports import comports
hello ad,
This is log:
SUCCESS: Connection established via COM9.
Getting chip info ...
SUCCESS: Found PY32F0xx with bootloader v1.0.
Reading OPTION bytes ...
SUCCESS: OPTR: 0xaabe, SDKR: 0xff00, WRPR: 0xffff.
Performing chip erase ...
SUCCESS: Chip is erased.
Flashing Project.hex to MCU ...
Verifying ...
SUCCESS: 4220 bytes written and verified.
DONE.
Hi, puyaisp currently supports only binary files (.bin), NOT hex-files! That's why you uploaded only garbage. Please create a binary with your compiler and try again.
Dear add.
I use PY32F003
Im upload code ok, firmware flash succesfully but MCU not work.
But i use keilc and use stlink upload ok and it work( blink led).
Please help me !
thanks
My code python:
import tkinter as tk
import subprocess
import time
import serial
from serial.tools.list_ports import comports
===================================================================================
Constants for puyaisp tool
PY_VID = '0403'
PY_PID = '6001'
PY_BAUD = 115200
===================================================================================
Programmer Class from your code
class Programmer(serial.Serial):
def init(self):
super().init(baudrate=PY_BAUD, parity=serial.PARITY_EVEN, timeout=1)
self.identify()
===================================================================================
Flash Firmware Function
def flash_firmware():
try:
# Thực thi lệnh nạp firmware
subprocess.run(['puyaisp', '-f', 'Project.hex'], check=True)
status_label.config(text="Firmware flashed successfully!", fg="green")
except subprocess.CalledProcessError:
# Thông báo lỗi nếu việc nạp firmware thất bại
status_label.config(text="Failed to flash the program.", fg="red")
except Exception as e:
# Xử lý lỗi ngoài mong đợi
status_label.config(text=f"An unexpected error occurred: {str(e)}", fg="red")
===================================================================================
Create GUI
root = tk.Tk()
root.title("Flasher GUI")
root.geometry("300x120") # Kích thước cửa sổ
Tạo nút nạp firmware
flash_button = tk.Button(root, text="Flash Firmware", command=flash_firmware)
flash_button.pack(pady=20)
Tạo nhãn trạng thái
status_label = tk.Label(root, text="", font=("Arial", 12))
status_label.pack(pady=10)
Chạy GUI
root.mainloop()
The text was updated successfully, but these errors were encountered: