feat(core): micropython板卡烧录固件时支持调整波特率

This commit is contained in:
王立帮
2025-09-13 22:56:12 +08:00
parent 29280ddd9a
commit 167c6e9e30
21 changed files with 676 additions and 57 deletions

View File

@@ -54,6 +54,10 @@ import * as MicroPythonSerialGenerators from './generators/serial';
import * as MicroPythonSystemGenerators from './generators/system';
import * as MicroPythonWeatherGenerators from './generators/weather';
import * as MicroPythonZhHans from './language/zh-hans';
import * as MicroPythonZhHant from './language/zh-hant';
import * as MicroPythonEn from './language/en';
import { Python } from './python_generator';
export {
@@ -111,5 +115,8 @@ export {
MicroPythonSerialGenerators,
MicroPythonSystemGenerators,
MicroPythonWeatherGenerators,
MicroPythonZhHans,
MicroPythonZhHant,
MicroPythonEn,
Python
};

View File

@@ -0,0 +1,9 @@
import * as Mixly from 'mixly';
import TEMPLATE from '../template/board-config-message.html';
const { XML } = Mixly;
export const MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED = XML.render(TEMPLATE, {
title: 'Burn Speed',
message: 'To select the flashing speed, change the Burn Speed. This value will be used for flashing the code to the device. If you have issues while flashing the device at high speed, try to decrease this value. This could be due to the external serial-to-USB chip limitations.'
});

View File

@@ -0,0 +1,9 @@
import * as Mixly from 'mixly';
import TEMPLATE from '../template/board-config-message.html';
const { XML } = Mixly;
export const MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED = XML.render(TEMPLATE, {
title: '烧录速度',
message: '要选择烧录速度请更改“Burn Speed”此值将用于向设备烧录代码。如果在用较高的烧录速度时出现问题请尝试减小此值这可能是由于外部串行到USB芯片的限制。'
});

View File

@@ -0,0 +1,9 @@
import * as Mixly from 'mixly';
import TEMPLATE from '../template/board-config-message.html';
const { XML } = Mixly;
export const MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED = XML.render(TEMPLATE, {
title: '燒錄速度',
message: '要選擇燒錄速度請更改“Burn Speed”此值將用於向設備燒錄程式碼。如果在用較高的燒錄速度時出現問題請嘗試减小此值這可能是由於外部串列到USB晶片的限制。'
});

View File

@@ -0,0 +1,14 @@
<div>
<h5 style="
font-weight: bold;
padding-bottom: 8px;
user-select: text;
">{{-d.title}}</h5>
<div>
{{# if (d.message) { }}
<p style="white-space: normal;user-select: text;padding-bottom: 5px;">
{{-d.message}}
</p>
{{# } }}
</div>
</div>

View File

@@ -71,7 +71,10 @@ import {
MicroPythonSensorOnBoardGenerators,
MicroPythonSerialGenerators,
MicroPythonSystemGenerators,
MicroPythonWeatherGenerators
MicroPythonWeatherGenerators,
MicroPythonZhHans,
MicroPythonZhHant,
MicroPythonEn
} from '@mixly/micropython';
import {
@@ -90,6 +93,11 @@ import './css/color_esp32c3_mixgocc.css';
Object.assign(Blockly.Variables, Variables);
Object.assign(Blockly.Procedures, Procedures);
Object.assign(Blockly.Lang.ZhHans, MicroPythonZhHans);
Object.assign(Blockly.Lang.ZhHant, MicroPythonZhHant);
Object.assign(Blockly.Lang.En, MicroPythonEn);
Blockly.Python = Python;
Blockly.generator = Python;

View File

@@ -1,21 +1,48 @@
{
"board": {
"mpython": "micropython:educore:educore"
"mpython": {
"key": "micropython:educore:educore",
"config": [
{
"key": "BurnSpeed",
"label": "Burn Speed",
"messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
"options": [
{
"key": "460800",
"label": "460800"
},
{
"key": "115200",
"label": "115200"
},
{
"key": "230400",
"label": "230400"
},
{
"key": "921600",
"label": "921600"
}
]
}
]
}
},
"language": "MicroPython",
"burn": {
"type": "command",
"portSelect": "all",
"micropython:educore:educore": {
"command": "\"{esptool}\" --chip esp32c2 --port {com} --baud 115200 --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32c2 --port {com} --baud 460800 --after=no_reset_stub write_flash 0x0 \"{indexPath}/build/Mixgo_Mini_lib-v1.23.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\"",
"command": "\"{esptool}\" --chip esp32c2 --port {com} --baud {baudrate} --after=no_reset_stub write_flash -e 0x0 \"{indexPath}/build/Mixgo_Mini_lib-v1.23.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\"",
"special": [
{
"name": "Firmware No Ble With SSL",
"command": "\"{esptool}\" --chip esp32c2 --port {com} --baud 115200 --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32c2 --port {com} --baud 460800 --after=no_reset_stub write_flash 0x0 \"{indexPath}/build/Mixgo_Mini_lib-v1.23.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
"command": "\"{esptool}\" --chip esp32c2 --port {com} --baud {baudrate} --after=no_reset_stub write_flash -e 0x0 \"{indexPath}/build/Mixgo_Mini_lib-v1.23.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
},
{
"name": "Firmware With Ble No SSL",
"command": "\"{esptool}\" --chip esp32c2 --port {com} --baud 115200 --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32c2 --port {com} --baud 460800 --after=no_reset_stub write_flash 0x0 \"{indexPath}/build/Mixgo_Mini_lib_ble-v1.23.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
"command": "\"{esptool}\" --chip esp32c2 --port {com} --baud {baudrate} --after=no_reset_stub write_flash -e 0x0 \"{indexPath}/build/Mixgo_Mini_lib_ble-v1.23.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
}
]
}

View File

@@ -69,7 +69,10 @@ import {
MicroPythonSensorOnBoardGenerators,
MicroPythonSerialGenerators,
MicroPythonSystemGenerators,
MicroPythonWeatherGenerators
MicroPythonWeatherGenerators,
MicroPythonZhHans,
MicroPythonZhHant,
MicroPythonEn
} from '@mixly/micropython';
import {
@@ -82,6 +85,11 @@ import './css/color_esp32_mixgo.css';
Object.assign(Blockly.Variables, Variables);
Object.assign(Blockly.Procedures, Procedures);
Object.assign(Blockly.Lang.ZhHans, MicroPythonZhHans);
Object.assign(Blockly.Lang.ZhHant, MicroPythonZhHant);
Object.assign(Blockly.Lang.En, MicroPythonEn);
Blockly.Python = Python;
Blockly.generator = Python;

View File

@@ -1,25 +1,133 @@
{
"board": {
"MixGo": "micropython:esp32:mixgo",
"MixGo PE": "micropython:esp32:mixgo_pe",
"mPython": "micropython:esp32:mpython",
"ESP32 Generic(4MB)": "micropython:esp32:generic"
"MixGo": {
"key": "micropython:esp32:mixgo",
"config": [
{
"key": "BurnSpeed",
"label": "Burn Speed",
"messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
"options": [
{
"key": "460800",
"label": "460800"
},
{
"key": "115200",
"label": "115200"
},
{
"key": "230400",
"label": "230400"
},
{
"key": "921600",
"label": "921600"
}
]
}
]
},
"MixGo PE": {
"key": "micropython:esp32:mixgo_pe",
"config": [
{
"key": "BurnSpeed",
"label": "Burn Speed",
"messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
"options": [
{
"key": "460800",
"label": "460800"
},
{
"key": "115200",
"label": "115200"
},
{
"key": "230400",
"label": "230400"
},
{
"key": "921600",
"label": "921600"
}
]
}
]
},
"mPython": {
"key": "micropython:esp32:mpython",
"config": [
{
"key": "BurnSpeed",
"label": "Burn Speed",
"messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
"options": [
{
"key": "460800",
"label": "460800"
},
{
"key": "115200",
"label": "115200"
},
{
"key": "230400",
"label": "230400"
},
{
"key": "921600",
"label": "921600"
}
]
}
]
},
"ESP32 Generic(4MB)": {
"key": "micropython:esp32:generic",
"config": [
{
"key": "BurnSpeed",
"label": "Burn Speed",
"messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
"options": [
{
"key": "460800",
"label": "460800"
},
{
"key": "115200",
"label": "115200"
},
{
"key": "230400",
"label": "230400"
},
{
"key": "921600",
"label": "921600"
}
]
}
]
}
},
"language": "MicroPython",
"burn": {
"type": "command",
"portSelect": "all",
"micropython:esp32:mixgo": {
"command": "\"{esptool}\" --chip esp32 --port {com} --baud 460800 erase_flash && \"{esptool}\" --port {com} --baud 460800 write_flash 0x1000 \"{indexPath}/build/Mixgo_lib-v1.25.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
"command": "\"{esptool}\" --port {com} --baud {baudrate} write_flash -e 0x1000 \"{indexPath}/build/Mixgo_lib-v1.25.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
},
"micropython:esp32:mixgo_pe": {
"command": "\"{esptool}\" --chip esp32 --port {com} --baud 460800 erase_flash && \"{esptool}\" --port {com} --baud 460800 write_flash 0x1000 \"{indexPath}/build/Mixgo_PE_lib-v1.25.0.bin\" 0x700000 \"{indexPath}/../micropython/build/HZK12.bin\""
"command": "\"{esptool}\" --port {com} --baud {baudrate} write_flash -e 0x1000 \"{indexPath}/build/Mixgo_PE_lib-v1.25.0.bin\" 0x700000 \"{indexPath}/../micropython/build/HZK12.bin\""
},
"micropython:esp32:generic": {
"command": "\"{esptool}\" --chip esp32 --port {com} --baud 460800 erase_flash && \"{esptool}\" --port {com} --baud 460800 write_flash 0x1000 \"{indexPath}/build/Generic_ESP32_lib-v1.25.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
"command": "\"{esptool}\" --port {com} --baud {baudrate} write_flash -e 0x1000 \"{indexPath}/build/Generic_ESP32_lib-v1.25.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
},
"micropython:esp32:mpython": {
"command": "\"{esptool}\" --chip esp32 --port {com} --baud 460800 erase_flash && \"{esptool}\" --port {com} --baud 460800 write_flash 0x1000 \"{indexPath}/build/mPython_lib-v1.25.0.bin\" 0x700000 \"{indexPath}/../micropython/build/HZK12.bin\""
"command": "\"{esptool}\" --port {com} --baud {baudrate} write_flash -e 0x1000 \"{indexPath}/build/mPython_lib-v1.25.0.bin\" 0x700000 \"{indexPath}/../micropython/build/HZK12.bin\""
}
},
"upload": {

View File

@@ -73,7 +73,10 @@ import {
MicroPythonSensorOnBoardGenerators,
MicroPythonSerialGenerators,
MicroPythonSystemGenerators,
MicroPythonWeatherGenerators
MicroPythonWeatherGenerators,
MicroPythonZhHans,
MicroPythonZhHant,
MicroPythonEn
} from '@mixly/micropython';
import {
@@ -93,6 +96,11 @@ import './css/color_esp32c3_mixgocc.css';
Object.assign(Blockly.Variables, Variables);
Object.assign(Blockly.Procedures, Procedures);
Object.assign(Blockly.Lang.ZhHans, MicroPythonZhHans);
Object.assign(Blockly.Lang.ZhHant, MicroPythonZhHant);
Object.assign(Blockly.Lang.En, MicroPythonEn);
Blockly.Python = Python;
Blockly.generator = Python;

View File

@@ -1,27 +1,81 @@
{
"board": {
"MixGo MINI": "micropython:esp32c2:mixgo_mini",
"ESP32C2 Generic(4M)": "micropython:esp32c2:generic_4M"
"MixGo MINI": {
"key": "micropython:esp32c2:mixgo_mini",
"config": [
{
"key": "BurnSpeed",
"label": "Burn Speed",
"messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
"options": [
{
"key": "460800",
"label": "460800"
},
{
"key": "115200",
"label": "115200"
},
{
"key": "230400",
"label": "230400"
},
{
"key": "921600",
"label": "921600"
}
]
}
]
},
"ESP32C2 Generic(4M)": {
"key": "micropython:esp32c2:generic_4M",
"config": [
{
"key": "BurnSpeed",
"label": "Burn Speed",
"messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
"options": [
{
"key": "460800",
"label": "460800"
},
{
"key": "115200",
"label": "115200"
},
{
"key": "230400",
"label": "230400"
},
{
"key": "921600",
"label": "921600"
}
]
}
]
}
},
"language": "MicroPython",
"burn": {
"type": "command",
"portSelect": "all",
"micropython:esp32c2:mixgo_mini": {
"command": "\"{esptool}\" --chip esp32c2 --port {com} --baud 115200 --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32c2 --port {com} --baud 460800 --after=no_reset_stub write_flash 0x0 \"{indexPath}/build/Mixgo_Mini_lib-v1.25.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\"",
"command": "\"{esptool}\" --chip esp32c2 --port {com} --baud {baudrate} --after=no_reset_stub write_flash -e 0x0 \"{indexPath}/build/Mixgo_Mini_lib-v1.25.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\"",
"special": [
{
"name": "Firmware For General Application",
"command": "\"{esptool}\" --chip esp32c2 --port {com} --baud 115200 --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32c2 --port {com} --baud 460800 --after=no_reset_stub write_flash 0x0 \"{indexPath}/build/Mixgo_Mini_lib-v1.25.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
"command": "\"{esptool}\" --chip esp32c2 --port {com} --baud {baudrate} --after=no_reset_stub write_flash -e 0x0 \"{indexPath}/build/Mixgo_Mini_lib-v1.25.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
},
{
"name": "Firmware Optimize For V2.x Board",
"command": "\"{esptool}\" --chip esp32c2 --port {com} --baud 115200 --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32c2 --port {com} --baud 460800 --after=no_reset_stub write_flash 0x0 \"{indexPath}/build/Mixgo_Mini_v2_lib-v1.25.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
"command": "\"{esptool}\" --chip esp32c2 --port {com} --baud {baudrate} --after=no_reset_stub write_flash -e 0x0 \"{indexPath}/build/Mixgo_Mini_v2_lib-v1.25.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
}
]
},
"micropython:esp32c2:generic_2M": {
"command": "\"{esptool}\" --chip esp32c2 --port {com} --baud 460800 erase_flash && \"{esptool}\" --chip esp32c2 --port {com} --baud 460800 write_flash 0x0 \"{indexPath}/build/Generic_C2_lib-v1.25.0.bin\" "
"command": "\"{esptool}\" --chip esp32c2 --port {com} --baud {baudrate} write_flash -e 0x0 \"{indexPath}/build/Generic_C2_lib-v1.25.0.bin\""
}
},
"upload": {

View File

@@ -71,7 +71,10 @@ import {
MicroPythonSensorOnBoardGenerators,
MicroPythonSerialGenerators,
MicroPythonSystemGenerators,
MicroPythonWeatherGenerators
MicroPythonWeatherGenerators,
MicroPythonZhHans,
MicroPythonZhHant,
MicroPythonEn
} from '@mixly/micropython';
import {
@@ -88,6 +91,11 @@ import './css/color_esp32c3_mixgocc.css';
Object.assign(Blockly.Variables, Variables);
Object.assign(Blockly.Procedures, Procedures);
Object.assign(Blockly.Lang.ZhHans, MicroPythonZhHans);
Object.assign(Blockly.Lang.ZhHant, MicroPythonZhHant);
Object.assign(Blockly.Lang.En, MicroPythonEn);
Blockly.Python = Python;
Blockly.generator = Python;

View File

@@ -1,25 +1,133 @@
{
"board": {
"MixGo ME": "micropython:esp32c3:mixgo_me",
"MixGo CC": "micropython:esp32c3:mixgo_cc",
"MixGo Car 4.2": "micropython:esp32c3:mixgocar_c3",
"ESP32C3 Generic(UART)": "micropython:esp32c3:generic"
"MixGo ME": {
"key": "micropython:esp32c3:mixgo_me",
"config": [
{
"key": "BurnSpeed",
"label": "Burn Speed",
"messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
"options": [
{
"key": "460800",
"label": "460800"
},
{
"key": "115200",
"label": "115200"
},
{
"key": "230400",
"label": "230400"
},
{
"key": "921600",
"label": "921600"
}
]
}
]
},
"MixGo CC": {
"key": "micropython:esp32c3:mixgo_cc",
"config": [
{
"key": "BurnSpeed",
"label": "Burn Speed",
"messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
"options": [
{
"key": "460800",
"label": "460800"
},
{
"key": "115200",
"label": "115200"
},
{
"key": "230400",
"label": "230400"
},
{
"key": "921600",
"label": "921600"
}
]
}
]
},
"MixGo Car 4.2": {
"key": "micropython:esp32c3:mixgocar_c3",
"config": [
{
"key": "BurnSpeed",
"label": "Burn Speed",
"messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
"options": [
{
"key": "460800",
"label": "460800"
},
{
"key": "115200",
"label": "115200"
},
{
"key": "230400",
"label": "230400"
},
{
"key": "921600",
"label": "921600"
}
]
}
]
},
"ESP32C3 Generic(UART)": {
"key": "micropython:esp32c3:generic",
"config": [
{
"key": "BurnSpeed",
"label": "Burn Speed",
"messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
"options": [
{
"key": "460800",
"label": "460800"
},
{
"key": "115200",
"label": "115200"
},
{
"key": "230400",
"label": "230400"
},
{
"key": "921600",
"label": "921600"
}
]
}
]
}
},
"language": "MicroPython",
"burn": {
"type": "command",
"portSelect": "all",
"micropython:esp32c3:mixgo_cc": {
"command": "\"{esptool}\" --chip esp32c3 --port {com} --baud 460800 erase_flash && \"{esptool}\" --chip esp32c3 --port {com} --baud 460800 write_flash 0x0 \"{indexPath}/build/Mixgo_CC_lib-v1.23.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
"command": "\"{esptool}\" --chip esp32c3 --port {com} --baud {baudrate} write_flash -e 0x0 \"{indexPath}/build/Mixgo_CC_lib-v1.23.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
},
"micropython:esp32c3:mixgo_me": {
"command": "\"{esptool}\" --chip esp32c3 --port {com} --baud 460800 erase_flash && \"{esptool}\" --chip esp32c3 --port {com} --baud 460800 write_flash 0x0 \"{indexPath}/build/Mixgo_ME_lib-v1.23.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
"command": "\"{esptool}\" --chip esp32c3 --port {com} --baud {baudrate} write_flash -e 0x0 \"{indexPath}/build/Mixgo_ME_lib-v1.23.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
},
"micropython:esp32c3:mixgocar_c3": {
"command": "\"{esptool}\" --chip esp32c3 --port {com} --baud 460800 erase_flash && \"{esptool}\" --chip esp32c3 --port {com} --baud 460800 write_flash 0x0 \"{indexPath}/build/Mixgo_Car_lib-v1.23.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
"command": "\"{esptool}\" --chip esp32c3 --port {com} --baud {baudrate} write_flash -e 0x0 \"{indexPath}/build/Mixgo_Car_lib-v1.23.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
},
"micropython:esp32c3:generic": {
"command": "\"{esptool}\" --chip esp32c3 --port {com} --baud 460800 erase_flash && \"{esptool}\" --chip esp32c3 --port {com} --baud 460800 write_flash 0x0 \"{indexPath}/build/Generic_C3_UART_lib-v1.23.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
"command": "\"{esptool}\" --chip esp32c3 --port {com} --baud {baudrate} write_flash -e 0x0 \"{indexPath}/build/Generic_C3_UART_lib-v1.23.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
}
},
"upload": {

View File

@@ -73,7 +73,10 @@ import {
MicroPythonSensorOnBoardGenerators,
MicroPythonSerialGenerators,
MicroPythonSystemGenerators,
MicroPythonWeatherGenerators
MicroPythonWeatherGenerators,
MicroPythonZhHans,
MicroPythonZhHant,
MicroPythonEn
} from '@mixly/micropython';
import {
@@ -88,6 +91,11 @@ import './css/color_esp32s2_mixgoce.css';
Object.assign(Blockly.Variables, Variables);
Object.assign(Blockly.Procedures, Procedures);
Object.assign(Blockly.Lang.ZhHans, MicroPythonZhHans);
Object.assign(Blockly.Lang.ZhHant, MicroPythonZhHant);
Object.assign(Blockly.Lang.En, MicroPythonEn);
Blockly.Python = Python;
Blockly.generator = Python;

View File

@@ -1,35 +1,89 @@
{
"board": {
"MixGo CE": "micropython:esp32s2:mixgo_ce",
"ESP32S2 Generic": "micropython:esp32s2:generic"
"MixGo CE": {
"key": "micropython:esp32s2:mixgo_ce",
"config": [
{
"key": "BurnSpeed",
"label": "Burn Speed",
"messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
"options": [
{
"key": "460800",
"label": "460800"
},
{
"key": "115200",
"label": "115200"
},
{
"key": "230400",
"label": "230400"
},
{
"key": "921600",
"label": "921600"
}
]
}
]
},
"ESP32S2 Generic": {
"key": "micropython:esp32s2:generic",
"config": [
{
"key": "BurnSpeed",
"label": "Burn Speed",
"messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
"options": [
{
"key": "460800",
"label": "460800"
},
{
"key": "115200",
"label": "115200"
},
{
"key": "230400",
"label": "230400"
},
{
"key": "921600",
"label": "921600"
}
]
}
]
}
},
"language": "MicroPython",
"burn": {
"type": "command",
"portSelect": "all",
"micropython:esp32s2:mixgo_ce": {
"command": "\"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset write_flash 0x1000 \"{indexPath}/build/Mixgo_CE_lib-v1.25.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\"",
"command": "\"{esptool}\" --chip esp32s2 --port {com} --baud {baudrate} --after=no_reset write_flash -e 0x1000 \"{indexPath}/build/Mixgo_CE_lib-v1.25.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\"",
"special": [
{
"name": "Default",
"command": "\"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset write_flash 0x1000 \"{indexPath}/build/Mixgo_CE_lib-v1.25.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
"command": "\"{esptool}\" --chip esp32s2 --port {com} --baud {baudrate} --after=no_reset write_flash -e 0x1000 \"{indexPath}/build/Mixgo_CE_lib-v1.25.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
},
{
"name": "ESP-AT-mode",
"command": "\"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset write_flash 0x0000 \"{indexPath}/build/MixGo-CE_AT-T17_R18.bin\""
"command": "\"{esptool}\" --chip esp32s2 --port {com} --baud {baudrate} --after=no_reset write_flash -e 0x0000 \"{indexPath}/build/MixGo-CE_AT-T17_R18.bin\""
}
]
},
"micropython:esp32s2:generic": {
"command": "\"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset write_flash 0x1000 \"{indexPath}/build/Generic_S2_lib-v1.25.0.bin\"",
"command": "\"{esptool}\" --chip esp32s2 --port {com} --baud {baudrate} --after=no_reset write_flash -e 0x1000 \"{indexPath}/build/Generic_S2_lib-v1.25.0.bin\"",
"special": [
{
"name": "Default",
"command": "\"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset write_flash 0x1000 \"{indexPath}/build/Generic_S2_lib-v1.25.0.bin\""
"command": "\"{esptool}\" --chip esp32s2 --port {com} --baud {baudrate} --after=no_reset write_flash -e 0x1000 \"{indexPath}/build/Generic_S2_lib-v1.25.0.bin\""
},
{
"name": "ESP-AT-mode",
"command": "\"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset write_flash 0x0000 \"{indexPath}/build/MixGo-CE_AT-T17_R18.bin\""
"command": "\"{esptool}\" --chip esp32s2 --port {com} --baud {baudrate} --after=no_reset write_flash -e 0x0000 \"{indexPath}/build/MixGo-CE_AT-T17_R18.bin\""
}
]
}

View File

@@ -73,7 +73,10 @@ import {
MicroPythonSensorOnBoardGenerators,
MicroPythonSerialGenerators,
MicroPythonSystemGenerators,
MicroPythonWeatherGenerators
MicroPythonWeatherGenerators,
MicroPythonZhHans,
MicroPythonZhHant,
MicroPythonEn
} from '@mixly/micropython';
import {
@@ -90,6 +93,11 @@ import './css/color_esp32s2_mixgoce.css';
Object.assign(Blockly.Variables, Variables);
Object.assign(Blockly.Procedures, Procedures);
Object.assign(Blockly.Lang.ZhHans, MicroPythonZhHans);
Object.assign(Blockly.Lang.ZhHant, MicroPythonZhHant);
Object.assign(Blockly.Lang.En, MicroPythonEn);
Blockly.Python = Python;
Blockly.generator = Python;

View File

@@ -1,21 +1,102 @@
{
"board": {
"元控青春": "micropython:esp32s3:mixgo_nova",
"元控自强": "micropython:esp32s3:mixgo_sant",
"S3_generic":"micropython:esp32s3:generic"
"元控青春": {
"key": "micropython:esp32s3:mixgo_nova",
"config": [
{
"key": "BurnSpeed",
"label": "Burn Speed",
"messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
"options": [
{
"key": "460800",
"label": "460800"
},
{
"key": "115200",
"label": "115200"
},
{
"key": "230400",
"label": "230400"
},
{
"key": "921600",
"label": "921600"
}
]
}
]
},
"元控自强": {
"key": "micropython:esp32s3:mixgo_sant",
"config": [
{
"key": "BurnSpeed",
"label": "Burn Speed",
"messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
"options": [
{
"key": "460800",
"label": "460800"
},
{
"key": "115200",
"label": "115200"
},
{
"key": "230400",
"label": "230400"
},
{
"key": "921600",
"label": "921600"
}
]
}
]
},
"S3_generic": {
"key": "micropython:esp32s3:generic",
"config": [
{
"key": "BurnSpeed",
"label": "Burn Speed",
"messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
"options": [
{
"key": "460800",
"label": "460800"
},
{
"key": "115200",
"label": "115200"
},
{
"key": "230400",
"label": "230400"
},
{
"key": "921600",
"label": "921600"
}
]
}
]
}
},
"language": "MicroPython",
"burn": {
"type": "command",
"portSelect": "all",
"micropython:esp32s3:mixgo_sant": {
"command": "\"{esptool}\" --chip esp32s3 --port {com} --baud 460800 --before default_reset --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32s3 --port {com} --baud 460800 --after hard_reset write_flash 0x0 \"{indexPath}/build/Mixgo_Sant_lib-v1.13.0.bin\" 0xE00000 \"{indexPath}/../micropython/build/HZK16_GBK.bin\""
"command": "\"{esptool}\" --chip esp32s3 --port {com} --baud {baudrate} --after hard_reset write_flash -e 0x0 \"{indexPath}/build/Mixgo_Sant_lib-v1.13.0.bin\" 0xE00000 \"{indexPath}/../micropython/build/HZK16_GBK.bin\""
},
"micropython:esp32s3:mixgo_nova": {
"command": "\"{esptool}\" --chip esp32s3 --port {com} --baud 460800 --before default_reset --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32s3 --port {com} --baud 460800 --after hard_reset write_flash 0x0 \"{indexPath}/build/Mixgo_Nova_lib-v1.21.0.bin\" 0x700000 \"{indexPath}/../micropython/build/HZK12.bin\""
"command": "\"{esptool}\" --chip esp32s3 --port {com} --baud {baudrate} --after hard_reset write_flash -e 0x0 \"{indexPath}/build/Mixgo_Nova_lib-v1.21.0.bin\" 0x700000 \"{indexPath}/../micropython/build/HZK12.bin\""
},
"micropython:esp32s3:generic": {
"command": "\"{esptool}\" --chip esp32s3 --port {com} --baud 460800 --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32s3 --port {com} --baud 460800 --after=no_reset write_flash 0x0 \"{indexPath}/build/Generic_S3_lib-v1.25.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
"command": "\"{esptool}\" --chip esp32s3 --port {com} --baud {baudrate} --after=no_reset write_flash -e 0x0 \"{indexPath}/build/Generic_S3_lib-v1.25.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
}
},
"upload": {

View File

@@ -67,7 +67,10 @@ import {
MicroPythonSensorOnBoardGenerators,
MicroPythonSerialGenerators,
MicroPythonSystemGenerators,
MicroPythonWeatherGenerators
MicroPythonWeatherGenerators,
MicroPythonZhHans,
MicroPythonZhHant,
MicroPythonEn
} from '@mixly/micropython';
import {
@@ -80,6 +83,11 @@ import './css/color_esp32_mixgo.css';
Object.assign(Blockly.Variables, Variables);
Object.assign(Blockly.Procedures, Procedures);
Object.assign(Blockly.Lang.ZhHans, MicroPythonZhHans);
Object.assign(Blockly.Lang.ZhHant, MicroPythonZhHant);
Object.assign(Blockly.Lang.En, MicroPythonEn);
Blockly.Python = Python;
Blockly.generator = Python;

View File

@@ -1,21 +1,102 @@
{
"board": {
"飞乙": "micropython:esp32c3:feiyi",
"超霸大师": "micropython:esp32:mixbot",
"机器人大师": "micropython:esp32:rm_e1"
"飞乙": {
"key": "micropython:esp32c3:feiyi",
"config": [
{
"key": "BurnSpeed",
"label": "Burn Speed",
"messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
"options": [
{
"key": "460800",
"label": "460800"
},
{
"key": "115200",
"label": "115200"
},
{
"key": "230400",
"label": "230400"
},
{
"key": "921600",
"label": "921600"
}
]
}
]
},
"超霸大师": {
"key": "micropython:esp32:mixbot",
"config": [
{
"key": "BurnSpeed",
"label": "Burn Speed",
"messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
"options": [
{
"key": "460800",
"label": "460800"
},
{
"key": "115200",
"label": "115200"
},
{
"key": "230400",
"label": "230400"
},
{
"key": "921600",
"label": "921600"
}
]
}
]
},
"机器人大师": {
"key": "micropython:esp32:rm_e1",
"config": [
{
"key": "BurnSpeed",
"label": "Burn Speed",
"messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
"options": [
{
"key": "460800",
"label": "460800"
},
{
"key": "115200",
"label": "115200"
},
{
"key": "230400",
"label": "230400"
},
{
"key": "921600",
"label": "921600"
}
]
}
]
}
},
"language": "MicroPython",
"burn": {
"type": "command",
"portSelect": "all",
"micropython:esp32c3:feiyi": {
"command": "\"{esptool}\" --chip esp32c3 --port {com} --baud 460800 erase_flash && \"{esptool}\" --chip esp32c3 --port {com} --baud 460800 write_flash 0x0 \"{indexPath}/build/Mixgo_FeiYi_lib-v1.25.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
"command": "\"{esptool}\" --chip esp32c3 --port {com} --baud {baudrate} write_flash -e 0x0 \"{indexPath}/build/Mixgo_FeiYi_lib-v1.25.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
},
"micropython:esp32:rm_e1": {
"command": "\"{esptool}\" --chip esp32 --port {com} --baud 460800 erase_flash && \"{esptool}\" --port {com} --baud 460800 write_flash 0x1000 \"{indexPath}/build/RM_E1_lib-v1.25.0.bin\""
"command": "\"{esptool}\" --port {com} --baud {baudrate} write_flash -e 0x1000 \"{indexPath}/build/RM_E1_lib-v1.25.0.bin\""
},
"micropython:esp32:mixbot": {
"command": "\"{esptool}\" --chip esp32 --port {com} --baud 460800 erase_flash && \"{esptool}\" --port {com} --baud 460800 write_flash 0x1000 \"{indexPath}/build/MixBot_lib-v1.25.0.bin\""
"command": "\"{esptool}\" --port {com} --baud {baudrate} write_flash -e 0x1000 \"{indexPath}/build/MixBot_lib-v1.25.0.bin\""
}
},
"upload": {

View File

@@ -518,6 +518,9 @@ BU.burnByCmd = function (port, command) {
const { mainStatusBarTabs } = Mixly;
const statusBarTerminal = mainStatusBarTabs.getStatusBarById('output');
statusBarTerminal.setValue(Msg.Lang['shell.burning'] + '...\n');
command = MString.tpl(command, {
baudrate: Boards.getSelectedBoardConfigParam('BurnSpeed') ?? '460800'
});
BU.runCmd('burn', port, command);
}

View File

@@ -75,8 +75,6 @@ BU.progressLayer = new LayerProgress({
cancelDisplay: false
});
const BAUD = goog.platform() === 'darwin' ? 460800 : 921600;
if (['BBC micro:bit', 'Mithon CC'].includes(BOARD.boardType)) {
FSWrapper.setupFilesystem(path.join(Env.boardDirPath, 'build'));
}
@@ -265,10 +263,11 @@ BU.burnWithEsptool = async (binFile, erase) => {
let esploader = null;
let transport = null;
try {
const baudrate = Boards.getSelectedBoardConfigParam('BurnSpeed') ?? '460800';
transport = new Transport(port, false);
esploader = new ESPLoader({
transport,
baudrate: BAUD,
baudrate,
terminal: {
clean() {
statusBarTerminal.setValue('');
@@ -281,7 +280,7 @@ BU.burnWithEsptool = async (binFile, erase) => {
}
}
});
let chip = await esploader.main();
await esploader.main();
} catch (error) {
Debug.error(error);
statusBarTerminal.addValue(`\n${error.toString()}\n`);