megaupdi 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- megaupdi-1.0.0/LICENSE +21 -0
- megaupdi-1.0.0/PKG-INFO +123 -0
- megaupdi-1.0.0/README.md +79 -0
- megaupdi-1.0.0/megaupdi/megaupdi.py +1064 -0
- megaupdi-1.0.0/megaupdi.egg-info/PKG-INFO +123 -0
- megaupdi-1.0.0/megaupdi.egg-info/SOURCES.txt +10 -0
- megaupdi-1.0.0/megaupdi.egg-info/dependency_links.txt +1 -0
- megaupdi-1.0.0/megaupdi.egg-info/entry_points.txt +2 -0
- megaupdi-1.0.0/megaupdi.egg-info/requires.txt +1 -0
- megaupdi-1.0.0/megaupdi.egg-info/top_level.txt +1 -0
- megaupdi-1.0.0/pyproject.toml +35 -0
- megaupdi-1.0.0/setup.cfg +4 -0
megaupdi-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Stefan Wagner
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
megaupdi-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: megaupdi
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Simple SerialUPDI Programming Tool for all AVR Microcontrollers with UPDI
|
|
5
|
+
Author-email: Stefan Wagner <wagiminator@web.de>
|
|
6
|
+
Maintainer-email: Stefan Wagner <wagiminator@web.de>
|
|
7
|
+
License: MIT License
|
|
8
|
+
|
|
9
|
+
Copyright (c) 2026 Stefan Wagner
|
|
10
|
+
|
|
11
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
13
|
+
in the Software without restriction, including without limitation the rights
|
|
14
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
16
|
+
furnished to do so, subject to the following conditions:
|
|
17
|
+
|
|
18
|
+
The above copyright notice and this permission notice shall be included in all
|
|
19
|
+
copies or substantial portions of the Software.
|
|
20
|
+
|
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
+
SOFTWARE.
|
|
28
|
+
|
|
29
|
+
Project-URL: Homepage, https://wagiminator.github.io/
|
|
30
|
+
Project-URL: Repository, https://github.com/wagiminator/MCU-Flash-Tools
|
|
31
|
+
Project-URL: Issues, https://github.com/wagiminator/MCU-Flash-Tools/issues
|
|
32
|
+
Keywords: AVR,Microchip,ATtiny,tinyAVR,ATmega,megaAVR,AVR-DA,AVR-DB,AVR-DD,AVR-DU,AVR-EA,AVR-EB,UPDI,SerialUPDI,microcontroller
|
|
33
|
+
Classifier: Development Status :: 4 - Beta
|
|
34
|
+
Classifier: Programming Language :: Python :: 3
|
|
35
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
36
|
+
Classifier: Operating System :: OS Independent
|
|
37
|
+
Classifier: Intended Audience :: Developers
|
|
38
|
+
Classifier: Topic :: Software Development :: Embedded Systems
|
|
39
|
+
Requires-Python: >=3.8
|
|
40
|
+
Description-Content-Type: text/markdown
|
|
41
|
+
License-File: LICENSE
|
|
42
|
+
Requires-Dist: pyserial
|
|
43
|
+
Dynamic: license-file
|
|
44
|
+
|
|
45
|
+
# Simple SerialUPDI Programming Tool for all AVR Microcontrollers with UPDI
|
|
46
|
+
## Description
|
|
47
|
+
megaUPDI allows all AVR microcontrollers with UPDI programming interface (tinyAVR 0/1/2, megaAVR 0, AVR DA/DB/DD/DU/EA/EB/EC/LA/SD) to be programmed using a USB-to-serial converter connected in a special way to the UPDI pin (also called SerialUPDI). More information can be found [here](https://github.com/SpenceKonde/AVR-Guidance/blob/master/UPDI/jtag2updi.md). megaUPDI is the big brother of [TinyUPDI](https://pypi.org/project/tinyupdi/): the NVM controller variant (P:0, P:2 ... P:6) is read from the System Information Block (SIB) of the target, the device is identified by its signature.
|
|
48
|
+
|
|
49
|
+
Supported microcontrollers (133 devices):
|
|
50
|
+
- tinyAVR 0-series: ATtiny202, 204, 402, 404, 406, 804, 806, 807, 1604, 1606, 1607
|
|
51
|
+
- tinyAVR 1-series: ATtiny212, 214, 412, 414, 416, 416auto, 417, 814, 816, 817, 1614, 1616, 1617, 3216, 3217
|
|
52
|
+
- tinyAVR 2-series: ATtiny424, 426, 427, 824, 826, 827, 1624, 1626, 1627, 3224, 3226, 3227
|
|
53
|
+
- megaAVR 0-series: ATmega808, 809, 1608, 1609, 3208, 3209, 4808, 4809
|
|
54
|
+
- AVR DA: AVR32DA28/32/48, AVR64DA28/32/48/64, AVR128DA28/32/48/64 (also DA-S variants, e.g. AVR128DA28S)
|
|
55
|
+
- AVR DB: AVR32DB28/32/48, AVR64DB28/32/48/64, AVR128DB28/32/48/64
|
|
56
|
+
- AVR DD: AVR16DD14/20/28/32, AVR32DD14/20/28/32, AVR64DD14/20/28/32
|
|
57
|
+
- AVR DU: AVR16DU14/20/28/32, AVR32DU14/20/28/32, AVR64DU28/32
|
|
58
|
+
- AVR EA: AVR8EA28/32, AVR16EA28/32/48, AVR32EA28/32/48, AVR64EA28/32/48
|
|
59
|
+
- AVR EB: AVR16EB14/20/28/32, AVR32EB14/20/28/32
|
|
60
|
+
- AVR EC: AVR64EC28/48
|
|
61
|
+
- AVR LA: AVR16LA14/20/28/32, AVR32LA14/20/28/32
|
|
62
|
+
- AVR SD: AVR32SD20/28/32
|
|
63
|
+
|
|
64
|
+
## Preparations
|
|
65
|
+
If necessary, a driver for the USB-to-serial converter used must be installed.
|
|
66
|
+
|
|
67
|
+
## Installation
|
|
68
|
+
Ensure that the [prerequisites](https://packaging.python.org/en/latest/tutorials/installing-packages/) for installing Python packages are met. Then execute the following command in the command line:
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
pip install megaupdi
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Usage
|
|
75
|
+
Connect the USB-to-serial converter via USB to the PC and via the circuit described below to the UPDI pin of the microcontroller.
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
USB2SERIAL AVR
|
|
79
|
+
+--------+ +-----------+
|
|
80
|
+
| RXD| <------------+---> |UPDI |
|
|
81
|
+
| | | | |
|
|
82
|
+
| TXD| ---|1kOhm|---+ | |
|
|
83
|
+
| | | |
|
|
84
|
+
| VDD| -----------------> |VDD |
|
|
85
|
+
| GND| -----------------> |GND |
|
|
86
|
+
+--------+ +-----------+
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Alternatively, a pre-assembled [SerialUPDI programmer](https://github.com/wagiminator/AVR-Programmer) can be used.
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
Usage: megaupdi [-h] [-p PORT] [-d DEVICE] [-e] [-f FLASH] [-fs [FUSES ...]] [-t TRIM] [-l]
|
|
93
|
+
|
|
94
|
+
Optional arguments:
|
|
95
|
+
-h, --help show help message and exit
|
|
96
|
+
-p PORT, --port PORT serial port (if not set, it will be auto-detected)
|
|
97
|
+
-d, --device set target device (if not set, it will be auto-detected)
|
|
98
|
+
-e, --erase perform a chip erase (implied with --flash)
|
|
99
|
+
-f FLASH, --flash FLASH BIN file to flash
|
|
100
|
+
-fs [FUSES ...], --fuses [FUSES ...]
|
|
101
|
+
fuses to set (syntax: fuse_nr:0xvalue)
|
|
102
|
+
-t TRIM, --trim TRIM configure oscillator for given frequency (set fuse 2)
|
|
103
|
+
-l, --list list supported devices
|
|
104
|
+
Examples:
|
|
105
|
+
megaupdi -f firmware.bin
|
|
106
|
+
megaupdi -d avr128da28 -f firmware.bin -fs 0:0x00 1:0x00
|
|
107
|
+
megaupdi -f firmware.bin -fs 6:0x04 7:0x00 8:0x00 -t 8000000
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Notes:
|
|
111
|
+
- Fuse numbers are relative to the first fuse (FUSE0). Valid numbers depend on the device family: tinyAVR/megaAVR 0: 0 - 10 (10 = LOCKBIT), AVR Dx/Ex/Lx/Sx: e.g. 0, 1, 2, 5, 6, 7, 8 (plus 10 on some families). Invalid fuse numbers are rejected before anything is erased or written.
|
|
112
|
+
- -t sets the oscillator fuse (16 or 20 MHz) on tinyAVR, megaAVR 0, AVR EA/EB and AVR LA. The system frequency must be reachable with the clock prescaler, which has to be set by the firmware.
|
|
113
|
+
- A locked device is only unlocked (by a chip erase) when -e or -f is given.
|
|
114
|
+
- Changing the pin configuration fuse can disable the UPDI pin (tinyAVR: fuse 5, AVR DD/DU/EA/EB/EC: fuse 5, AVR LA: fuse 3); the device can then only be programmed with a high-voltage programmer. megaUPDI prints a warning in this case.
|
|
115
|
+
- Only flash and fuses can be programmed. EEPROM, user row, boot row and the lock bits of the AVR Dx/Ex/Lx/Sx families are not supported.
|
|
116
|
+
|
|
117
|
+
## Links
|
|
118
|
+
- [MCU Flash Tools](https://github.com/wagiminator/MCU-Flash-Tools)
|
|
119
|
+
- [MCU Templates](https://github.com/wagiminator/MCU-Templates)
|
|
120
|
+
- [MCU Development Boards](https://github.com/wagiminator/Development-Boards)
|
|
121
|
+
- [AVR Development Boards](https://github.com/wagiminator/AVR-Development-Boards)
|
|
122
|
+
- [AVR Programmers](https://github.com/wagiminator/AVR-Programmer)
|
|
123
|
+
- [SAMD Development Boards](https://github.com/wagiminator/SAMD-Development-Boards)
|
megaupdi-1.0.0/README.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Simple SerialUPDI Programming Tool for all AVR Microcontrollers with UPDI
|
|
2
|
+
## Description
|
|
3
|
+
megaUPDI allows all AVR microcontrollers with UPDI programming interface (tinyAVR 0/1/2, megaAVR 0, AVR DA/DB/DD/DU/EA/EB/EC/LA/SD) to be programmed using a USB-to-serial converter connected in a special way to the UPDI pin (also called SerialUPDI). More information can be found [here](https://github.com/SpenceKonde/AVR-Guidance/blob/master/UPDI/jtag2updi.md). megaUPDI is the big brother of [TinyUPDI](https://pypi.org/project/tinyupdi/): the NVM controller variant (P:0, P:2 ... P:6) is read from the System Information Block (SIB) of the target, the device is identified by its signature.
|
|
4
|
+
|
|
5
|
+
Supported microcontrollers (133 devices):
|
|
6
|
+
- tinyAVR 0-series: ATtiny202, 204, 402, 404, 406, 804, 806, 807, 1604, 1606, 1607
|
|
7
|
+
- tinyAVR 1-series: ATtiny212, 214, 412, 414, 416, 416auto, 417, 814, 816, 817, 1614, 1616, 1617, 3216, 3217
|
|
8
|
+
- tinyAVR 2-series: ATtiny424, 426, 427, 824, 826, 827, 1624, 1626, 1627, 3224, 3226, 3227
|
|
9
|
+
- megaAVR 0-series: ATmega808, 809, 1608, 1609, 3208, 3209, 4808, 4809
|
|
10
|
+
- AVR DA: AVR32DA28/32/48, AVR64DA28/32/48/64, AVR128DA28/32/48/64 (also DA-S variants, e.g. AVR128DA28S)
|
|
11
|
+
- AVR DB: AVR32DB28/32/48, AVR64DB28/32/48/64, AVR128DB28/32/48/64
|
|
12
|
+
- AVR DD: AVR16DD14/20/28/32, AVR32DD14/20/28/32, AVR64DD14/20/28/32
|
|
13
|
+
- AVR DU: AVR16DU14/20/28/32, AVR32DU14/20/28/32, AVR64DU28/32
|
|
14
|
+
- AVR EA: AVR8EA28/32, AVR16EA28/32/48, AVR32EA28/32/48, AVR64EA28/32/48
|
|
15
|
+
- AVR EB: AVR16EB14/20/28/32, AVR32EB14/20/28/32
|
|
16
|
+
- AVR EC: AVR64EC28/48
|
|
17
|
+
- AVR LA: AVR16LA14/20/28/32, AVR32LA14/20/28/32
|
|
18
|
+
- AVR SD: AVR32SD20/28/32
|
|
19
|
+
|
|
20
|
+
## Preparations
|
|
21
|
+
If necessary, a driver for the USB-to-serial converter used must be installed.
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
Ensure that the [prerequisites](https://packaging.python.org/en/latest/tutorials/installing-packages/) for installing Python packages are met. Then execute the following command in the command line:
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
pip install megaupdi
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Usage
|
|
31
|
+
Connect the USB-to-serial converter via USB to the PC and via the circuit described below to the UPDI pin of the microcontroller.
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
USB2SERIAL AVR
|
|
35
|
+
+--------+ +-----------+
|
|
36
|
+
| RXD| <------------+---> |UPDI |
|
|
37
|
+
| | | | |
|
|
38
|
+
| TXD| ---|1kOhm|---+ | |
|
|
39
|
+
| | | |
|
|
40
|
+
| VDD| -----------------> |VDD |
|
|
41
|
+
| GND| -----------------> |GND |
|
|
42
|
+
+--------+ +-----------+
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Alternatively, a pre-assembled [SerialUPDI programmer](https://github.com/wagiminator/AVR-Programmer) can be used.
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
Usage: megaupdi [-h] [-p PORT] [-d DEVICE] [-e] [-f FLASH] [-fs [FUSES ...]] [-t TRIM] [-l]
|
|
49
|
+
|
|
50
|
+
Optional arguments:
|
|
51
|
+
-h, --help show help message and exit
|
|
52
|
+
-p PORT, --port PORT serial port (if not set, it will be auto-detected)
|
|
53
|
+
-d, --device set target device (if not set, it will be auto-detected)
|
|
54
|
+
-e, --erase perform a chip erase (implied with --flash)
|
|
55
|
+
-f FLASH, --flash FLASH BIN file to flash
|
|
56
|
+
-fs [FUSES ...], --fuses [FUSES ...]
|
|
57
|
+
fuses to set (syntax: fuse_nr:0xvalue)
|
|
58
|
+
-t TRIM, --trim TRIM configure oscillator for given frequency (set fuse 2)
|
|
59
|
+
-l, --list list supported devices
|
|
60
|
+
Examples:
|
|
61
|
+
megaupdi -f firmware.bin
|
|
62
|
+
megaupdi -d avr128da28 -f firmware.bin -fs 0:0x00 1:0x00
|
|
63
|
+
megaupdi -f firmware.bin -fs 6:0x04 7:0x00 8:0x00 -t 8000000
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Notes:
|
|
67
|
+
- Fuse numbers are relative to the first fuse (FUSE0). Valid numbers depend on the device family: tinyAVR/megaAVR 0: 0 - 10 (10 = LOCKBIT), AVR Dx/Ex/Lx/Sx: e.g. 0, 1, 2, 5, 6, 7, 8 (plus 10 on some families). Invalid fuse numbers are rejected before anything is erased or written.
|
|
68
|
+
- -t sets the oscillator fuse (16 or 20 MHz) on tinyAVR, megaAVR 0, AVR EA/EB and AVR LA. The system frequency must be reachable with the clock prescaler, which has to be set by the firmware.
|
|
69
|
+
- A locked device is only unlocked (by a chip erase) when -e or -f is given.
|
|
70
|
+
- Changing the pin configuration fuse can disable the UPDI pin (tinyAVR: fuse 5, AVR DD/DU/EA/EB/EC: fuse 5, AVR LA: fuse 3); the device can then only be programmed with a high-voltage programmer. megaUPDI prints a warning in this case.
|
|
71
|
+
- Only flash and fuses can be programmed. EEPROM, user row, boot row and the lock bits of the AVR Dx/Ex/Lx/Sx families are not supported.
|
|
72
|
+
|
|
73
|
+
## Links
|
|
74
|
+
- [MCU Flash Tools](https://github.com/wagiminator/MCU-Flash-Tools)
|
|
75
|
+
- [MCU Templates](https://github.com/wagiminator/MCU-Templates)
|
|
76
|
+
- [MCU Development Boards](https://github.com/wagiminator/Development-Boards)
|
|
77
|
+
- [AVR Development Boards](https://github.com/wagiminator/AVR-Development-Boards)
|
|
78
|
+
- [AVR Programmers](https://github.com/wagiminator/AVR-Programmer)
|
|
79
|
+
- [SAMD Development Boards](https://github.com/wagiminator/SAMD-Development-Boards)
|