|
@@ -4,6 +4,8 @@ from typing import Iterable, Union, Optional, Tuple
|
|
from serial import Serial
|
|
from serial import Serial
|
|
import shutil
|
|
import shutil
|
|
import subprocess
|
|
import subprocess
|
|
|
|
+import re
|
|
|
|
+import inquirer
|
|
|
|
|
|
|
|
|
|
class ErrorAT32(IOError):
|
|
class ErrorAT32(IOError):
|
|
@@ -208,6 +210,18 @@ class FlashAT32:
|
|
self.write_flash(address, f.read())
|
|
self.write_flash(address, f.read())
|
|
|
|
|
|
|
|
|
|
|
|
+def menu_test():
|
|
|
|
+ questions = [
|
|
|
|
+ inquirer.List('size',
|
|
|
|
+ message="What size do you need?",
|
|
|
|
+ choices=['Jumbo', 'Large', 'Standard', 'Medium', 'Small', 'Micro'],
|
|
|
|
+ ),
|
|
|
|
+ ]
|
|
|
|
+ answers = inquirer.prompt(questions)
|
|
|
|
+ print(answers)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
if __name__ == '__main__':
|
|
if __name__ == '__main__':
|
|
|
|
|
|
# Копируем бинарники и добавляем CRC в fw.bin
|
|
# Копируем бинарники и добавляем CRC в fw.bin
|
|
@@ -218,8 +232,9 @@ if __name__ == '__main__':
|
|
# print('Добавление CRC в fw.bin')
|
|
# print('Добавление CRC в fw.bin')
|
|
# os.startfile('bin\crc_ewarm.exe')
|
|
# os.startfile('bin\crc_ewarm.exe')
|
|
|
|
|
|
|
|
+ """
|
|
start_time = time.time()
|
|
start_time = time.time()
|
|
- d = FlashAT32('COM3', 115200 * 1)
|
|
|
|
|
|
+ d = FlashAT32('COM53', 115200 * 8)
|
|
d.DEBUG_PRINT = True
|
|
d.DEBUG_PRINT = True
|
|
try:
|
|
try:
|
|
d.connect()
|
|
d.connect()
|
|
@@ -228,18 +243,17 @@ if __name__ == '__main__':
|
|
print(d.get_flash_size())
|
|
print(d.get_flash_size())
|
|
print(d.get_uid_str())
|
|
print(d.get_uid_str())
|
|
|
|
|
|
- """
|
|
|
|
d.erase_flash()
|
|
d.erase_flash()
|
|
- iap_path = '../output/iap.bin'
|
|
|
|
- fw_path = '../output/fw.bin'
|
|
|
|
- iap_path_r = '../output/m3_artery_iap.bin'
|
|
|
|
- fw_path_r = '../output/m3_artery_fw.bin'
|
|
|
|
|
|
+ iap_path = 'bin/iap.bin'
|
|
|
|
+ fw_path = 'bin/fw.bin'
|
|
|
|
+ iap_path_r = 'bin/m3_artery_iap.bin'
|
|
|
|
+ fw_path_r = 'bin/m3_artery_fw.bin'
|
|
d.write_file_to_flash(0x08000000, iap_path)
|
|
d.write_file_to_flash(0x08000000, iap_path)
|
|
d.write_file_to_flash(0x08021000, fw_path)
|
|
d.write_file_to_flash(0x08021000, fw_path)
|
|
d.read_flash_to_file(0x08000000, os.path.getsize(iap_path), iap_path_r)
|
|
d.read_flash_to_file(0x08000000, os.path.getsize(iap_path), iap_path_r)
|
|
d.read_flash_to_file(0x08021000, os.path.getsize(fw_path), fw_path_r)
|
|
d.read_flash_to_file(0x08021000, os.path.getsize(fw_path), fw_path_r)
|
|
- os.system(f'diff {iap_path} {iap_path_r}')
|
|
|
|
- os.system(f'diff {fw_path} {fw_path_r}')
|
|
|
|
|
|
+ # os.system(f'diff {iap_path} {iap_path_r}')
|
|
|
|
+ # os.system(f'diff {fw_path} {fw_path_r}')
|
|
os.remove(iap_path_r)
|
|
os.remove(iap_path_r)
|
|
os.remove(fw_path_r)
|
|
os.remove(fw_path_r)
|
|
|
|
|