├── .gitignore ├── .gitmodules ├── COPYING ├── LICENSE ├── README.md ├── README_EN.md ├── build ├── probe-rs-gui-alone.spec ├── probe-rs-gui.spec ├── readme.md └── requirements.txt ├── example ├── HC32F4A0-Series.yaml ├── HDSC.HC32F4A0.1.0.7.pack ├── config.yaml ├── readme.md └── target-gen.exe └── src ├── probe-rs-gui.py └── probe-rs.exe /.gitignore: -------------------------------------------------------------------------------- 1 | build/venv/* 2 | build/build/* 3 | build/dist/* 4 | 5 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "probe-rs"] 2 | path = probe-rs 3 | url = https://github.com/probe-rs/probe-rs.git 4 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) [2020] [Alejandro Autalán] 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | MIT License 24 | 25 | Copyright (c) 2019 probe-rs 26 | 27 | Permission is hereby granted, free of charge, to any person obtaining a copy 28 | of this software and associated documentation files (the "Software"), to deal 29 | in the Software without restriction, including without limitation the rights 30 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 31 | copies of the Software, and to permit persons to whom the Software is 32 | furnished to do so, subject to the following conditions: 33 | 34 | The above copyright notice and this permission notice shall be included in all 35 | copies or substantial portions of the Software. 36 | 37 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 38 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 39 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 40 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 41 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 42 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 43 | SOFTWARE. 44 | 45 | 46 | Apache License 47 | Version 2.0, January 2004 48 | http://www.apache.org/licenses/ 49 | 50 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 51 | 52 | 1. Definitions. 53 | 54 | "License" shall mean the terms and conditions for use, reproduction, 55 | and distribution as defined by Sections 1 through 9 of this document. 56 | 57 | "Licensor" shall mean the copyright owner or entity authorized by 58 | the copyright owner that is granting the License. 59 | 60 | "Legal Entity" shall mean the union of the acting entity and all 61 | other entities that control, are controlled by, or are under common 62 | control with that entity. For the purposes of this definition, 63 | "control" means (i) the power, direct or indirect, to cause the 64 | direction or management of such entity, whether by contract or 65 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 66 | outstanding shares, or (iii) beneficial ownership of such entity. 67 | 68 | "You" (or "Your") shall mean an individual or Legal Entity 69 | exercising permissions granted by this License. 70 | 71 | "Source" form shall mean the preferred form for making modifications, 72 | including but not limited to software source code, documentation 73 | source, and configuration files. 74 | 75 | "Object" form shall mean any form resulting from mechanical 76 | transformation or translation of a Source form, including but 77 | not limited to compiled object code, generated documentation, 78 | and conversions to other media types. 79 | 80 | "Work" shall mean the work of authorship, whether in Source or 81 | Object form, made available under the License, as indicated by a 82 | copyright notice that is included in or attached to the work 83 | (an example is provided in the Appendix below). 84 | 85 | "Derivative Works" shall mean any work, whether in Source or Object 86 | form, that is based on (or derived from) the Work and for which the 87 | editorial revisions, annotations, elaborations, or other modifications 88 | represent, as a whole, an original work of authorship. For the purposes 89 | of this License, Derivative Works shall not include works that remain 90 | separable from, or merely link (or bind by name) to the interfaces of, 91 | the Work and Derivative Works thereof. 92 | 93 | "Contribution" shall mean any work of authorship, including 94 | the original version of the Work and any modifications or additions 95 | to that Work or Derivative Works thereof, that is intentionally 96 | submitted to Licensor for inclusion in the Work by the copyright owner 97 | or by an individual or Legal Entity authorized to submit on behalf of 98 | the copyright owner. For the purposes of this definition, "submitted" 99 | means any form of electronic, verbal, or written communication sent 100 | to the Licensor or its representatives, including but not limited to 101 | communication on electronic mailing lists, source code control systems, 102 | and issue tracking systems that are managed by, or on behalf of, the 103 | Licensor for the purpose of discussing and improving the Work, but 104 | excluding communication that is conspicuously marked or otherwise 105 | designated in writing by the copyright owner as "Not a Contribution." 106 | 107 | "Contributor" shall mean Licensor and any individual or Legal Entity 108 | on behalf of whom a Contribution has been received by Licensor and 109 | subsequently incorporated within the Work. 110 | 111 | 2. Grant of Copyright License. Subject to the terms and conditions of 112 | this License, each Contributor hereby grants to You a perpetual, 113 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 114 | copyright license to reproduce, prepare Derivative Works of, 115 | publicly display, publicly perform, sublicense, and distribute the 116 | Work and such Derivative Works in Source or Object form. 117 | 118 | 3. Grant of Patent License. Subject to the terms and conditions of 119 | this License, each Contributor hereby grants to You a perpetual, 120 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 121 | (except as stated in this section) patent license to make, have made, 122 | use, offer to sell, sell, import, and otherwise transfer the Work, 123 | where such license applies only to those patent claims licensable 124 | by such Contributor that are necessarily infringed by their 125 | Contribution(s) alone or by combination of their Contribution(s) 126 | with the Work to which such Contribution(s) was submitted. If You 127 | institute patent litigation against any entity (including a 128 | cross-claim or counterclaim in a lawsuit) alleging that the Work 129 | or a Contribution incorporated within the Work constitutes direct 130 | or contributory patent infringement, then any patent licenses 131 | granted to You under this License for that Work shall terminate 132 | as of the date such litigation is filed. 133 | 134 | 4. Redistribution. You may reproduce and distribute copies of the 135 | Work or Derivative Works thereof in any medium, with or without 136 | modifications, and in Source or Object form, provided that You 137 | meet the following conditions: 138 | 139 | (a) You must give any other recipients of the Work or 140 | Derivative Works a copy of this License; and 141 | 142 | (b) You must cause any modified files to carry prominent notices 143 | stating that You changed the files; and 144 | 145 | (c) You must retain, in the Source form of any Derivative Works 146 | that You distribute, all copyright, patent, trademark, and 147 | attribution notices from the Source form of the Work, 148 | excluding those notices that do not pertain to any part of 149 | the Derivative Works; and 150 | 151 | (d) If the Work includes a "NOTICE" text file as part of its 152 | distribution, then any Derivative Works that You distribute must 153 | include a readable copy of the attribution notices contained 154 | within such NOTICE file, excluding those notices that do not 155 | pertain to any part of the Derivative Works, in at least one 156 | of the following places: within a NOTICE text file distributed 157 | as part of the Derivative Works; within the Source form or 158 | documentation, if provided along with the Derivative Works; or, 159 | within a display generated by the Derivative Works, if and 160 | wherever such third-party notices normally appear. The contents 161 | of the NOTICE file are for informational purposes only and 162 | do not modify the License. You may add Your own attribution 163 | notices within Derivative Works that You distribute, alongside 164 | or as an addendum to the NOTICE text from the Work, provided 165 | that such additional attribution notices cannot be construed 166 | as modifying the License. 167 | 168 | You may add Your own copyright statement to Your modifications and 169 | may provide additional or different license terms and conditions 170 | for use, reproduction, or distribution of Your modifications, or 171 | for any such Derivative Works as a whole, provided Your use, 172 | reproduction, and distribution of the Work otherwise complies with 173 | the conditions stated in this License. 174 | 175 | 5. Submission of Contributions. Unless You explicitly state otherwise, 176 | any Contribution intentionally submitted for inclusion in the Work 177 | by You to the Licensor shall be under the terms and conditions of 178 | this License, without any additional terms or conditions. 179 | Notwithstanding the above, nothing herein shall supersede or modify 180 | the terms of any separate license agreement you may have executed 181 | with Licensor regarding such Contributions. 182 | 183 | 6. Trademarks. This License does not grant permission to use the trade 184 | names, trademarks, service marks, or product names of the Licensor, 185 | except as required for reasonable and customary use in describing the 186 | origin of the Work and reproducing the content of the NOTICE file. 187 | 188 | 7. Disclaimer of Warranty. Unless required by applicable law or 189 | agreed to in writing, Licensor provides the Work (and each 190 | Contributor provides its Contributions) on an "AS IS" BASIS, 191 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 192 | implied, including, without limitation, any warranties or conditions 193 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 194 | PARTICULAR PURPOSE. You are solely responsible for determining the 195 | appropriateness of using or redistributing the Work and assume any 196 | risks associated with Your exercise of permissions under this License. 197 | 198 | 8. Limitation of Liability. In no event and under no legal theory, 199 | whether in tort (including negligence), contract, or otherwise, 200 | unless required by applicable law (such as deliberate and grossly 201 | negligent acts) or agreed to in writing, shall any Contributor be 202 | liable to You for damages, including any direct, indirect, special, 203 | incidental, or consequential damages of any character arising as a 204 | result of this License or out of the use or inability to use the 205 | Work (including but not limited to damages for loss of goodwill, 206 | work stoppage, computer failure or malfunction, or any and all 207 | other commercial damages or losses), even if such Contributor 208 | has been advised of the possibility of such damages. 209 | 210 | 9. Accepting Warranty or Additional Liability. While redistributing 211 | the Work or Derivative Works thereof, You may choose to offer, 212 | and charge a fee for, acceptance of support, warranty, indemnity, 213 | or other liability obligations and/or rights consistent with this 214 | License. However, in accepting such obligations, You may act only 215 | on Your own behalf and on Your sole responsibility, not on behalf 216 | of any other Contributor, and only if You agree to indemnify, 217 | defend, and hold each Contributor harmless for any liability 218 | incurred by, or claims asserted against, such Contributor by reason 219 | of your accepting any such warranty or additional liability. 220 | 221 | END OF TERMS AND CONDITIONS 222 | 223 | APPENDIX: How to apply the Apache License to your work. 224 | 225 | To apply the Apache License to your work, attach the following 226 | boilerplate notice, with the fields enclosed by brackets "[]" 227 | replaced with your own identifying information. (Don't include 228 | the brackets!) The text should be enclosed in the appropriate 229 | comment syntax for the file format. We also recommend that a 230 | file or class name and description of purpose be included on the 231 | same "printed page" as the copyright notice for easier 232 | identification within third-party archives. 233 | 234 | Copyright [yyyy] [name of copyright owner] 235 | 236 | Licensed under the Apache License, Version 2.0 (the "License"); 237 | you may not use this file except in compliance with the License. 238 | You may obtain a copy of the License at 239 | 240 | http://www.apache.org/licenses/LICENSE-2.0 241 | 242 | Unless required by applicable law or agreed to in writing, software 243 | distributed under the License is distributed on an "AS IS" BASIS, 244 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 245 | See the License for the specific language governing permissions and 246 | limitations under the License. 247 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [2023] [USTHzhanglu] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # probe-rs-GUI 2 | 3 | ## 首先感谢以下项目 4 | 5 | [中文] [[English](./README_EN.md)] 6 | 7 | [probe-rs](https://github.com/probe-rs/probe-rs):一个开源的mcu调试以及下载项目,基本支持所有芯片 8 | 9 | [pygubu](https://github.com/alejandroautalan/pygubu):一个开源宜用的GUI draw项目,支持实时浏览界面 10 | 11 | ## 项目介绍 12 | 13 | 本项目是基于tkinter,pygubu和probe-rs设计的一个GUI,可以通过DAP-LINK,stlink以及jlink直接下载固件。使用者只需要提供芯片的pack包,即可下载hex,elf以及bin文件。 14 | 15 | ## 使用说明 16 | 17 | ### 烧录 18 | 19 | 1. 选择下载文件 20 | 2. 选择芯片配置文件所在文件夹 21 | 3. 开始下载 22 | 23 | ### 擦除 24 | 25 | 1. 选择芯片配置文件所在文件夹 26 | 2. 擦除程序 27 | 注:目前只支持全盘擦除 28 | -------------------------------------------------------------------------------- /README_EN.md: -------------------------------------------------------------------------------- 1 | # probe-rs-GUI 2 | 3 | [[中文](./README.md)] [English] 4 | 5 | ## First of all, thanks for the following project 6 | 7 | [probe-rs](https://github.com/probe-rs/probe-rs):An open-source MCU debugging and download project that basically supports all chips 8 | 9 | [pygubu](https://github.com/alejandroautalan/pygubu):An open-source and user-friendly GUI draw project that supports real-time browsing interface 10 | 11 | ## Introduction 12 | 13 | This project is a GUI designed based on tkinter, pygubu, and probe-rs, which can directly download firmware through DAP-LINK, stlink, and jlink. Users only need to provide the package of the chip to download hex, elf, and bin files. 14 | 15 | ## Instructions for use 16 | 17 | ### Download 18 | 19 | 1. Select Download File 20 | 2. Select chip configuration file 21 | 3. Download 22 | 23 | ### Erase 24 | 25 | 1. Select chip configuration file 26 | 2. Erase chip 27 | 28 | PS: Currently, only full chip erase is supported 29 | -------------------------------------------------------------------------------- /build/probe-rs-gui-alone.spec: -------------------------------------------------------------------------------- 1 | # -*- mode: python ; coding: utf-8 -*- 2 | 3 | 4 | a = Analysis( 5 | ['..\\src\\probe-rs-gui.py'], 6 | pathex=[], 7 | binaries=[], 8 | datas=[('../src/probe-rs.exe','.')], 9 | 10 | hiddenimports=[], 11 | hookspath=[], 12 | hooksconfig={}, 13 | runtime_hooks=[], 14 | excludes=[], 15 | noarchive=False, 16 | ) 17 | pyz = PYZ(a.pure) 18 | 19 | exe = EXE( 20 | pyz, 21 | a.scripts, 22 | a.binaries, 23 | a.datas, 24 | [], 25 | name='probe-rs-gui', 26 | debug=False, 27 | bootloader_ignore_signals=False, 28 | strip=False, 29 | upx=True, 30 | upx_exclude=[], 31 | runtime_tmpdir=None, 32 | console=True, 33 | disable_windowed_traceback=False, 34 | argv_emulation=False, 35 | target_arch=None, 36 | codesign_identity=None, 37 | entitlements_file=None, 38 | ) 39 | -------------------------------------------------------------------------------- /build/probe-rs-gui.spec: -------------------------------------------------------------------------------- 1 | # -*- mode: python ; coding: utf-8 -*- 2 | 3 | 4 | a = Analysis( 5 | ['..\\src\\probe-rs-gui.py'], 6 | pathex=[], 7 | binaries=[], 8 | datas=[('../src/probe-rs.exe','.')], 9 | hiddenimports=[], 10 | hookspath=[], 11 | hooksconfig={}, 12 | runtime_hooks=[], 13 | excludes=[], 14 | noarchive=False, 15 | ) 16 | pyz = PYZ(a.pure) 17 | 18 | exe = EXE( 19 | pyz, 20 | a.scripts, 21 | [], 22 | exclude_binaries=True, 23 | name='probe-rs-gui', 24 | debug=False, 25 | bootloader_ignore_signals=False, 26 | strip=False, 27 | upx=True, 28 | console=True, 29 | disable_windowed_traceback=False, 30 | argv_emulation=False, 31 | target_arch=None, 32 | codesign_identity=None, 33 | entitlements_file=None, 34 | ) 35 | coll = COLLECT( 36 | exe, 37 | a.binaries, 38 | a.datas, 39 | strip=False, 40 | upx=True, 41 | upx_exclude=[], 42 | name='probe-rs-gui', 43 | ) 44 | -------------------------------------------------------------------------------- /build/readme.md: -------------------------------------------------------------------------------- 1 | ## 环境准备 2 | 3 | pyOCD需要Python3.6版本及以上,这意味着本项目也至少需要Python3.6 4 | 5 | 6 | ## Instructions 7 | 8 | These instructions assume that you already have Python installed: 9 | 10 | The following script shows the basic steps that one must follow: 11 | 12 | ```cmd 13 | cd build 14 | # Setup a virtualenv and install dependencies 15 | python -m venv venv 16 | venv\Scripts\activate 17 | pip installer -r requirements.txt 18 | 19 | # Create single-file executables 20 | pyinstaller probe-rs-gui.spec 21 | ``` 22 | 23 | In ./dist folder, there will be a single executable file per tool which is ready to use or distribute it to other library. -------------------------------------------------------------------------------- /build/requirements.txt: -------------------------------------------------------------------------------- 1 | altgraph==0.17.4 2 | packaging==23.2 3 | pefile==2023.2.7 4 | pygubu==0.31 5 | pyinstaller==6.1.0 6 | pyinstaller-hooks-contrib==2023.10 7 | pywin32-ctypes==0.2.2 8 | pyyaml== 6.0.1 9 | -------------------------------------------------------------------------------- /example/HC32F4A0-Series.yaml: -------------------------------------------------------------------------------- 1 | name: HC32F4A0-Series 2 | generated_from_pack: true 3 | pack_file_release: 1.0.7 4 | variants: 5 | - name: HC32F4A0PGHB 6 | cores: 7 | - name: main 8 | type: armv7em 9 | core_access_options: !Arm 10 | ap: 0 11 | psel: 0 12 | memory_map: 13 | - !Ram 14 | name: IRAM1 15 | range: 16 | start: 0x1ffe0000 17 | end: 0x20060000 18 | cores: 19 | - main 20 | - !Nvm 21 | name: IROM1 22 | range: 23 | start: 0x0 24 | end: 0x100000 25 | is_boot_memory: true 26 | cores: 27 | - main 28 | - !Generic 29 | name: IROM2 30 | range: 31 | start: 0x3000000 32 | end: 0x3001800 33 | cores: 34 | - main 35 | flash_algorithms: 36 | - hc32f4a0_1m 37 | - hc32f4a0_otp 38 | - name: HC32F4A0PGTB 39 | cores: 40 | - name: main 41 | type: armv7em 42 | core_access_options: !Arm 43 | ap: 0 44 | psel: 0 45 | memory_map: 46 | - !Ram 47 | name: IRAM1 48 | range: 49 | start: 0x1ffe0000 50 | end: 0x20060000 51 | cores: 52 | - main 53 | - !Nvm 54 | name: IROM1 55 | range: 56 | start: 0x0 57 | end: 0x100000 58 | is_boot_memory: true 59 | cores: 60 | - main 61 | - !Generic 62 | name: IROM2 63 | range: 64 | start: 0x3000000 65 | end: 0x3001800 66 | cores: 67 | - main 68 | flash_algorithms: 69 | - hc32f4a0_1m 70 | - hc32f4a0_otp 71 | - name: HC32F4A0PIHB 72 | cores: 73 | - name: main 74 | type: armv7em 75 | core_access_options: !Arm 76 | ap: 0 77 | psel: 0 78 | memory_map: 79 | - !Ram 80 | name: IRAM1 81 | range: 82 | start: 0x1ffe0000 83 | end: 0x20060000 84 | cores: 85 | - main 86 | - !Nvm 87 | name: IROM1 88 | range: 89 | start: 0x0 90 | end: 0x200000 91 | is_boot_memory: true 92 | cores: 93 | - main 94 | - !Generic 95 | name: IROM2 96 | range: 97 | start: 0x3000000 98 | end: 0x3001800 99 | cores: 100 | - main 101 | flash_algorithms: 102 | - hc32f4a0_2m 103 | - hc32f4a0_otp 104 | - name: HC32F4A0PITB 105 | cores: 106 | - name: main 107 | type: armv7em 108 | core_access_options: !Arm 109 | ap: 0 110 | psel: 0 111 | memory_map: 112 | - !Ram 113 | name: IRAM1 114 | range: 115 | start: 0x1ffe0000 116 | end: 0x20060000 117 | cores: 118 | - main 119 | - !Nvm 120 | name: IROM1 121 | range: 122 | start: 0x0 123 | end: 0x200000 124 | is_boot_memory: true 125 | cores: 126 | - main 127 | - !Generic 128 | name: IROM2 129 | range: 130 | start: 0x3000000 131 | end: 0x3001800 132 | cores: 133 | - main 134 | flash_algorithms: 135 | - hc32f4a0_2m 136 | - hc32f4a0_otp 137 | - name: HC32F4A0RGTB 138 | cores: 139 | - name: main 140 | type: armv7em 141 | core_access_options: !Arm 142 | ap: 0 143 | psel: 0 144 | memory_map: 145 | - !Ram 146 | name: IRAM1 147 | range: 148 | start: 0x1ffe0000 149 | end: 0x20060000 150 | cores: 151 | - main 152 | - !Nvm 153 | name: IROM1 154 | range: 155 | start: 0x0 156 | end: 0x100000 157 | is_boot_memory: true 158 | cores: 159 | - main 160 | - !Generic 161 | name: IROM2 162 | range: 163 | start: 0x3000000 164 | end: 0x3001800 165 | cores: 166 | - main 167 | flash_algorithms: 168 | - hc32f4a0_1m 169 | - hc32f4a0_otp 170 | - name: HC32F4A0RITB 171 | cores: 172 | - name: main 173 | type: armv7em 174 | core_access_options: !Arm 175 | ap: 0 176 | psel: 0 177 | memory_map: 178 | - !Ram 179 | name: IRAM1 180 | range: 181 | start: 0x1ffe0000 182 | end: 0x20060000 183 | cores: 184 | - main 185 | - !Nvm 186 | name: IROM1 187 | range: 188 | start: 0x0 189 | end: 0x200000 190 | is_boot_memory: true 191 | cores: 192 | - main 193 | - !Generic 194 | name: IROM2 195 | range: 196 | start: 0x3000000 197 | end: 0x3001800 198 | cores: 199 | - main 200 | flash_algorithms: 201 | - hc32f4a0_2m 202 | - hc32f4a0_otp 203 | - name: HC32F4A0SGHB 204 | cores: 205 | - name: main 206 | type: armv7em 207 | core_access_options: !Arm 208 | ap: 0 209 | psel: 0 210 | memory_map: 211 | - !Ram 212 | name: IRAM1 213 | range: 214 | start: 0x1ffe0000 215 | end: 0x20060000 216 | cores: 217 | - main 218 | - !Nvm 219 | name: IROM1 220 | range: 221 | start: 0x0 222 | end: 0x100000 223 | is_boot_memory: true 224 | cores: 225 | - main 226 | - !Generic 227 | name: IROM2 228 | range: 229 | start: 0x3000000 230 | end: 0x3001800 231 | cores: 232 | - main 233 | flash_algorithms: 234 | - hc32f4a0_1m 235 | - hc32f4a0_otp 236 | - name: HC32F4A0SGTB 237 | cores: 238 | - name: main 239 | type: armv7em 240 | core_access_options: !Arm 241 | ap: 0 242 | psel: 0 243 | memory_map: 244 | - !Ram 245 | name: IRAM1 246 | range: 247 | start: 0x1ffe0000 248 | end: 0x20060000 249 | cores: 250 | - main 251 | - !Nvm 252 | name: IROM1 253 | range: 254 | start: 0x0 255 | end: 0x100000 256 | is_boot_memory: true 257 | cores: 258 | - main 259 | - !Generic 260 | name: IROM2 261 | range: 262 | start: 0x3000000 263 | end: 0x3001800 264 | cores: 265 | - main 266 | flash_algorithms: 267 | - hc32f4a0_1m 268 | - hc32f4a0_otp 269 | - name: HC32F4A0SIHB 270 | cores: 271 | - name: main 272 | type: armv7em 273 | core_access_options: !Arm 274 | ap: 0 275 | psel: 0 276 | memory_map: 277 | - !Ram 278 | name: IRAM1 279 | range: 280 | start: 0x1ffe0000 281 | end: 0x20060000 282 | cores: 283 | - main 284 | - !Nvm 285 | name: IROM1 286 | range: 287 | start: 0x0 288 | end: 0x200000 289 | is_boot_memory: true 290 | cores: 291 | - main 292 | - !Generic 293 | name: IROM2 294 | range: 295 | start: 0x3000000 296 | end: 0x3001800 297 | cores: 298 | - main 299 | flash_algorithms: 300 | - hc32f4a0_2m 301 | - hc32f4a0_otp 302 | - name: HC32F4A0SITB 303 | cores: 304 | - name: main 305 | type: armv7em 306 | core_access_options: !Arm 307 | ap: 0 308 | psel: 0 309 | memory_map: 310 | - !Ram 311 | name: IRAM1 312 | range: 313 | start: 0x1ffe0000 314 | end: 0x20060000 315 | cores: 316 | - main 317 | - !Nvm 318 | name: IROM1 319 | range: 320 | start: 0x0 321 | end: 0x200000 322 | is_boot_memory: true 323 | cores: 324 | - main 325 | - !Generic 326 | name: IROM2 327 | range: 328 | start: 0x3000000 329 | end: 0x3001800 330 | cores: 331 | - main 332 | flash_algorithms: 333 | - hc32f4a0_2m 334 | - hc32f4a0_otp 335 | - name: HC32F4A0TIHB 336 | cores: 337 | - name: main 338 | type: armv7em 339 | core_access_options: !Arm 340 | ap: 0 341 | psel: 0 342 | memory_map: 343 | - !Ram 344 | name: IRAM1 345 | range: 346 | start: 0x1ffe0000 347 | end: 0x20060000 348 | cores: 349 | - main 350 | - !Nvm 351 | name: IROM1 352 | range: 353 | start: 0x0 354 | end: 0x200000 355 | is_boot_memory: true 356 | cores: 357 | - main 358 | - !Generic 359 | name: IROM2 360 | range: 361 | start: 0x3000000 362 | end: 0x3001800 363 | cores: 364 | - main 365 | flash_algorithms: 366 | - hc32f4a0_2m 367 | - hc32f4a0_otp 368 | flash_algorithms: 369 | - name: hc32f4a0_1m 370 | description: HC32F4A0 1MB Flash 371 | default: true 372 | instructions: QLpwR0C6cEfAunBHwLpwR0/qMABwRwAAT+owAHBHAAAAIAVJCHAFSQhgASACSSY5gfgqAHBHAAAmQAVAGAQBQA1IAGgA8AEAGLEMSAxJCGAC4AxICkkIYAUgC0kIYAtIC0kIYgAgCkkqMQhwBSAISYH4JgBwRwAAhAYBQIFZICIAQQVAgUcgIhgEAUAQYxEAAEAFQBC1APAR+BC9ELUERiBGAPB/+BC9ACADSQhgQB4BSRw5CGBwRxwEAUAwtQAlAPDk+U/0g3AySQhgT/QQRAAgIGAH4G0cL0iFQgPTAPDV+QEgML0rSAAdAGgA9IBwsPWAfwfQJ0gAHQBoAPCAcLDxgH/n0QfgIkgIMABoQPAQECBJCDEIYB5IAB0AaADwEBAAKPDRBCAaSQhgG0wAICBgAPCr+QfgFkgIMABoQPAQEBRJCDEIYBJIAB0AaADwEBAAKPDRBCAOSQhgEEwAICBgAPCT+QfgCkgIMABoQPAQEAhJCDEIYAZIAB0AaADwEBAAKPDRA0kIYADwf/kAIKjnAAAcBAFAgBoGAAAgAAMAQAADMLUERgAlAPBv+QQgGUkIYAAgIGAH4G0cF0iFQgPTAPBj+QEgML0TSAAdAGgA9IBwsPWAfwfQD0gAHQBoA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//d2/xngA/ACAAIoBNEBKhPR//dt/xDgA/AEAAQoBNECKgrR//dk/wfgA/AIAAgoA9EDKgHR//db/xC9BJQEQIAGAUAQtSNIQGiCsiJIAGjA84FEIEgAaMDzA2MMuZIRCOABLAHRkhIE4AIsAdESEwDgkhMLuQEgAOAAIA8rAdEBIQDgACEIQxCx//dr/yDgA/ABABix4rn/92T/GeAD8AIAAigE0QEqE9H/91v/EOAD8AQABCgE0QIqCtH/91L/B+AD8AgACCgD0QMqAdH/90n/EL0AkARAgAYBQAAAAAA= 373 | load_address: 0x1ffe0020 374 | pc_init: 0x3dd 375 | pc_uninit: 0x419 376 | pc_program_page: 0x3ed 377 | pc_erase_sector: 0x9d 378 | pc_erase_all: 0x95 379 | data_section_offset: 0x5ec 380 | flash_properties: 381 | address_range: 382 | start: 0x0 383 | end: 0x100000 384 | page_size: 0x400 385 | erased_byte_value: 0xff 386 | program_page_timeout: 100 387 | erase_sector_timeout: 3000 388 | sectors: 389 | - size: 0x2000 390 | address: 0x0 391 | stack_size: 16384 392 | - name: hc32f4a0_otp 393 | description: HC32F4A0 OTP Flash 394 | default: true 395 | instructions: QLpwR0C6cEfAunBHwLpwR0/qMABwRwAAT+owAHBHAAAAIAVJCHAFSQhgASACSSY5gfgqAHBHAAAmQAVAGAQBQA1IAGgA8AEAGLEMSAxJCGAC4AxICkkIYAUgC0kIYAtIC0kIYgAgCkkqMQhwBSAISYH4JgBwRwAAhAYBQIFZICIAQQVAgUcgIhgEAUAQYxEAAEAFQBC1APAR+BC9ELUERiBGAPAX+BC9ACADSQhgQB4BSRw5CGBwRxwEAUAQtQAkAPBI+QJIAPAF+AAgEL0AAAAQAAMwtQRGACUA8Dv5BCAZSQhgACAgYAfgbRwXSIVCA9MA8C/5ASAwvRNIAB0AaAD0gHCw9YB/B9APSAAdAGgA8IBwsPGAf+fRB+AKSAgwAGhA8BAQCEkIMQhgBkgAHQBoAPAQEAAo8NEDSQhgAPAJ+QAg2OcAABwEAUCAGgYAALUA8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91v/EOAD8AQABCgE0QIqCtH/91L/B+AD8AgACCgD0QMqAdH/90n/EL0AkARAgAYBQAAAAAA= 396 | load_address: 0x1ffe0020 397 | pc_init: 0x2a5 398 | pc_uninit: 0x2e1 399 | pc_program_page: 0x2b5 400 | pc_erase_sector: 0x9d 401 | pc_erase_all: 0x95 402 | data_section_offset: 0x4b4 403 | flash_properties: 404 | address_range: 405 | start: 0x3000000 406 | end: 0x3001800 407 | page_size: 0x1800 408 | erased_byte_value: 0xff 409 | program_page_timeout: 100 410 | erase_sector_timeout: 3000 411 | sectors: 412 | - size: 0x1800 413 | address: 0x0 414 | stack_size: 16384 415 | - name: hc32f4a0_2m 416 | description: HC32F4A0 2MB Flash 417 | default: true 418 | instructions: QLpwR0C6cEfAunBHwLpwR0/qMABwRwAAT+owAHBHAAAAIAVJCHAFSQhgASACSSY5gfgqAHBHAAAmQAVAGAQBQA1IAGgA8AEAGLEMSAxJCGAC4AxICkkIYAUgC0kIYAtIC0kIYgAgCkkqMQhwBSAISYH4JgBwRwAAhAYBQIFZICIAQQVAgUcgIhgEAUAQYxEAAEAFQBC1APAR+BC9ELUERiBGAPB/+BC9ACADSQhgQB4BSRw5CGBwRxwEAUAwtQAlAPDk+U/0g3AySQhgT/QQRAAgIGAH4G0cL0iFQgPTAPDV+QEgML0rSAAdAGgA9IBwsPWAfwfQJ0gAHQBoAPCAcLDxgH/n0QfgIkgIMABoQPAQECBJCDEIYB5IAB0AaADwEBAAKPDRBCAaSQhgG0wAICBgAPCr+QfgFkgIMABoQPAQEBRJCDEIYBJIAB0AaADwEBAAKPDRBCAOSQhgEEwAICBgAPCT+QfgCkgIMABoQPAQEAhJCDEIYAZIAB0AaADwEBAAKPDRA0kIYADwf/kAIKjnAAAcBAFAgBoGAAAgAAMAQAADMLUERgAlAPBv+QQgGUkIYAAgIGAH4G0cF0iFQgPTAPBj+QEgML0TSAAdAGgA9IBwsPWAfwfQD0gAHQBoAPCAcLDxgH/n0QfgCkgIMABoQPAQEAh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A/AEAAQoBNECKgrR//dk/wfgA/AIAAgoA9EDKgHR//db/xC9BJQEQIAGAUAQtSNIQGiCsiJIAGjA84FEIEgAaMDzA2MMuZIRCOABLAHRkhIE4AIsAdESEwDgkhMLuQEgAOAAIA8rAdEBIQDgACEIQxCx//dr/yDgA/ABABix4rn/92T/GeAD8AIAAigE0QEqE9H/91v/EOAD8AQABCgE0QIqCtH/91L/B+AD8AgACCgD0QMqAdH/90n/EL0AkARAgAYBQAAAAAA= 419 | load_address: 0x1ffe0020 420 | pc_init: 0x3dd 421 | pc_uninit: 0x419 422 | pc_program_page: 0x3ed 423 | pc_erase_sector: 0x9d 424 | pc_erase_all: 0x95 425 | data_section_offset: 0x5ec 426 | flash_properties: 427 | address_range: 428 | start: 0x0 429 | end: 0x200000 430 | page_size: 0x800 431 | erased_byte_value: 0xff 432 | program_page_timeout: 100 433 | erase_sector_timeout: 3000 434 | sectors: 435 | - size: 0x2000 436 | address: 0x0 437 | stack_size: 16384 438 | -------------------------------------------------------------------------------- /example/HDSC.HC32F4A0.1.0.7.pack: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USTHzhanglu/probe-rs-gui/26e60499ad8992b200f1b5a24a16d8d118e47584/example/HDSC.HC32F4A0.1.0.7.pack -------------------------------------------------------------------------------- /example/config.yaml: -------------------------------------------------------------------------------- 1 | chip: HC32F4A0PGTB 2 | pack_yaml: ./HC32F4A0-Series.yaml 3 | speed: '16000' 4 | base_address: '0x00000000' #just for bin file,default is 0x08000000 -------------------------------------------------------------------------------- /example/readme.md: -------------------------------------------------------------------------------- 1 | # Readme 2 | 3 | how to use 4 | 5 | ## *.yaml 6 | 7 | 烧录算法文件,Keil补丁包。文件名需要与yaml中对应 8 | 通过[`target-gen`](https://github.com/probe-rs/probe-rs/tree/master/target-gen#target-gen)生成 9 | 10 | Burn algorithm files, Keil patch pack. The file name needs to correspond to yaml 11 | Generate by[`target-gen`](https://github.com/probe-rs/probe-rs/tree/master/target-gen#target-gen) 12 | 13 | `target-gen pack xxx.pack ./` 14 | 15 | ## config.yaml 16 | 17 | 配置文件,描述了目标芯片型号,烧录所需算法,烧录速率等 18 | 19 | Configuration file, describing the target chip model, required algorithm for burning, burning rate, etc 20 | 21 | ```yaml 22 | chip: HC32F4A0PGTB 23 | pack_yaml: ./HC32F4A0-Series.yaml 24 | speed: '16000' 25 | base_address: '0x00000000' #just for bin file, default is 0x08000000. negligible 26 | ``` 27 | -------------------------------------------------------------------------------- /example/target-gen.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USTHzhanglu/probe-rs-gui/26e60499ad8992b200f1b5a24a16d8d118e47584/example/target-gen.exe -------------------------------------------------------------------------------- /src/probe-rs-gui.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # coding: utf-8 3 | 4 | import subprocess 5 | import tkinter as tk 6 | import tkinter.ttk as ttk 7 | from pygubu.widgets.pathchooserinput import PathChooserInput 8 | import threading 9 | import os,sys 10 | import webbrowser 11 | import yaml 12 | 13 | import os 14 | import sys 15 | #生成资源文件目录访问路径 16 | def app_path(): 17 | if getattr(sys, 'frozen', False): #是否Bundle Resource 18 | base_path = sys._MEIPASS 19 | else: 20 | base_path = os.path.abspath(".") 21 | return base_path 22 | 23 | version = '0.0.1' 24 | author = 'USTHzhanglu@outlook.com' 25 | copyright = 'USTHzhanglu' 26 | show_about = ( 27 | 'probe-rs-gui\r\n'+ 28 | 'Version:%s\r\n'%version+ 29 | 'Author:%s\r\n'%author+ 30 | 'Copyright@%s'%copyright 31 | ) 32 | class Cfg: 33 | def __init__(self): 34 | self.bin_path = '' 35 | self.config_path = '' 36 | self.format = 'bin' 37 | self.pack_yaml = '' 38 | self.speed = "16000" 39 | self.chip = '' 40 | self.base_address = '0x08000000' 41 | self.configure = None 42 | self.status = False 43 | self.error = '' 44 | self.log = '' 45 | def upload(self): 46 | try: 47 | with open(self.config_path,'r') as f: 48 | self.configure = yaml.load(f,Loader=yaml.FullLoader) 49 | self.pack_yaml = self.configure.get("pack_yaml") 50 | self.speed = self.configure.get("speed") 51 | self.chip = self.configure.get("chip") 52 | ret = self.configure.get("base_address") 53 | self.base_address = ret if(ret != None) else self.base_address 54 | self.format = self.bin_path.split('.')[-1] 55 | if(os.path.isabs(self.pack_yaml) == False): 56 | self.pack_yaml = os.path.dirname(os.path.abspath(self.config_path)) +'\\' + self.pack_yaml 57 | print("format: " + self.format) 58 | print("chip: " + self.chip) 59 | print("chip base address: " + self.base_address) 60 | print("pack path: " + self.pack_yaml) 61 | print("speed: " + self.speed) 62 | self.status = True 63 | 64 | except Exception as e: 65 | self.status = False 66 | self.error = e 67 | 68 | 69 | 70 | def download_bin(ui): 71 | is_err_download = False 72 | try: 73 | ret = '' 74 | #probe-rs download --chip HC32F4A0PIHB --chip-description-path .\HC32F4A0-Series.yaml --format bin --speed 16000 bootloader.bin 75 | #probe-rs cargo-flash --chip HC32F4A0PIHB --chip-description-path .\HC32F4A0-Series.yaml --format bin --speed 16000 --path bootloader.bin 76 | #use cargo-flash replease download can fast 77 | cmd = app_path() + '\probe-rs cargo-flash ' + \ 78 | '--chip %s '%cfg.chip + '--chip-description-path %s '%cfg.pack_yaml + \ 79 | '--speed %s '%cfg.speed + '--format %s '%cfg.format + '--path ' + cfg.bin_path + \ 80 | ' --log error' 81 | if(cfg.format == 'bin'): 82 | cmd += ' --base-address %s'%cfg.base_address 83 | # print(cmd) 84 | ret = subprocess.Popen(cmd,stdout=subprocess.PIPE, stderr=subprocess.STDOUT) 85 | cfg.log = ret.communicate()[0] 86 | if(cfg.log!=None): 87 | cfg.log = cfg.log.decode() 88 | if(cfg.log.find('Finished') < 0): 89 | is_err_download =True 90 | else: 91 | is_err_download =True 92 | cfg.log = '\nUnknown\n' 93 | print(cfg.log) 94 | except Exception as r: 95 | ui.messagebox.showerror('Flash error',r) 96 | is_err_download = True 97 | finally: 98 | if is_err_download == False: 99 | ui.messagebox.showinfo('Flash',' Download Success\n' + cfg.log.split('\n')[-2]) 100 | else: 101 | ui.messagebox.showerror('Flash error',cfg.log.split('\n')[1].replace('Error ','',1)) 102 | ui.out.edit_undo() 103 | ui.out.insert('end','----------Download Finish----------') 104 | 105 | 106 | def erase_bin(ui): 107 | is_err_erase= False 108 | try: 109 | ret = '' 110 | #probe-rs erase --chip HC32F4A0PIHB --chip-description-path .\HC32F4A0-Series.yaml 111 | cmd = app_path() + '\probe-rs erase ' + \ 112 | '--chip %s '%cfg.chip + '--chip-description-path %s '%cfg.pack_yaml 113 | # print(cmd) 114 | ret = subprocess.Popen(cmd,stdout=subprocess.PIPE, stderr=subprocess.STDOUT) 115 | cfg.log = ret.communicate()[0] 116 | if(cfg.log!=None): 117 | cfg.log = cfg.log.decode() 118 | if(cfg.log.find('Error') != -1): 119 | is_err_erase =True 120 | else: 121 | is_err_erase =True 122 | cfg.log = '\nUnknown\n' 123 | print(cfg.log) 124 | except Exception as r: 125 | is_err_erase = True 126 | ui.messagebox.showerror('Flash error',r) 127 | finally: 128 | if is_err_erase == False: 129 | ui.messagebox.showinfo('Flash','Erase success') 130 | else: 131 | ui.messagebox.showerror('Flash error',cfg.log.split('\n')[0].replace('Error: ','',1)) 132 | ui.out.edit_undo() 133 | ui.out.insert('end','-----------Erase Finish------------') 134 | 135 | 136 | class std2tk(object): 137 | def __init__(self,tk): 138 | self._buff = "" 139 | self.tk = tk 140 | def write(self, out_stream): 141 | self.tk.out.insert('end',out_stream) 142 | def flush(self): 143 | pass 144 | 145 | class PyocdApp: 146 | def __init__(self, master=None): 147 | # pragrm 148 | self.messagebox = tk.messagebox 149 | 150 | # build ui 151 | self.toplevel1 = tk.Tk() if master is None else tk.Toplevel(master) 152 | #menu 153 | self.menu1 = tk.Menu(self.toplevel1,tearoff = True) 154 | 155 | self.mi_download = 1 156 | self.menu1.add('command', font='{宋体} 9 {}', label='Update') 157 | _wcmd = lambda itemid="download": self.menucallback(itemid) 158 | self.menu1.entryconfigure(self.mi_download, command=_wcmd) 159 | self.toplevel1.configure(menu=self.menu1) 160 | 161 | self.mi_help = 2 162 | self.menu1.add('command', font='{宋体} 9 {}', label='Help') 163 | _wcmd = lambda itemid="help": self.menucallback(itemid) 164 | self.menu1.entryconfigure(self.mi_help, command=_wcmd) 165 | 166 | self.mi_about = 3 167 | self.menu1.add('command', font='{宋体} 9 {}', label='About') 168 | _wcmd = lambda itemid="about": self.menucallback(itemid) 169 | self.menu1.entryconfigure(self.mi_about, command=_wcmd) 170 | self.toplevel1.configure(menu=self.menu1) 171 | 172 | 173 | self.gui = ttk.Frame(self.toplevel1) 174 | self.labelframe1 = ttk.Labelframe(self.gui) 175 | self.binchooserinput = PathChooserInput(self.labelframe1) 176 | self.binchooserinput.configure(state='normal', title='file', type='file') 177 | self.binchooserinput.configure(filetypes=[('bin files', ['.bin','.hex','.elf'])]) 178 | self.binchooserinput.pack(fill='x', side='top') 179 | self.labelframe1.configure(text='Select Bin') 180 | self.labelframe1.pack(fill='x', side='top') 181 | 182 | self.labelframe2 = ttk.Labelframe(self.gui) 183 | self.binchooserinput2 = PathChooserInput(self.labelframe2) 184 | self.binchooserinput2.configure(state='normal', title='config', type='file') 185 | self.binchooserinput2.configure(filetypes=[('yaml file','.yaml')]) 186 | self.binchooserinput2.pack(fill='x', side='top') 187 | self.labelframe2.configure(text='Select Config') 188 | self.labelframe2.pack(fill='x', side='top') 189 | self.frame1 = ttk.Frame(self.gui) 190 | 191 | self.out = tk.Text(self.frame1,undo=True,maxundo = 1) 192 | self.out.configure(background='#000000',font='{宋体} 10 {}', foreground='#00ff00', height='9', relief='groove') 193 | self.out.configure(width='50') 194 | self.out.pack(anchor='center', expand='true', fill='both', side='top') 195 | 196 | self.erase = tk.Button(self.frame1) 197 | self.erase.configure(relief='groove', text='Erase Chip') 198 | self.erase.pack(anchor='center', ipadx='15', padx='20', pady='10', side='left') 199 | self.erase.configure(command=self.erasechip) 200 | self.start = tk.Button(self.frame1) 201 | self.start.configure(relief='groove', text='Download') 202 | self.start.pack(anchor='center', ipadx='15', padx='20', pady='10', side='right') 203 | self.start.configure(command=self.download) 204 | 205 | self.frame1.pack(anchor='center', expand='true', fill='both', side='bottom') 206 | self.gui.configure(height='480', relief='flat', width='320') 207 | self.gui.pack(anchor='center', side='top') 208 | self.gui.pack_propagate(0) 209 | self.toplevel1.configure(height='480', width='320') 210 | # self.toplevel1.geometry('320x480') 211 | #自适应屏幕居中 212 | self.toplevel1.geometry('320x480' + '+' 213 | + str((self.toplevel1.winfo_screenwidth() - 320) // 2) + '+' 214 | + str((self.toplevel1.winfo_screenheight() - 480) // 2 - 18)) 215 | 216 | self.toplevel1.title('probe-rs-GUI') 217 | self.toplevel1.resizable(False, False) 218 | self.toplevel1.attributes('-alpha',0.95) 219 | 220 | # Main widget 221 | self.mainwindow = self.toplevel1 222 | self.mainwindow.attributes('-topmost', 1)#强制前台 223 | self.mainwindow.after_idle(self.mainwindow.attributes,'-topmost',False) 224 | self.mainwindow.focus_force() 225 | self.mainwindow.bind('',self.press_key) 226 | def run(self): 227 | self.mainwindow.mainloop() 228 | 229 | 230 | def menucallback(self, itemid): 231 | if itemid == 'about': 232 | self.messagebox.showinfo(title="About",message = show_about) 233 | elif itemid =='help': 234 | webbrowser.open('https://github.com/USTHzhanglu/probe-rs-gui/readme.md',new=0) 235 | elif itemid =='download': 236 | if self.messagebox.askokcancel("Download", "Go to Github?"): 237 | webbrowser.open('https://github.com/USTHzhanglu/probe-rs-gui',new=0) 238 | 239 | def download(self): 240 | cfg.bin_path = self.binchooserinput.cget('path') 241 | cfg.config_path = self.binchooserinput2.cget('path') 242 | if (cfg.bin_path and cfg.config_path): 243 | self.out.delete('1.0','end') 244 | self.out.insert('end',"bin:%s"%(cfg.bin_path)) 245 | self.out.insert('end','\r\n') 246 | self.out.insert('end',"yaml:%s"%(cfg.config_path)) 247 | self.out.insert('end','\r\n') 248 | cfg.upload() 249 | if(cfg.status == False): 250 | self.messagebox.showerror('Config error',cfg.error) 251 | # os.chdir(config_path) 252 | self.out.edit_separator() 253 | self.out.insert('end','-----------Downloading-------------\r\n') 254 | 255 | download = threading.Thread(target=download_bin,args=(self,)) 256 | if download.is_alive() is False: 257 | download.start() 258 | else: 259 | self.messagebox.showerror('Flash error','download fail') 260 | else : 261 | self.messagebox.showerror('Path error','please select a valid file') 262 | 263 | def erasechip(self): 264 | cfg.config_path = self.binchooserinput2.cget('path') 265 | if cfg.config_path: 266 | self.out.delete('1.0','end') 267 | self.out.insert('end',"dir:%s"%(cfg.config_path)) 268 | self.out.insert('end','\r\n') 269 | cfg.upload() 270 | if(cfg.status == False): 271 | self.messagebox.showerror('Config error',cfg.error) 272 | self.out.edit_separator() 273 | if self.messagebox.askokcancel("Erase", "erase chip?"): 274 | self.out.insert('end','-----------Start Erase-------------\r\n') 275 | erase = threading.Thread(target=erase_bin,args=(self,)) 276 | if erase.is_alive() is False: 277 | erase.start() 278 | else: 279 | self.messagebox.showerror('Flash error','erase fail') 280 | else : 281 | self.messagebox.showerror('Path error','please select a valid config') 282 | 283 | 284 | def press_key(self,event): 285 | key_index = event.keycode 286 | if key_index in [13,32]: 287 | self.download() 288 | elif key_index == 27: 289 | if self.messagebox.askokcancel("Quit", "do you wait exit?"): 290 | self.mainwindow.destroy() 291 | 292 | 293 | if __name__ == '__main__': 294 | app = PyocdApp() 295 | cfg = Cfg() 296 | # _std = std2tk(app) 297 | # sys.stdout = _std 298 | app.run() 299 | 300 | -------------------------------------------------------------------------------- /src/probe-rs.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USTHzhanglu/probe-rs-gui/26e60499ad8992b200f1b5a24a16d8d118e47584/src/probe-rs.exe --------------------------------------------------------------------------------