From 4ed9dbd4354fde1ea9036d9b8402d4c086fffc41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=B0=B8=E7=A6=8F?= Date: Tue, 11 Mar 2025 16:31:55 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=9B=B4=E6=94=B9README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .cproject | 125 ++++++++++++++++++++++++++++++++++ .project | 27 ++++++++ .vscode/c_cpp_properties.json | 18 +++++ .vscode/launch.json | 24 +++++++ .vscode/settings.json | 59 ++++++++++++++++ README.md | 6 +- 6 files changed, 257 insertions(+), 2 deletions(-) create mode 100644 .cproject create mode 100644 .project create mode 100644 .vscode/c_cpp_properties.json create mode 100644 .vscode/launch.json create mode 100644 .vscode/settings.json diff --git a/.cproject b/.cproject new file mode 100644 index 0000000..1a7c51d --- /dev/null +++ b/.cproject @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + make + clean + true + true + true + + + ${ProjDirPath}/make.exe + + helloworld@MK3165 total download + true + true + true + + + ${ProjDirPath}/make + + helloworld@MK3165 + true + true + true + + + ${ProjDirPath}/make.exe + standard release + true + true + true + + + ${ProjDirPath}/make.exe + + helloworld@MK3165 total + true + true + true + + + ${ProjDirPath}/make.exe + + bluetooth.ble_hello_sensor@MK3238 + true + true + true + + + ${ProjDirPath}/make.exe + + bluetooth.ble_hello_sensor@MK3238 total + true + true + true + + + ${ProjDirPath}/make.exe + + bluetooth.ble_hello_sensor@MK3238 total download + true + true + true + + + + diff --git a/.project b/.project new file mode 100644 index 0000000..1e5d9ba --- /dev/null +++ b/.project @@ -0,0 +1,27 @@ + + + zTC1 + + + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + cleanfullincremental + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + fullincremental + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.core.ccnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + + diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..cea4d3f --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,18 @@ +{ + "configurations": [ + { + "name": "windows-gcc-x64", + "includePath": [ + "${workspaceFolder}/**" + ], + "compilerPath": "gcc", + "cStandard": "${default}", + "cppStandard": "${default}", + "intelliSenseMode": "windows-gcc-x64", + "compilerArgs": [ + "" + ] + } + ], + "version": 4 +} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..13caa33 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,24 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "C/C++ Runner: Debug Session", + "type": "cppdbg", + "request": "launch", + "args": [], + "stopAtEntry": false, + "externalConsole": true, + "cwd": "e:/15_GitHub/TC1/zTC1/TC1", + "program": "e:/15_GitHub/TC1/zTC1/TC1/build/Debug/outDebug", + "MIMode": "gdb", + "miDebuggerPath": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ] + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..bb879da --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,59 @@ +{ + "C_Cpp_Runner.cCompilerPath": "gcc", + "C_Cpp_Runner.cppCompilerPath": "g++", + "C_Cpp_Runner.debuggerPath": "gdb", + "C_Cpp_Runner.cStandard": "", + "C_Cpp_Runner.cppStandard": "", + "C_Cpp_Runner.msvcBatchPath": "C:/Program Files/Microsoft Visual Studio/VR_NR/Community/VC/Auxiliary/Build/vcvarsall.bat", + "C_Cpp_Runner.useMsvc": false, + "C_Cpp_Runner.warnings": [ + "-Wall", + "-Wextra", + "-Wpedantic", + "-Wshadow", + "-Wformat=2", + "-Wcast-align", + "-Wconversion", + "-Wsign-conversion", + "-Wnull-dereference" + ], + "C_Cpp_Runner.msvcWarnings": [ + "/W4", + "/permissive-", + "/w14242", + "/w14287", + "/w14296", + "/w14311", + "/w14826", + "/w44062", + "/w44242", + "/w14905", + "/w14906", + "/w14263", + "/w44265", + "/w14928" + ], + "C_Cpp_Runner.enableWarnings": true, + "C_Cpp_Runner.warningsAsError": false, + "C_Cpp_Runner.compilerArgs": [], + "C_Cpp_Runner.linkerArgs": [], + "C_Cpp_Runner.includePaths": [], + "C_Cpp_Runner.includeSearch": [ + "*", + "**/*" + ], + "C_Cpp_Runner.excludeSearch": [ + "**/build", + "**/build/**", + "**/.*", + "**/.*/**", + "**/.vscode", + "**/.vscode/**" + ], + "C_Cpp_Runner.useAddressSanitizer": false, + "C_Cpp_Runner.useUndefinedSanitizer": false, + "C_Cpp_Runner.useLeakSanitizer": false, + "C_Cpp_Runner.showCompilationTime": false, + "C_Cpp_Runner.useLinkTimeOptimization": false, + "C_Cpp_Runner.msvcSecureNoWarnings": false +} \ No newline at end of file diff --git a/README.md b/README.md index c43bb46..2de03d7 100644 --- a/README.md +++ b/README.md @@ -61,8 +61,10 @@ TC1 排插硬件分 A1 A2 两个版本, 本固件仅支持 **A1 版本**. A1 A2 - 安装完成后添加micoder路径 mico config --global MICODER (micoder所在路径)/MiCoder - 最后切换到此项目根目录执行build.sh即可编译固件 - - +# 注意事项 +- 使用pip安装mico-cube失败,请使用下列命令安装(执行命令时注意路径位置) + +- `python -m pip install mico-cube-1.0.0.tar.gz` From c94e8fcd12800b0e9508ea0be0766df9b5bd5706 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=B0=B8=E7=A6=8F?= Date: Tue, 11 Mar 2025 17:21:17 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dmico-os=20SDK=E5=BA=93?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gdbinit | 2 ++ .openocd_cfg | 3 +++ mico-os/.gitignore | 4 ++++ 3 files changed, 9 insertions(+) create mode 100644 .gdbinit create mode 100644 .openocd_cfg create mode 100644 mico-os/.gitignore diff --git a/.gdbinit b/.gdbinit new file mode 100644 index 0000000..ee572df --- /dev/null +++ b/.gdbinit @@ -0,0 +1,2 @@ +set remotetimeout 20 +shell start /B D:\ProgramData\MiCoder_v1.3_Win32-64/MiCoder/OpenOCD/Win32/openocd_mico.exe -s ./ -f ./mico-os/makefiles/OpenOCD/interface/jlink_swd.cfg -f ./mico-os/makefiles/OpenOCD/mw3xx/mw3xx.cfg -f ./mico-os/makefiles/OpenOCD/mw3xx/mw3xx_gdb_jtag.cfg -l ./build/openocd_log.txt diff --git a/.openocd_cfg b/.openocd_cfg new file mode 100644 index 0000000..0749f47 --- /dev/null +++ b/.openocd_cfg @@ -0,0 +1,3 @@ +source [find D:\ProgramData\MiCoder_v1.3_Win32-64/MiCoder/OpenOCD/jlink_swd.cfg] +source [find D:\ProgramData\MiCoder_v1.3_Win32-64/MiCoder/OpenOCD/mw3xx.cfg] +source [find D:\ProgramData\MiCoder_v1.3_Win32-64/MiCoder/OpenOCD/mw3xx_gdb_jtag.cfg] diff --git a/mico-os/.gitignore b/mico-os/.gitignore new file mode 100644 index 0000000..876d66d --- /dev/null +++ b/mico-os/.gitignore @@ -0,0 +1,4 @@ +MiCoder/compiler +Projects +MiCoder +tools_root From 56395f62bc3e53aac73b26f1e612e7bbe6f830c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=B0=B8=E7=A6=8F?= Date: Wed, 19 Mar 2025 17:20:45 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=9F=E6=88=90ota?= =?UTF-8?q?=E5=B9=B4=E6=9C=88=E6=97=A5=E6=97=B6=E5=88=86=E7=A7=92.bin?= =?UTF-8?q?=E5=92=8Call=E5=B9=B4=E6=9C=88=E6=97=A5=E6=97=B6=E5=88=86?= =?UTF-8?q?=E7=A7=92.bin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 25322cd..9f9bd60 100644 --- a/build.sh +++ b/build.sh @@ -8,4 +8,7 @@ mico make clean mico make TC1@MK3031@moc total -cp ./build/TC1\@MK3031\@moc/binary/TC1\@MK3031\@moc.ota.bin ./build/TC1\@MK3031\@moc/binary/ota.bin +cp ./build/TC1\@MK3031\@moc/binary/TC1\@MK3031\@moc.ota.bin ./build/TC1\@MK3031\@moc/binary/ota$(date +%Y%m%d%H%M%S).bin + +cp ./build/TC1\@MK3031\@moc/binary/TC1\@MK3031\@moc.all.bin ./build/TC1\@MK3031\@moc/binary/all$(date +%Y%m%d%H%M%S).bin + From 7ea87ae4c986afdf9c15c4f613d7199c8a9d30f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=B0=B8=E7=A6=8F?= Date: Thu, 20 Mar 2025 10:21:32 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E5=A2=9E=E5=8A=A0https=E5=85=B3=E9=94=AE?= =?UTF-8?q?=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TC1/http_server/app_httpd.c | 2 +- TC1/http_server/web/index.html | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/TC1/http_server/app_httpd.c b/TC1/http_server/app_httpd.c index 23ca149..8417d18 100644 --- a/TC1/http_server/app_httpd.c +++ b/TC1/http_server/app_httpd.c @@ -563,7 +563,7 @@ const struct httpd_wsgi_call g_app_handlers[] = { {"/mqtt/report/freq", HTTPD_HDR_DEFORT, 0, HttpGetMqttReportFreq, HttpSetMqttReportFreq, NULL, NULL}, {"/log", HTTPD_HDR_DEFORT, 0, HttpGetLog, NULL, NULL, NULL}, {"/task", HTTPD_HDR_DEFORT, APP_HTTP_FLAGS_NO_EXACT_MATCH, HttpGetTasks, HttpAddTask, NULL, HttpDelTask}, - {"/ota", HTTPD_HDR_DEFORT, 0, Otastatus, OtaStart, NULL, NULL}, + {"https://ota", HTTPD_HDR_DEFORT, 0, Otastatus, OtaStart, NULL, NULL}, {"/led", HTTPD_HDR_DEFORT, 0, LedStatus, LedSetEnabled, NULL, NULL}, {"/socketAll", HTTPD_HDR_DEFORT, 0, NULL, TotalSocketSetEnabled, NULL, NULL}, {"/socketNames", HTTPD_HDR_DEFORT, 0, NULL, HttpSetSocketName, NULL, NULL}, diff --git a/TC1/http_server/web/index.html b/TC1/http_server/web/index.html index 1565b9e..caa0042 100644 --- a/TC1/http_server/web/index.html +++ b/TC1/http_server/web/index.html @@ -1200,7 +1200,10 @@ //OTA-start function OtaStart() { var ota_url = document.getElementById("ota_url").value; - HttpPost("/ota", function (re) { + var protocol = window.location.protocol; + var baseUrl = protocol+"//"+window.location.host; + + HttpPost("https://ota", function (re) { OtaStatus(); }, ota_url); } @@ -1209,7 +1212,10 @@ this.MaterialProgress.setProgress(0); }); function OtaStatus() { - HttpGet("/ota", function (re) { + var protocol = window.location.protocol; + var baseUrl = protocol+"//"+window.location.host; + + HttpGet("https://ota", function (re) { var percent = parseInt(re); //console.log(re + " " + parseInt(re)); ota_status.MaterialProgress.setProgress(percent); From 13df06e546024744cfc6201a0f349a8982a360c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=B0=B8=E7=A6=8F?= Date: Thu, 20 Mar 2025 10:39:46 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E6=92=A4=E9=94=80https=E5=85=B3=E9=94=AE?= =?UTF-8?q?=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TC1/http_server/app_httpd.c | 2 +- TC1/http_server/web/index.html | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/TC1/http_server/app_httpd.c b/TC1/http_server/app_httpd.c index 3159daa..d6ffab7 100644 --- a/TC1/http_server/app_httpd.c +++ b/TC1/http_server/app_httpd.c @@ -583,7 +583,7 @@ const struct httpd_wsgi_call g_app_handlers[] = { {"/mqtt/report/freq", HTTPD_HDR_DEFORT, 0, HttpGetMqttReportFreq, HttpSetMqttReportFreq, NULL, NULL}, {"/log", HTTPD_HDR_DEFORT, 0, HttpGetLog, NULL, NULL, NULL}, {"/task", HTTPD_HDR_DEFORT, APP_HTTP_FLAGS_NO_EXACT_MATCH, HttpGetTasks, HttpAddTask, NULL, HttpDelTask}, - {"https://ota", HTTPD_HDR_DEFORT, 0, Otastatus, OtaStart, NULL, NULL}, + {"/ota", HTTPD_HDR_DEFORT, 0, Otastatus, OtaStart, NULL, NULL}, {"/led", HTTPD_HDR_DEFORT, 0, LedStatus, LedSetEnabled, NULL, NULL}, {"/socketAll", HTTPD_HDR_DEFORT, 0, NULL, TotalSocketSetEnabled, NULL, NULL}, {"/socketNames", HTTPD_HDR_DEFORT, 0, NULL, HttpSetSocketName, NULL, NULL}, diff --git a/TC1/http_server/web/index.html b/TC1/http_server/web/index.html index 53e9114..3dadb5a 100644 --- a/TC1/http_server/web/index.html +++ b/TC1/http_server/web/index.html @@ -1236,7 +1236,7 @@ var protocol = window.location.protocol; var baseUrl = protocol+"//"+window.location.host; - HttpPost("https://ota", function (re) { + HttpPost("/ota", function (re) { OtaStatus(); }, ota_url); } @@ -1248,7 +1248,7 @@ var protocol = window.location.protocol; var baseUrl = protocol+"//"+window.location.host; - HttpGet("https://ota", function (re) { + HttpGet("/ota", function (re) { var percent = parseInt(re); //console.log(re + " " + parseInt(re)); ota_status.MaterialProgress.setProgress(percent);