├── LICENSE
├── README.md
├── xMCU.sln
└── xMCU
├── JLink.exe
├── JLinkARM.dll
├── JlinkDriver.rar
├── Program.cs
├── Properties
├── AssemblyInfo.cs
├── Resources.Designer.cs
├── Resources.resx
├── Settings.Designer.cs
└── Settings.settings
├── STM32_IAP.ico
├── app.config
├── xMCU.Designer.cs
├── xMCU.cs
├── xMCU.csproj
└── xMCU.resx
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 | {one line to give the program's name and a brief idea of what it does.}
635 | Copyright (C) {year} {name of author}
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | {project} Copyright (C) {year} {fullname}
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # firmware-cortex-m
2 | A gui for Jlink commander,Flash erase,firmware download,read UID
3 |
--------------------------------------------------------------------------------
/xMCU.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 11.00
3 | # Visual Studio 2010
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "xMCU", "xMCU\xMCU.csproj", "{C230BFC6-378A-4F61-9775-54776D80E7F0}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {C230BFC6-378A-4F61-9775-54776D80E7F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {C230BFC6-378A-4F61-9775-54776D80E7F0}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {C230BFC6-378A-4F61-9775-54776D80E7F0}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {C230BFC6-378A-4F61-9775-54776D80E7F0}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/xMCU/JLink.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CharlesHe023/firmware-cortex-m/7d619beaba2b70d4890e6b76f6348f02a19b4682/xMCU/JLink.exe
--------------------------------------------------------------------------------
/xMCU/JLinkARM.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CharlesHe023/firmware-cortex-m/7d619beaba2b70d4890e6b76f6348f02a19b4682/xMCU/JLinkARM.dll
--------------------------------------------------------------------------------
/xMCU/JlinkDriver.rar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CharlesHe023/firmware-cortex-m/7d619beaba2b70d4890e6b76f6348f02a19b4682/xMCU/JlinkDriver.rar
--------------------------------------------------------------------------------
/xMCU/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Windows.Forms;
4 |
5 | namespace testGetID
6 | {
7 | static class Program
8 | {
9 | ///
10 | /// 应用程序的主入口点。
11 | ///
12 | [STAThread]
13 | static void Main()
14 | {
15 | Application.EnableVisualStyles();
16 | Application.SetCompatibleTextRenderingDefault(false);
17 | Application.Run(new xMCU());
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/xMCU/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过下列属性集
6 | // 控制。更改这些属性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("xMCU")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("CQ-HC")]
12 | [assembly: AssemblyProduct("xMCU")]
13 | [assembly: AssemblyCopyright("Copyright © CQ-HC 2017")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 属性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("6a1800df-4953-478b-a4ac-fea7a3c2f846")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 内部版本号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.1.3")]
36 | [assembly: AssemblyFileVersion("1.0.1.3")]
37 |
--------------------------------------------------------------------------------
/xMCU/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本:4.0.30319.42000
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将会丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace xMCU.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// 一个强类型的资源类,用于查找本地化的字符串等。
17 | ///
18 | // 此类是由 StronglyTypedResourceBuilder
19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
20 | // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
21 | // (以 /str 作为命令选项),或重新生成 VS 项目。
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// 返回此类使用的缓存的 ResourceManager 实例。
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("xMCU.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// 使用此强类型资源类,为所有资源查找
51 | /// 重写当前线程的 CurrentUICulture 属性。
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/xMCU/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/xMCU/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本:4.0.30319.42000
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将会丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace xMCU.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/xMCU/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/xMCU/STM32_IAP.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CharlesHe023/firmware-cortex-m/7d619beaba2b70d4890e6b76f6348f02a19b4682/xMCU/STM32_IAP.ico
--------------------------------------------------------------------------------
/xMCU/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/xMCU/xMCU.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace testGetID
2 | {
3 | partial class xMCU
4 | {
5 | ///
6 | /// 必需的设计器变量。
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// 清理所有正在使用的资源。
12 | ///
13 | /// 如果应释放托管资源,为 true;否则为 false。
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows 窗体设计器生成的代码
24 |
25 | ///
26 | /// 设计器支持所需的方法 - 不要
27 | /// 使用代码编辑器修改此方法的内容。
28 | ///
29 | private void InitializeComponent()
30 | {
31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(xMCU));
32 | this.button_open = new System.Windows.Forms.Button();
33 | this.button_burn = new System.Windows.Forms.Button();
34 | this.MCU_MAC_ID = new System.Windows.Forms.Label();
35 | this.textBox_uid = new System.Windows.Forms.TextBox();
36 | this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
37 | this.button_erase = new System.Windows.Forms.Button();
38 | this.textBox_path = new System.Windows.Forms.TextBox();
39 | this.check_Fuse = new System.Windows.Forms.CheckBox();
40 | this.button_read = new System.Windows.Forms.Button();
41 | this.combo_device = new System.Windows.Forms.ComboBox();
42 | this.textBox_serial = new System.Windows.Forms.TextBox();
43 | this.label1 = new System.Windows.Forms.Label();
44 | this.dataGridUID = new System.Windows.Forms.DataGridView();
45 | this.labelDll = new System.Windows.Forms.Label();
46 | this.textDllVer = new System.Windows.Forms.TextBox();
47 | this.labelJlink = new System.Windows.Forms.Label();
48 | this.textJlinkVer = new System.Windows.Forms.TextBox();
49 | this.but_clear = new System.Windows.Forms.Button();
50 | ((System.ComponentModel.ISupportInitialize)(this.dataGridUID)).BeginInit();
51 | this.SuspendLayout();
52 | //
53 | // button_open
54 | //
55 | this.button_open.Location = new System.Drawing.Point(157, 4);
56 | this.button_open.Name = "button_open";
57 | this.button_open.Size = new System.Drawing.Size(75, 23);
58 | this.button_open.TabIndex = 1;
59 | this.button_open.Text = "固件(&F)";
60 | this.button_open.UseVisualStyleBackColor = true;
61 | this.button_open.Click += new System.EventHandler(this.button1_Click);
62 | //
63 | // button_burn
64 | //
65 | this.button_burn.Location = new System.Drawing.Point(248, 4);
66 | this.button_burn.Name = "button_burn";
67 | this.button_burn.Size = new System.Drawing.Size(75, 23);
68 | this.button_burn.TabIndex = 2;
69 | this.button_burn.Text = "烧录(&B)";
70 | this.button_burn.UseVisualStyleBackColor = true;
71 | this.button_burn.Click += new System.EventHandler(this.button2_Click);
72 | //
73 | // MCU_MAC_ID
74 | //
75 | this.MCU_MAC_ID.AutoSize = true;
76 | this.MCU_MAC_ID.Location = new System.Drawing.Point(15, 344);
77 | this.MCU_MAC_ID.Name = "MCU_MAC_ID";
78 | this.MCU_MAC_ID.Size = new System.Drawing.Size(29, 12);
79 | this.MCU_MAC_ID.TabIndex = 3;
80 | this.MCU_MAC_ID.Text = "UID:";
81 | //
82 | // textBox_uid
83 | //
84 | this.textBox_uid.Location = new System.Drawing.Point(46, 341);
85 | this.textBox_uid.Name = "textBox_uid";
86 | this.textBox_uid.ReadOnly = true;
87 | this.textBox_uid.Size = new System.Drawing.Size(177, 21);
88 | this.textBox_uid.TabIndex = 4;
89 | //
90 | // openFileDialog1
91 | //
92 | this.openFileDialog1.FileName = "openFileDialog1";
93 | //
94 | // button_erase
95 | //
96 | this.button_erase.Location = new System.Drawing.Point(337, 4);
97 | this.button_erase.Name = "button_erase";
98 | this.button_erase.Size = new System.Drawing.Size(75, 23);
99 | this.button_erase.TabIndex = 5;
100 | this.button_erase.Text = "擦除(&E)";
101 | this.button_erase.UseVisualStyleBackColor = true;
102 | this.button_erase.Click += new System.EventHandler(this.button_erase_Click);
103 | //
104 | // textBox_path
105 | //
106 | this.textBox_path.Location = new System.Drawing.Point(13, 30);
107 | this.textBox_path.Name = "textBox_path";
108 | this.textBox_path.ReadOnly = true;
109 | this.textBox_path.Size = new System.Drawing.Size(310, 21);
110 | this.textBox_path.TabIndex = 6;
111 | //
112 | // check_Fuse
113 | //
114 | this.check_Fuse.AutoSize = true;
115 | this.check_Fuse.Location = new System.Drawing.Point(425, 8);
116 | this.check_Fuse.Name = "check_Fuse";
117 | this.check_Fuse.Size = new System.Drawing.Size(48, 16);
118 | this.check_Fuse.TabIndex = 7;
119 | this.check_Fuse.Text = "加密";
120 | this.check_Fuse.UseVisualStyleBackColor = true;
121 | //
122 | // button_read
123 | //
124 | this.button_read.Location = new System.Drawing.Point(229, 341);
125 | this.button_read.Name = "button_read";
126 | this.button_read.Size = new System.Drawing.Size(60, 23);
127 | this.button_read.TabIndex = 8;
128 | this.button_read.Text = "读取(&R)";
129 | this.button_read.UseVisualStyleBackColor = true;
130 | this.button_read.Click += new System.EventHandler(this.button3_Click);
131 | //
132 | // combo_device
133 | //
134 | this.combo_device.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
135 | this.combo_device.FormattingEnabled = true;
136 | this.combo_device.Items.AddRange(new object[] {
137 | "STM32F051C8",
138 | "STM32F030F4",
139 | "STM32F031K4",
140 | "STM32F103C8",
141 | "STM32F103RB",
142 | "STM32F103VB",
143 | "STM32F103VE",
144 | "STM32L051K8"});
145 | this.combo_device.Location = new System.Drawing.Point(13, 4);
146 | this.combo_device.Name = "combo_device";
147 | this.combo_device.Size = new System.Drawing.Size(131, 20);
148 | this.combo_device.TabIndex = 10;
149 | this.combo_device.SelectedIndexChanged += new System.EventHandler(this.combo_device_SelectedIndexChanged);
150 | //
151 | // textBox_serial
152 | //
153 | this.textBox_serial.Location = new System.Drawing.Point(337, 30);
154 | this.textBox_serial.Name = "textBox_serial";
155 | this.textBox_serial.Size = new System.Drawing.Size(75, 21);
156 | this.textBox_serial.TabIndex = 11;
157 | this.textBox_serial.Text = "0";
158 | this.textBox_serial.TextChanged += new System.EventHandler(this.textBox_serial_TextChanged);
159 | //
160 | // label1
161 | //
162 | this.label1.AutoSize = true;
163 | this.label1.Location = new System.Drawing.Point(423, 35);
164 | this.label1.Name = "label1";
165 | this.label1.Size = new System.Drawing.Size(29, 12);
166 | this.label1.TabIndex = 12;
167 | this.label1.Text = "编号";
168 | //
169 | // dataGridUID
170 | //
171 | this.dataGridUID.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
172 | this.dataGridUID.Location = new System.Drawing.Point(13, 57);
173 | this.dataGridUID.Name = "dataGridUID";
174 | this.dataGridUID.ReadOnly = true;
175 | this.dataGridUID.RowTemplate.Height = 23;
176 | this.dataGridUID.Size = new System.Drawing.Size(460, 278);
177 | this.dataGridUID.TabIndex = 13;
178 | //
179 | // labelDll
180 | //
181 | this.labelDll.AutoSize = true;
182 | this.labelDll.Location = new System.Drawing.Point(374, 346);
183 | this.labelDll.Name = "labelDll";
184 | this.labelDll.Size = new System.Drawing.Size(29, 12);
185 | this.labelDll.TabIndex = 14;
186 | this.labelDll.Text = "DLL:";
187 | //
188 | // textDllVer
189 | //
190 | this.textDllVer.Location = new System.Drawing.Point(406, 344);
191 | this.textDllVer.Name = "textDllVer";
192 | this.textDllVer.ReadOnly = true;
193 | this.textDllVer.Size = new System.Drawing.Size(67, 21);
194 | this.textDllVer.TabIndex = 15;
195 | //
196 | // labelJlink
197 | //
198 | this.labelJlink.AutoSize = true;
199 | this.labelJlink.Location = new System.Drawing.Point(228, 373);
200 | this.labelJlink.Name = "labelJlink";
201 | this.labelJlink.Size = new System.Drawing.Size(47, 12);
202 | this.labelJlink.TabIndex = 16;
203 | this.labelJlink.Text = "Burner:";
204 | //
205 | // textJlinkVer
206 | //
207 | this.textJlinkVer.Location = new System.Drawing.Point(274, 370);
208 | this.textJlinkVer.Name = "textJlinkVer";
209 | this.textJlinkVer.ReadOnly = true;
210 | this.textJlinkVer.Size = new System.Drawing.Size(199, 21);
211 | this.textJlinkVer.TabIndex = 17;
212 | //
213 | // but_clear
214 | //
215 | this.but_clear.Location = new System.Drawing.Point(295, 341);
216 | this.but_clear.Name = "but_clear";
217 | this.but_clear.Size = new System.Drawing.Size(66, 23);
218 | this.but_clear.TabIndex = 18;
219 | this.but_clear.Text = "清除(&C)";
220 | this.but_clear.UseVisualStyleBackColor = true;
221 | this.but_clear.Click += new System.EventHandler(this.but_clear_Click);
222 | //
223 | // xMCU
224 | //
225 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
226 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
227 | this.ClientSize = new System.Drawing.Size(489, 399);
228 | this.Controls.Add(this.but_clear);
229 | this.Controls.Add(this.textJlinkVer);
230 | this.Controls.Add(this.labelJlink);
231 | this.Controls.Add(this.textDllVer);
232 | this.Controls.Add(this.labelDll);
233 | this.Controls.Add(this.dataGridUID);
234 | this.Controls.Add(this.label1);
235 | this.Controls.Add(this.textBox_serial);
236 | this.Controls.Add(this.combo_device);
237 | this.Controls.Add(this.button_read);
238 | this.Controls.Add(this.check_Fuse);
239 | this.Controls.Add(this.textBox_path);
240 | this.Controls.Add(this.button_erase);
241 | this.Controls.Add(this.textBox_uid);
242 | this.Controls.Add(this.MCU_MAC_ID);
243 | this.Controls.Add(this.button_burn);
244 | this.Controls.Add(this.button_open);
245 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
246 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
247 | this.MaximizeBox = false;
248 | this.Name = "xMCU";
249 | this.Text = "xMCU Flash Utility";
250 | ((System.ComponentModel.ISupportInitialize)(this.dataGridUID)).EndInit();
251 | this.ResumeLayout(false);
252 | this.PerformLayout();
253 |
254 | }
255 |
256 | #endregion
257 |
258 | private System.Windows.Forms.Button button_open;
259 | private System.Windows.Forms.Button button_burn;
260 | private System.Windows.Forms.Label MCU_MAC_ID;
261 | private System.Windows.Forms.TextBox textBox_uid;
262 | private System.Windows.Forms.OpenFileDialog openFileDialog1;
263 | private System.Windows.Forms.Button button_erase;
264 | private System.Windows.Forms.TextBox textBox_path;
265 | private System.Windows.Forms.CheckBox check_Fuse;
266 | private System.Windows.Forms.Button button_read;
267 | private System.Windows.Forms.ComboBox combo_device;
268 | private System.Windows.Forms.TextBox textBox_serial;
269 | private System.Windows.Forms.Label label1;
270 | private System.Windows.Forms.DataGridView dataGridUID;
271 | private System.Windows.Forms.Label labelDll;
272 | private System.Windows.Forms.TextBox textDllVer;
273 | private System.Windows.Forms.Label labelJlink;
274 | private System.Windows.Forms.TextBox textJlinkVer;
275 | private System.Windows.Forms.Button but_clear;
276 | }
277 | }
278 |
279 |
--------------------------------------------------------------------------------
/xMCU/xMCU.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Text;
7 | using System.Windows.Forms;
8 | using System.IO;
9 | using System.Diagnostics;
10 |
11 | namespace testGetID
12 | {
13 | public partial class xMCU : Form
14 | {
15 | //You may read these from an ini file
16 | Int32 serial_number = 1;
17 | uint MCU_MAC_ADDRESS = 0x1FFFF7AC;
18 | int MCU_MAC_LENGTH = 3;
19 | uint MCU_ADDRESS_OFFSET = 0x08000000;
20 | int MCU_PROG_INTERFACE = 1;
21 | int MCU_PROG_SPEED = 4000;
22 | string MCU_PROG_INTERFACE_SWD = "S";
23 | string MCU_PROG_INTERFACE_JTAG = "J";
24 | string MCU_FAMILY = "Cortex-M0";
25 | string MCU_DEVICE = "STM32F051C8";
26 | string JLINK_NOT_CONNECTED = "Can not connect to J-Link via USB";
27 | string binFilePath = "";
28 | string execProg = System.Environment.CurrentDirectory + "\\JLink.exe";
29 | string DLL_VERSION_STRING = "DLL version V";
30 | string COMPILED_STRING = ", compiled";
31 | string JLINK_HARDWARE_OLD_STRING = "Hardware: ";
32 | string JLINK_HARDWARE_NEW_STRING = "Hardware version: ";
33 | string FIRMWARE_STRING = "Firmware:";
34 | string JLINK_COMPILED_STRING = "compiled";
35 | Boolean new_jlink = false;
36 |
37 |
38 | DataTable myTable = new DataTable();
39 |
40 | Process pConsole = new Process();
41 |
42 | public xMCU()
43 | {
44 | InitializeComponent();
45 | combo_device.SelectedIndex = 0;
46 | combo_device.Enabled = true;
47 | check_Fuse.Enabled = false;
48 | textBox_serial.Enabled = true;
49 | serial_number = Convert.ToInt32(textBox_serial.Text);
50 | if (false == File.Exists(execProg))
51 | {
52 | MessageBox.Show("Jlink程序组件不存在!");
53 | return ; //Jlink.exe dose not exists.
54 | }
55 | pConsole.StartInfo.FileName = execProg;
56 | pConsole.StartInfo.UseShellExecute = false;
57 | pConsole.StartInfo.RedirectStandardInput = true;
58 | pConsole.StartInfo.RedirectStandardOutput = true;
59 | pConsole.StartInfo.RedirectStandardError = true;
60 | pConsole.StartInfo.CreateNoWindow = true;
61 |
62 | myTable.Columns.Add("编号");
63 | myTable.Columns.Add("UID");
64 | this.dataGridUID.DataSource = myTable;
65 | this.dataGridUID.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
66 | }
67 |
68 | private int Check_Status(string DeviceFamily)
69 | {
70 | int index = 0;
71 | if (("" == binFilePath) || (false == File.Exists(binFilePath)))
72 | {
73 | MessageBox.Show("请先选择一个固件文件!");
74 | return 1; //Bin file dose not exists.
75 | }
76 | if (false == File.Exists(execProg))
77 | {
78 | MessageBox.Show("缺少jlink组件!");
79 | return 2; //Jlink.exe dose not exists.
80 | }
81 | pConsole.Start();
82 | StreamWriter swi = pConsole.StandardInput;
83 | StreamReader sro = pConsole.StandardOutput;
84 | swi.WriteLine("qc");
85 | swi.Close();
86 | string message = sro.ReadToEnd();
87 | sro.Close();
88 | pConsole.WaitForExit();
89 | index = message.IndexOf(JLINK_NOT_CONNECTED);
90 | if (index > 0)
91 | {
92 | MessageBox.Show("Jlink编程器未连接!");
93 | return 3; //Jlink dose not connected.
94 | }
95 | index = message.IndexOf(MCU_FAMILY + " identified");
96 | if (index < 0)
97 | {
98 | MessageBox.Show("未检测到正确的CPU!");
99 | return 4; //MCU dose not identified.
100 | }
101 | return 0; //OK
102 | }
103 |
104 | private int Check_Status_Enhanced(string DeviceFamily)
105 | {
106 | int dll_ver,index = 0;
107 | if (false == File.Exists(execProg))
108 | {
109 | MessageBox.Show("缺少jlink组件!");
110 | return 2; //Jlink.exe dose not exists.
111 | }
112 | pConsole.Start();
113 | StreamWriter swi = pConsole.StandardInput;
114 | StreamReader sro = pConsole.StandardOutput;
115 | swi.WriteLine("qc");
116 | swi.Close();
117 | string message = sro.ReadToEnd();
118 | sro.Close();
119 | pConsole.WaitForExit();
120 | index = message.IndexOf(DLL_VERSION_STRING);
121 | if (index < 0)
122 | {
123 | MessageBox.Show("Jlink DLL版本获取错误!");
124 | return 3; //Jlink dose not connected.
125 | }
126 | string strDllVer = message.Substring(index + DLL_VERSION_STRING.Length, (message.IndexOf(COMPILED_STRING) - index - DLL_VERSION_STRING.Length));
127 | textDllVer.Text = strDllVer;
128 | strDllVer = System.Text.RegularExpressions.Regex.Replace(strDllVer, @"[^\d]*", "");
129 | dll_ver = int.Parse(strDllVer);
130 | if (dll_ver >= 512)
131 | {
132 | new_jlink = true;
133 | }
134 | string strJlinkHardware;
135 | if (true == new_jlink)
136 | {
137 | index = message.IndexOf(JLINK_HARDWARE_NEW_STRING);
138 | if (index < 0)
139 | {
140 | MessageBox.Show("Jlink 硬件版本获取错误!");
141 | return 3; //Jlink dose not connected.
142 | }
143 | strJlinkHardware = message.Substring(index + JLINK_HARDWARE_NEW_STRING.Length, (message.Length - index - JLINK_HARDWARE_NEW_STRING.Length));
144 | index = strJlinkHardware.IndexOf("\r\n");
145 | strJlinkHardware = strJlinkHardware.Substring(0, index);
146 | textJlinkVer.Text = strJlinkHardware;
147 | index = message.IndexOf(FIRMWARE_STRING);
148 | strJlinkHardware = message.Substring(index, (message.Length - index));
149 | index = strJlinkHardware.IndexOf(JLINK_COMPILED_STRING);
150 | strJlinkHardware = strJlinkHardware.Substring(index + JLINK_COMPILED_STRING.Length, (strJlinkHardware.IndexOf("\r\n") - index - JLINK_COMPILED_STRING.Length));
151 | textJlinkVer.Text += strJlinkHardware;
152 | }
153 | else
154 | {
155 | index = message.IndexOf(JLINK_HARDWARE_OLD_STRING);
156 | if (index < 0)
157 | {
158 | MessageBox.Show("Jlink 硬件版本获取错误!");
159 | return 3; //Jlink dose not connected.
160 | }
161 | strJlinkHardware = message.Substring(index + JLINK_HARDWARE_OLD_STRING.Length, (message.Length - index - JLINK_HARDWARE_OLD_STRING.Length));
162 | index = strJlinkHardware.IndexOf("\r\n");
163 | strJlinkHardware = strJlinkHardware.Substring(0, index);
164 | textJlinkVer.Text = strJlinkHardware;
165 | index = message.IndexOf(FIRMWARE_STRING);
166 | strJlinkHardware = message.Substring(index, (message.Length - index));
167 | index = strJlinkHardware.IndexOf(JLINK_COMPILED_STRING);
168 | strJlinkHardware = strJlinkHardware.Substring(index + JLINK_COMPILED_STRING.Length, (strJlinkHardware.IndexOf("\r\n") - index - JLINK_COMPILED_STRING.Length));
169 | textJlinkVer.Text += strJlinkHardware;
170 | }
171 | index = message.IndexOf(JLINK_NOT_CONNECTED);
172 | if (index > 0)
173 | {
174 | MessageBox.Show("Jlink编程器未连接!");
175 | return 4; //Jlink dose not connected.
176 | }
177 | if (false == new_jlink)
178 | {
179 | index = message.IndexOf(MCU_FAMILY + " identified");
180 | if (index < 0)
181 | {
182 | MessageBox.Show("未检测到正确的CPU!");
183 | return 5; //MCU dose not identified.
184 | }
185 | }
186 | else
187 | {
188 | pConsole.Start();
189 | swi = pConsole.StandardInput;
190 | sro = pConsole.StandardOutput;
191 | swi.WriteLine("connect");
192 | swi.WriteLine(MCU_DEVICE.ToString());
193 | swi.WriteLine(MCU_PROG_INTERFACE_SWD.ToString());
194 | swi.WriteLine(MCU_PROG_SPEED.ToString("D"));
195 | swi.WriteLine("qc");
196 | swi.Close();
197 | message = sro.ReadToEnd();
198 | sro.Close();
199 | pConsole.WaitForExit();
200 | index = message.IndexOf(MCU_FAMILY + " identified");
201 | if (index < 0)
202 | {
203 | MessageBox.Show("未检测到正确的CPU!");
204 | return 5; //MCU dose not identified.
205 | }
206 | }
207 |
208 | return 0; //OK
209 | }
210 |
211 | private string Get_MCU_MAC(uint mac_address,int mac_length, Boolean flag)
212 | {
213 | string strMAC = "";
214 | pConsole.Start();
215 | StreamWriter swi = pConsole.StandardInput;
216 | StreamReader sro = pConsole.StandardOutput;
217 | if (true == flag)
218 | {
219 | swi.WriteLine("connect");
220 | swi.WriteLine(MCU_DEVICE.ToString());
221 | swi.WriteLine(MCU_PROG_INTERFACE_SWD.ToString());
222 | swi.WriteLine(MCU_PROG_SPEED.ToString("D"));
223 | }
224 | swi.WriteLine("mem32 0x" + mac_address.ToString("X8") + " " + mac_length.ToString("D"));
225 | swi.WriteLine("qc");
226 | swi.Close();
227 | string message = sro.ReadToEnd();
228 | sro.Close();
229 | pConsole.WaitForExit();
230 | int index = message.IndexOf(MCU_MAC_ADDRESS.ToString("X8") + " = ");
231 | if (index >= 0)
232 | {
233 | strMAC = message.Substring(index + 11, 26);
234 | string[] temp = strMAC.Split(' ');
235 | strMAC = "";
236 | if (3 == temp.Length)
237 | {
238 | foreach (var key in temp)
239 | {
240 | for (int i = 4; i > 0; i--)
241 | {
242 | strMAC += key.Substring((i - 1) * 2, 2);
243 | }
244 | }
245 |
246 | }
247 | }
248 | if (("FFFFFFFFFFFFFFFFFFFFFFFF" == strMAC) || ("000000000000000000000000" == strMAC) || (strMAC.Length != 2*4 * mac_length))
249 | {
250 | MessageBox.Show("MAC读取错误!", "MAC读取状态", MessageBoxButtons.OK, MessageBoxIcon.Error);
251 | strMAC = "";
252 | }
253 | return strMAC;
254 | }
255 |
256 | private int MCU_Erase_Flash(string mcu_device, uint addressOffset, int interfaceProg, int speedProg, Boolean flag)
257 | {
258 | int index = -1;
259 | pConsole.Start();
260 | StreamWriter swi = pConsole.StandardInput;
261 | StreamReader sro = pConsole.StandardOutput;
262 | if (false == flag)
263 | {
264 | swi.WriteLine("si " + interfaceProg.ToString("D"));
265 | swi.WriteLine("speed " + speedProg.ToString("D"));
266 | swi.WriteLine("exec device = " + mcu_device);
267 | }
268 | else
269 | {
270 | swi.WriteLine("connect");
271 | swi.WriteLine(MCU_DEVICE.ToString());
272 | swi.WriteLine(MCU_PROG_INTERFACE_SWD.ToString());
273 | swi.WriteLine(MCU_PROG_SPEED.ToString("D"));
274 | swi.WriteLine("exec device = " + mcu_device);
275 | }
276 | swi.WriteLine("erase");
277 | swi.WriteLine("r0");
278 | swi.WriteLine("sleep 100");
279 | swi.WriteLine("r1");
280 | swi.WriteLine("qc");
281 | swi.Close();
282 | string message = "";
283 | while (sro.Peek() > 0)
284 | {
285 | message = sro.ReadLine();
286 | index = message.IndexOf("Erasing done.");
287 | if (index >= 0)
288 | {
289 | break;
290 | }
291 | }
292 | sro.Close();
293 | pConsole.WaitForExit();
294 | if (index < 0)
295 | {
296 | return 1;
297 | }
298 | else
299 | {
300 | //richText_log.AppendText(message);
301 | if (message.IndexOf("Erasing done") < 0)
302 | {
303 | return 2;
304 | }
305 | else
306 | {
307 | return 0;
308 | }
309 | }
310 | }
311 |
312 | private int MCU_Prog_Flash(string mcu_device, uint addressOffset, int interfaceProg, int speedProg, Boolean flag, string fw_file)
313 | {
314 | int index = -1;
315 | if (("" == fw_file) || (false == File.Exists(fw_file)))
316 | {
317 | MessageBox.Show("请先选择一个固件文件!");
318 | return 1; //Bin file dose not exists.
319 | }
320 | pConsole.Start();
321 | StreamWriter swi = pConsole.StandardInput;
322 | StreamReader sro = pConsole.StandardOutput;
323 | if (false == flag)
324 | {
325 | swi.WriteLine("si " + interfaceProg.ToString("D"));
326 | swi.WriteLine("speed " + speedProg.ToString("D"));
327 | swi.WriteLine("exec device = " + mcu_device);
328 | }
329 | else
330 | {
331 | swi.WriteLine("connect");
332 | swi.WriteLine(MCU_DEVICE.ToString());
333 | swi.WriteLine(MCU_PROG_INTERFACE_SWD.ToString());
334 | swi.WriteLine(MCU_PROG_SPEED.ToString("D"));
335 | swi.WriteLine("exec device = " + mcu_device);
336 | }
337 | swi.WriteLine("loadfile " + fw_file + " 0x" + addressOffset.ToString("X8"));
338 | swi.WriteLine("r0");
339 | swi.WriteLine("sleep 100");
340 | swi.WriteLine("r1");
341 | swi.WriteLine("qc");
342 | swi.Close();
343 | string message = "";
344 | while (sro.Peek() > 0)
345 | {
346 | message = sro.ReadLine();
347 | index = message.IndexOf("Flash download:");
348 | if (index >= 0)
349 | {
350 | message = message + sro.ReadToEnd();
351 | /*
352 | if (message.IndexOf("Flash programming performed for ") >= 0)
353 | {
354 | message = message + ".\r\n" + sro.ReadLine();
355 | }*/
356 | break;
357 | }
358 | }
359 | sro.Close();
360 | pConsole.WaitForExit();
361 | if (index < 0)
362 | {
363 | return 2;
364 | }
365 | else
366 | {
367 | message = message.Replace("Flash download: ", "");
368 | message = message.Replace("Info: J-Link: ", "");
369 | message = message.Replace("\r\n", "");
370 | //richText_log.AppendText(message);
371 | if (message.Contains("Error while programming flash") || message.Contains("Programming failed"))
372 | {
373 | return 3;
374 | }
375 | if (message.Contains("Flash contents already match") || message.Contains("O.K."))
376 | {
377 | return 0;
378 | }
379 | else
380 | {
381 | return 4;
382 | }
383 | }
384 | }
385 |
386 | private string MCU_Read_Memory32(uint address, int length)
387 | {
388 | int index = -1;
389 | pConsole.Start();
390 | StreamWriter swi = pConsole.StandardInput;
391 | StreamReader sro = pConsole.StandardOutput;
392 | swi.WriteLine("r0");
393 | swi.WriteLine("sleep 2");
394 | swi.WriteLine("r1");
395 | swi.WriteLine("halt");
396 | swi.WriteLine("mem32 0x" + address.ToString("X8") + " " + length.ToString("D"));
397 | swi.WriteLine("qc");
398 | swi.Close();
399 | string message = sro.ReadToEnd();
400 | sro.Close();
401 | pConsole.WaitForExit();
402 | index = message.IndexOf(address.ToString("X8"));
403 | if (index < 0)
404 | {
405 | return "";
406 | }
407 | else
408 | {
409 | message = message.Substring(index);
410 | message = message.Replace(" \r\nJ-Link>", "");
411 | //richText_log.AppendText("Read: " + message + "\r\n");
412 | message = message.Substring(11);
413 | return message;
414 | }
415 | }
416 |
417 | private void MCU_Write_Memory32(uint[] address, uint[] value, int length)
418 | {
419 | pConsole.Start();
420 | StreamWriter swi = pConsole.StandardInput;
421 | StreamReader sro = pConsole.StandardOutput;
422 | swi.WriteLine("halt");
423 | for (int i = 0; i < length; i++)
424 | {
425 | swi.WriteLine("w4 0x" + address[i].ToString("X8") + " " + value[i].ToString("X8"));
426 | }
427 | swi.WriteLine("qc");
428 | swi.Close();
429 | string message = sro.ReadToEnd();
430 | message = message.Substring(message.IndexOf("Writing "));
431 | message = message.Replace("J-Link>", "");
432 | //richText_log.AppendText(message);
433 | sro.Close();
434 | pConsole.WaitForExit();
435 | }
436 |
437 | private void MCU_Write_Memory16(uint[] address, UInt16[] value, int length)
438 | {
439 | pConsole.Start();
440 | StreamWriter swi = pConsole.StandardInput;
441 | StreamReader sro = pConsole.StandardOutput;
442 | swi.WriteLine("halt");
443 | for (int i = 0; i < length; i++)
444 | {
445 | swi.WriteLine("w2 0x" + address[i].ToString("X8") + " " + value[i].ToString("X4"));
446 | }
447 | swi.WriteLine("qc");
448 | swi.Close();
449 | string message = sro.ReadToEnd();
450 | message = message.Substring(message.IndexOf("Writing "));
451 | message = message.Replace("J-Link>", "");
452 | //richText_log.AppendText(message);
453 | sro.Close();
454 | pConsole.WaitForExit();
455 | }
456 |
457 | private void MCU_Write_Memory8(uint[] address, byte[] value, int length)
458 | {
459 | pConsole.Start();
460 | StreamWriter swi = pConsole.StandardInput;
461 | StreamReader sro = pConsole.StandardOutput;
462 | swi.WriteLine("halt");
463 | for (int i = 0; i < length; i++)
464 | {
465 | swi.WriteLine("w1 0x" + address[i].ToString("X8") + " " + value[i].ToString("X2"));
466 | }
467 | swi.WriteLine("qc");
468 | swi.Close();
469 | string message = sro.ReadToEnd();
470 | message = message.Substring(message.IndexOf("Writing "));
471 | message = message.Replace("J-Link>", "");
472 | //richText_log.AppendText(message);
473 | sro.Close();
474 | pConsole.WaitForExit();
475 | }
476 |
477 | private int MCU_Get_Flash_Status(uint address, uint status, bool bInvert)
478 | {
479 | uint number;
480 | string message = "";
481 | for (int i = 0; i < 5; i++)
482 | {
483 | message = MCU_Read_Memory32(address, 1);
484 | if ("" != message)
485 | {
486 | number = Convert.ToUInt32(message, 16);
487 | if (true == bInvert)
488 | {
489 | number &= status;
490 | status = ~status;
491 | number |= status;
492 | if (status == number)
493 | {
494 | return 0;
495 | }
496 | }
497 | else
498 | {
499 | number &= status;
500 | if (status == number)
501 | {
502 | return 0;
503 | }
504 | }
505 | }
506 | System.Threading.Thread.Sleep(500);
507 | }
508 | return 1; //Timeout!
509 | }
510 |
511 | private int MCU_Unlock_Flash()
512 | {
513 | uint[] FlashKeyr = new uint[2] { 0x40022004, 0x40022004 };
514 | uint[] FlashKeyv = new uint[2] { 0x45670123, 0xCDEF89AB };
515 | if (0 != MCU_Get_Flash_Status(0x40022010, 0x00000080, false))
516 | {
517 | return 1; //Get flash status timeout!
518 | }
519 | MCU_Write_Memory32(FlashKeyr, FlashKeyv,2);
520 | return 0;
521 | }
522 |
523 | private int MCU_Unlock_OB_Flash()
524 | {
525 | uint[] FlashKeyr = new uint[2] { 0x40022008, 0x40022008 };
526 | uint[] FlashKeyv = new uint[2] { 0x45670123, 0xCDEF89AB };
527 | if (0 != MCU_Get_Flash_Status(0x40022010, 0x00000200, true))
528 | {
529 | return 1; //Get OB flash status timeout!
530 | }
531 | MCU_Write_Memory32(FlashKeyr, FlashKeyv, 2);
532 | return 0;
533 | }
534 |
535 | private int MCU_Flash_Read_Protect(byte nLevel)
536 | {
537 | uint[] FlashKeyr = new uint[3] { 0x40022010, 0x40022010, 0x40022010 };
538 | uint[] FlashKeyv = new uint[3] { 0, 0, 0 };
539 | string message = "";
540 | uint value = 0;
541 | if (0 != MCU_Get_Flash_Status(0x4002200C, 0x00000001, true))
542 | {
543 | return 1; //Get OB flash status timeout!
544 | }
545 | message = MCU_Read_Memory32(0x40022010,1);
546 | if ("" == message)
547 | {
548 | return 2; //Get memory error!
549 | }
550 | else
551 | {
552 | value = Convert.ToUInt32(message,16);
553 | FlashKeyv[0] = value | 0x00000020;
554 | FlashKeyv[1] = value | 0x00000040;
555 | }
556 | MCU_Write_Memory32(FlashKeyr, FlashKeyv, 2);
557 | if (0 != MCU_Get_Flash_Status(0x4002200C, 0x00000001, true))
558 | {
559 | return 3; //Get OB flash status timeout!
560 | }
561 | message = MCU_Read_Memory32(0x40022010, 1);
562 | if ("" == message)
563 | {
564 | return 4; //Get memory error!
565 | }
566 | else
567 | {
568 | value = Convert.ToUInt32(message,16);
569 | FlashKeyv[0] = 0x00000020;
570 | FlashKeyv[0] = ~FlashKeyv[0];
571 | FlashKeyv[0] = value & FlashKeyv[0];
572 | FlashKeyv[1] = value | 0x00000010;
573 | }
574 | MCU_Write_Memory32(FlashKeyr, FlashKeyv, 2);
575 | uint[] addrBuffer = new uint[1] { 0x1FFFF800 };
576 | byte[] valueBuffer = new byte[1] { nLevel };
577 | MCU_Write_Memory8(addrBuffer, valueBuffer, 1);
578 | if (0 != MCU_Get_Flash_Status(0x4002200C, 0x00000001, true))
579 | {
580 | return 5; //Get OB flash status timeout!
581 | }
582 | message = MCU_Read_Memory32(0x40022010, 1);
583 | if ("" == message)
584 | {
585 | return 6; //Get memory error!
586 | }
587 | else
588 | {
589 | value = Convert.ToUInt32(message,16);
590 | FlashKeyv[0] = 0x00000200;
591 | FlashKeyv[0] = ~FlashKeyv[0];
592 | FlashKeyv[0] = value & FlashKeyv[0];
593 | FlashKeyv[1] = value | 0x00000080;
594 | FlashKeyv[2] = value | 0x00002000;
595 | }
596 | MCU_Write_Memory32(FlashKeyr, FlashKeyv, 3);
597 | return 0;
598 | }
599 |
600 | private int MCU_Fuse_Flash()
601 | {
602 | if (0 != MCU_Unlock_Flash())
603 | {
604 | return 1; //Unlock flash error!
605 | }
606 | System.Threading.Thread.Sleep(500);
607 | if (0 != MCU_Unlock_OB_Flash())
608 | {
609 | return 2; //Unlock OB flash error!
610 | }
611 | if (0 != MCU_Flash_Read_Protect(0xBB))
612 | {
613 | return 3; //Set flash read protect error!
614 | }
615 | return 0;
616 | }
617 |
618 | private void UpdateResultList(object str)
619 | {
620 | if (dataGridUID.InvokeRequired)
621 | {
622 | // 当一个控件的InvokeRequired属性值为真时,说明有一个创建它以外的线程想访问它
623 | Action actionDelegate = (x) =>
624 | {
625 | DataRow[] myRows = myTable.Select("UID ='" + str.ToString() + "'");
626 | if (myRows.Length != 0)
627 | {
628 | this.dataGridUID.ClearSelection();
629 | this.dataGridUID.Rows[myTable.Rows.IndexOf(myRows[0])].Selected = true;
630 | return;
631 | }
632 | string[] myStringArry = new string[2];
633 | myStringArry[0] = serial_number.ToString();
634 | myStringArry[1] = str.ToString();
635 | myTable.Rows.Add(myStringArry);
636 | serial_number++;
637 | textBox_serial.Text = serial_number.ToString();
638 | //UpdateBarCodeText(barCode);
639 | };
640 | // 或者
641 | // Action actionDelegate = delegate(string txt) { this.label2.Text = txt; };
642 | this.dataGridUID.Invoke(actionDelegate, str);
643 | }
644 | else
645 | {
646 | DataRow[] myRows = myTable.Select("UID ='" + str.ToString() + "'");
647 | if (myRows.Length != 0)
648 | {
649 | this.dataGridUID.ClearSelection();
650 | this.dataGridUID.Rows[myTable.Rows.IndexOf(myRows[0])].Selected = true;
651 | return;
652 | }
653 | string[] myStringArry = new string[2];
654 | myStringArry[0] = serial_number.ToString();
655 | myStringArry[1] = str.ToString();
656 | myTable.Rows.Add(myStringArry);
657 | serial_number++;
658 | textBox_serial.Text = serial_number.ToString();
659 | //UpdateBarCodeText(barCode);
660 | }
661 | }
662 |
663 | private void button1_Click(object sender, EventArgs e)
664 | {
665 | //*.bin, *.mot, *.hex, *.srec supported
666 | openFileDialog1.Filter = "固件文件(*.bin,*.mot,*.hex,*.srec)|*.bin;*.hex;*.mot;*.srec";
667 | openFileDialog1.FileName = "";
668 | if (DialogResult.OK == openFileDialog1.ShowDialog())
669 | {
670 | binFilePath = openFileDialog1.FileName;
671 | textBox_path.Text = binFilePath;
672 | FileInfo fi = new FileInfo(binFilePath);
673 | //richText_log.AppendText("Bin file size:" + fi.Length + "\r\n");
674 | }
675 | else
676 | {
677 | textBox_path.Clear();
678 | }
679 | }
680 |
681 | private void button2_Click(object sender, EventArgs e)
682 | {
683 | if (0 != Check_Status_Enhanced(MCU_FAMILY))
684 | {
685 | return;
686 | }
687 | textBox_uid.Text = Get_MCU_MAC(MCU_MAC_ADDRESS, MCU_MAC_LENGTH, new_jlink);
688 | if ("" != textBox_uid.Text)
689 | {
690 | UpdateResultList(textBox_uid.Text);
691 | //MessageBox.Show("Read MCU MAC OK!\r\n");
692 | }
693 | else
694 | {
695 | return;
696 | }
697 | int res = MCU_Prog_Flash(MCU_DEVICE, MCU_ADDRESS_OFFSET, MCU_PROG_INTERFACE, MCU_PROG_SPEED, new_jlink, binFilePath);
698 | if(0 == res)
699 | {
700 | //richText_log.AppendText("MCU flash program OK!\r\n");
701 | MessageBox.Show("烧录成功!", "编程状态", MessageBoxButtons.OK, MessageBoxIcon.Information);
702 | }
703 | else
704 | {
705 | //richText_log.AppendText("MCU flash program error!\r\n");
706 | MessageBox.Show("烧录失败!", "编程状态", MessageBoxButtons.OK, MessageBoxIcon.Error);
707 | }
708 | if (true == check_Fuse.Checked)
709 | {
710 | if (0 == MCU_Fuse_Flash())
711 | {
712 | MessageBox.Show("MCU flash fuse OK!\r\n");
713 | }
714 | else
715 | {
716 | MessageBox.Show("MCU flash fuse error!\r\n");
717 | }
718 | }
719 | }
720 |
721 | private void button_erase_Click(object sender, EventArgs e)
722 | {
723 | if (0 != Check_Status_Enhanced(MCU_FAMILY))
724 | {
725 | return;
726 | }
727 | textBox_uid.Text = Get_MCU_MAC(MCU_MAC_ADDRESS, MCU_MAC_LENGTH, new_jlink);
728 | if ("" != textBox_uid.Text)
729 | {
730 | UpdateResultList(textBox_uid.Text);
731 | //MessageBox.Show("Read MCU MAC OK!\r\n");
732 | }
733 | int res = MCU_Erase_Flash(MCU_DEVICE, MCU_ADDRESS_OFFSET, MCU_PROG_INTERFACE, MCU_PROG_SPEED, new_jlink);
734 | if (0 == res)
735 | {
736 | //richText_log.AppendText("MCU flash program OK!\r\n");
737 | MessageBox.Show("擦除成功!", "擦除状态", MessageBoxButtons.OK, MessageBoxIcon.Information);
738 | }
739 | else
740 | {
741 | //richText_log.AppendText("MCU flash program error!\r\n");
742 | MessageBox.Show("擦除失败!", "擦除状态", MessageBoxButtons.OK, MessageBoxIcon.Error);
743 | }
744 | }
745 |
746 | private void button3_Click(object sender, EventArgs e)
747 | {
748 | if (0 != Check_Status_Enhanced(MCU_FAMILY))
749 | {
750 | return;
751 | }
752 | textBox_uid.Text = Get_MCU_MAC(MCU_MAC_ADDRESS, MCU_MAC_LENGTH, new_jlink);
753 | if ("" != textBox_uid.Text)
754 | {
755 | UpdateResultList(textBox_uid.Text);
756 | MessageBox.Show("Read MCU UID OK!\r\n");
757 | //richText_uid.AppendText(textBox_uid.Text + "\r\n");
758 | }
759 | Clipboard.SetDataObject(textBox_uid.Text);
760 | }
761 |
762 | private void combo_device_SelectedIndexChanged(object sender, EventArgs e)
763 | {
764 | MCU_DEVICE = combo_device.SelectedItem.ToString();
765 | switch (MCU_DEVICE)
766 | {
767 | case "STM32F030F4":
768 | case "STM32F031K4":
769 | case "STM32F051C8":
770 | MCU_FAMILY = "Cortex-M0";
771 | MCU_MAC_ADDRESS = 0x1FFFF7AC;
772 | break;
773 | case "STM32L051K8":
774 | MCU_FAMILY = "Cortex-M0";
775 | MCU_MAC_ADDRESS = 0x1FF80050;
776 | break;
777 | case "STM32F103C8":
778 | case "STM32F103RB":
779 | case "STM32F103VB":
780 | case "STM32F103VE":
781 | MCU_FAMILY = "Cortex-M3";
782 | MCU_MAC_ADDRESS = 0x1FFFF7E8;
783 | break;
784 | }
785 | /*
786 | if (("STM32F051C8" == MCU_DEVICE)||("STM32F030F4" == MCU_DEVICE))
787 | {
788 | MCU_FAMILY = "Cortex-M0";
789 | MCU_MAC_ADDRESS = 0x1FFFF7AC;
790 | }
791 | else if (("STM32F103RB" == MCU_DEVICE) || ("STM32F103VB" == MCU_DEVICE))
792 | {
793 | MCU_FAMILY = "Cortex-M3";
794 | MCU_MAC_ADDRESS = 0x1FFFF7E8;
795 | }
796 | * */
797 | }
798 |
799 | private void textBox_serial_TextChanged(object sender, EventArgs e)
800 | {
801 | serial_number = int.Parse(textBox_serial.Text);
802 | }
803 |
804 | private void but_clear_Click(object sender, EventArgs e)
805 | {
806 | textBox_uid.Clear();
807 | }
808 | }
809 | }
810 |
--------------------------------------------------------------------------------
/xMCU/xMCU.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 9.0.21022
7 | 2.0
8 | {C230BFC6-378A-4F61-9775-54776D80E7F0}
9 | WinExe
10 | Properties
11 | xMCU
12 | xMCU
13 | v3.5
14 | 512
15 | false
16 |
17 |
18 | 3.5
19 |
20 | publish\
21 | true
22 | Disk
23 | false
24 | Foreground
25 | 7
26 | Days
27 | false
28 | false
29 | true
30 | 0
31 | 1.0.0.%2a
32 | false
33 | true
34 | Client
35 |
36 |
37 | true
38 | full
39 | false
40 | bin\Debug\
41 | DEBUG;TRACE
42 | prompt
43 | 4
44 | AllRules.ruleset
45 |
46 |
47 | pdbonly
48 | true
49 | bin\Release\
50 | TRACE
51 | prompt
52 | 4
53 | AllRules.ruleset
54 |
55 |
56 | STM32_IAP.ico
57 |
58 |
59 |
60 |
61 | 3.5
62 |
63 |
64 | 3.5
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 | Form
75 |
76 |
77 | xMCU.cs
78 |
79 |
80 |
81 |
82 | xMCU.cs
83 | Designer
84 |
85 |
86 | ResXFileCodeGenerator
87 | Resources.Designer.cs
88 | Designer
89 |
90 |
91 | True
92 | Resources.resx
93 | True
94 |
95 |
96 |
97 | SettingsSingleFileGenerator
98 | Settings.Designer.cs
99 |
100 |
101 | True
102 | Settings.settings
103 | True
104 |
105 |
106 |
107 |
108 | False
109 | .NET Framework 3.5 SP1 Client Profile
110 | false
111 |
112 |
113 | False
114 | .NET Framework 2.0 %28x86%29
115 | false
116 |
117 |
118 | False
119 | .NET Framework 3.0 %28x86%29
120 | false
121 |
122 |
123 | False
124 | .NET Framework 3.5
125 | true
126 |
127 |
128 | False
129 | .NET Framework 3.5 SP1
130 | false
131 |
132 |
133 | False
134 | Windows Installer 3.1
135 | true
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
150 |
--------------------------------------------------------------------------------
/xMCU/xMCU.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | 17, 17
122 |
123 |
124 |
125 |
126 | AAABAAYAICAQAAEABADoAgAAZgAAABAQEAABAAQAKAEAAE4DAAAwMBAAAQAEAGgGAAB2BAAAICAAAAEA
127 | CACoCAAA3goAADAwAAABAAgAqA4AAIYTAAAQEAAAAQAIAGgFAAAuIgAAKAAAACAAAABAAAAAAQAEAAAA
128 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAIAAAACAgACAAAAAgACAAICAAADAwMAAgICAAAAA
129 | /wAA/wAAAP//AP8AAAD/AP8A//8AAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
130 | AAAAAIAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAeAgACAAAAAAAAAAAAAAAB3gIAAgAAAAAAA
131 | AAAAAAAId4BwgIAAgAAAAAAAAAAACH+ICICAAIAAAAAAAAAAAHj3eIiAcICAAIAAAAAAAIh4d3d4iAiA
132 | gACAAAAAAAeIeHd3d3iIgHCAgACAAAh3iHeHd3d3eIgIgIAAgAAId/iId3d3d3d4iIBwgIAACH93d3d3
133 | d3d3d3iICICAAAj3d3d3d3d3d3d3eIiAcAAId3d3d3d3d3d3d3d4iAgAAIh3d3d3d3d3d3d3d3iIAAAA
134 | iHd3d3d3d3d3d3d3eAAAAACId3d3d3d3d3d3d3AAAAAAAIh3d3d3d3d3d3cAAAAAAAAAiHd3d3d3d3dw
135 | AAAAAAAAAACId3d3d3d3AAAAAAAAAAAAAIh3d3d3cAAAAAAAAAAAAAAAiHd3dwAAAAAAAAAAAAAAAACI
136 | d3AAAAAAAAAAAAAAAAAAAIgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
137 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//
138 | ////9////+P///+Df///Aj///gA3//4AI//8AAN/8AACP+AAADfAAAAjgAAAA4AAAAOAAAABgAAAAYAA
139 | AAHAAAAB4AAAAfwAAAP+AAAH/8AAD//gAB///AA///4Af///wP///+H/////////////////////////
140 | ////////KAAAABAAAAAgAAAAAQAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAIAAAACA
141 | gACAAAAAgACAAICAAADAwMAAgICAAAAA/wAA/wAAAP//AP8AAAD/AP8A//8AAP///wAAAAAAAAAAAAAA
142 | CAAAAAAAAABweAAAAAAACPiAeAAAAACPd4iAeAAAB/d3d4iAeACPd3d3d4iAcAh3d3d3d4iAAAh3d3d3
143 | d4AAAAh3d3d3AAAAAAh3d3AAAAAAAAh3AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAEA9+AAAAAAAQAA/gAAAAADAAD/AAAAAAcAAP+A
170 | AAAADwAA//gAAAAf7O3//AAAAD8A7//+AAAAf+wA///gAAD/AAD///AAAf8AAP//+AAD/wAA////gAf/
171 | 7ez////AD/8A9////+Af//cA/////D//AAD///////8AAP///////wAA////////c3P///////8A9///
172 | //////cA////////AAD///////8AACgAAAAgAAAAQAAAAAEACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
173 | AAAAAAAAAACAAACAAAAAgIAAgAAAAIAAgACAgAAAwMDAAMDcwADwyqYABAQEAAgICAAMDAwAERERABYW
174 | FgAcHBwAIiIiACkpKQBVVVUATU1NAEJCQgA5OTkAgHz/AFBQ/wCTANYA/+zMAMbW7wDW5+cAkKmtAAAA
175 | MwAAAGYAAACZAAAAzAAAMwAAADMzAAAzZgAAM5kAADPMAAAz/wAAZgAAAGYzAABmZgAAZpkAAGbMAABm
176 | /wAAmQAAAJkzAACZZgAAmZkAAJnMAACZ/wAAzAAAAMwzAADMZgAAzJkAAMzMAADM/wAA/2YAAP+ZAAD/
177 | zAAzAAAAMwAzADMAZgAzAJkAMwDMADMA/wAzMwAAMzMzADMzZgAzM5kAMzPMADMz/wAzZgAAM2YzADNm
178 | ZgAzZpkAM2bMADNm/wAzmQAAM5kzADOZZgAzmZkAM5nMADOZ/wAzzAAAM8wzADPMZgAzzJkAM8zMADPM
179 | /wAz/zMAM/9mADP/mQAz/8wAM///AGYAAABmADMAZgBmAGYAmQBmAMwAZgD/AGYzAABmMzMAZjNmAGYz
180 | mQBmM8wAZjP/AGZmAABmZjMAZmZmAGZmmQBmZswAZpkAAGaZMwBmmWYAZpmZAGaZzABmmf8AZswAAGbM
181 | MwBmzJkAZszMAGbM/wBm/wAAZv8zAGb/mQBm/8wAzAD/AP8AzACZmQAAmTOZAJkAmQCZAMwAmQAAAJkz
182 | MwCZAGYAmTPMAJkA/wCZZgAAmWYzAJkzZgCZZpkAmWbMAJkz/wCZmTMAmZlmAJmZmQCZmcw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fAAAAjgAAAA4AA
208 | AAOAAAABgAAAAYAAAAHAAAAB4AAAAfwAAAP+AAAH/8AAD//gAB///AA///4Af///wP///+H/////////
209 | ////////////////////////KAAAADAAAABgAAAAAQAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
210 | AAAAAIAAAIAAAACAgACAAAAAgACAAICAAADAwMAAwNzAAPDKpgAEBAQACAgIAAwMDAAREREAFhYWABwc
211 | HAAiIiIAKSkpAFVVVQBNTU0AQkJCADk5OQCAfP8AUFD/AJMA1gD/7MwAxtbvANbn5wCQqa0AAAAzAAAA
212 | ZgAAAJkAAADMAAAzAAAAMzMAADNmAAAzmQAAM8wAADP/AABmAAAAZjMAAGZmAABmmQAAZswAAGb/AACZ
213 | AAAAmTMAAJlmAACZmQAAmcwAAJn/AADMAAAAzDMAAMxmAADMmQAAzMwAAMz/AAD/ZgAA/5kAAP/MADMA
214 | AAAzADMAMwBmADMAmQAzAMwAMwD/ADMzAAAzMzMAMzNmADMzmQAzM8wAMzP/ADNmAAAzZjMAM2ZmADNm
215 | mQAzZswAM2b/ADOZAAAzmTMAM5lmADOZmQAzmcwAM5n/ADPMAAAzzDMAM8xmADPMmQAzzMwAM8z/ADP/
216 | MwAz/2YAM/+ZADP/zAAz//8AZgAAAGYAMwBmAGYAZgCZAGYAzABmAP8AZjMAAGYzMwBmM2YAZjOZAGYz
217 | zABmM/8AZmYAAGZmMwBmZmYAZmaZAGZmzABmmQAAZpkzAGaZZgBmmZkAZpnMAGaZ/wBmzAAAZswzAGbM
218 | mQBmzMwAZsz/AGb/AABm/zMAZv+ZAGb/zADMAP8A/wDMAJmZAACZM5kAmQCZAJkAzACZAAAAmTMzAJkA
219 | ZgCZM8wAmQD/AJlmAACZZjMAmTNmAJlmmQCZZswAmTP/AJmZMwCZmWYAmZmZAJmZzACZmf8AmcwAAJnM
220 | MwBmzGYAmcyZAJnMzACZzP8Amf8AAJn/MwCZzGYAmf+ZAJn/zACZ//8AzAAAAJkAMwDM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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOzs9/f3AAAAAAAAAAAAAAAA
259 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs7OwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
260 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
261 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
262 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
263 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
264 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
265 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////+ZAP////////8A//+f////MwD//w////+ZAP/8
266 | D/////8A//gOf///ZgD/8Aw////MAP/gAD///2YA/8AAOf//ZgD/wAAw//9mAP+AAAD//18A/wAAAOf/
267 | hgD8AAAAw//LAPgAAAAD/9cA8AAAAAOf4wDgAAAAAw/xAMAAAAAAD/8AAAAAAAAPgAAAAAAAAA8AAAAA
268 | AAAAAwAAAAAAAAABAAAAAAAAAAH//wAAAAAAAf//AAAAAAAB//8AAAAAAAH//4AAAAAAAf//wAAAAAAB
269 | ///gAAAAAAH///4AAAAAA////wAAAAAH////gAAAAA/////4AAAAH/////wAAAA//////gAAAH//////
270 | 4AAA///////wAAH///////gAA////////4AH////////wA/////////gH/////////w/////////////
271 | //////////////////////////////////////////////////////////////////8oAAAAEAAAACAA
272 | AAABAAgAA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zDMAzMxmAMzM
285 | mQDMzMwAzMz/AMz/AADM/zMAmf9mAMz/mQDM/8wAzP//AMwAMwD/AGYA/wCZAMwzAAD/MzMA/zNmAP8z
286 | mQD/M8wA/zP/AP9mAAD/ZjMAzGZmAP9mmQD/ZswAzGb/AP+ZAAD/mTMA/5lmAP+ZmQD/mcwA/5n/AP/M
287 | AAD/zDMA/8xmAP/MmQD/zMwA/8z/AP//MwDM/2YA//+ZAP//zABmZv8AZv9mAGb//wD/ZmYA/2b/AP//
288 | ZgAhAKUAX19fAHd3dwCGhoYAlpaWAMvLywCysrIA19fXAN3d3QDj4+MA6urqAPHx8QD4+PgA8Pv/AKSg
289 | oACAgIAAAAD/AAD/AAAA//8A/wAAAP8A/wD//wAA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAOwAAAAA
290 | AAAAAAAAAAAAAAcA8OwAAAAAAAAAAAAAAOz1c+wA8OwAAAAAAAAAAOz18Pfsc+wA8OwAAAAAAAfs7PC8
291 | vO/sc+wA8OwAAOz18PC8vLwHBwfsc+wA8AAA7HPwvLy8BwcH7+/sc+wAAAAA7HO8Bwfv7+/v7/fsAAAA
292 | AAAA7HMHB+/v7+/3AAAAAAAAAAAA7HPv7+/3AAAAAAAAAAAAAAAA7HP3AAAAAAAAAAAAAAAAAAAAAAAA
293 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD9/wAA8X8AAOBf
294 | AADAFwAAgAUAAAABAAAAAAAAgAAAAMAAAADwAQAA/AMAAP8HAAD/zwAA//8AAP//AAD//+wA
295 |
296 |
297 |
--------------------------------------------------------------------------------