Compare commits
7 commits
configupda
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
89839723d8 | ||
|
|
84da66ce62 | ||
|
|
b23250077a | ||
|
|
2a8c0e4984 | ||
|
|
5ec3ddbd28 | ||
|
|
df9920a8e9 | ||
|
|
a307533182 |
3 changed files with 19 additions and 3 deletions
|
|
@ -105,6 +105,7 @@ This procedure was unfortunately not used for the SAMD51 and NRF52840 below.
|
||||||
#### Family list
|
#### Family list
|
||||||
|
|
||||||
* Microchip (Atmel) SAMD21 - 0x68ed2b88
|
* Microchip (Atmel) SAMD21 - 0x68ed2b88
|
||||||
|
* Microchip (Atmel) SAML21 - 0x1851780a
|
||||||
* Microchip (Atmel) SAMD51 - 0x55114460
|
* Microchip (Atmel) SAMD51 - 0x55114460
|
||||||
* Nordic NRF52840 - 0xada52840
|
* Nordic NRF52840 - 0xada52840
|
||||||
* ST STM32F103 - 0x5ee21072
|
* ST STM32F103 - 0x5ee21072
|
||||||
|
|
@ -114,6 +115,7 @@ This procedure was unfortunately not used for the SAMD51 and NRF52840 below.
|
||||||
* Microchip (Atmel) ATmega32 - 0x16573617
|
* Microchip (Atmel) ATmega32 - 0x16573617
|
||||||
* Cypress FX2 - 0x5a18069b
|
* Cypress FX2 - 0x5a18069b
|
||||||
* ESP32 - 0x1c5f21b0
|
* ESP32 - 0x1c5f21b0
|
||||||
|
* NXP i.MX RT10XX - 0x4fb2d5bd
|
||||||
|
|
||||||
### Rationale
|
### Rationale
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -114,6 +114,10 @@ const CONFIG_KEYS_H =
|
||||||
#define CFG_PIN_WIFI_BUSY 88
|
#define CFG_PIN_WIFI_BUSY 88
|
||||||
#define CFG_PIN_WIFI_RESET 89
|
#define CFG_PIN_WIFI_RESET 89
|
||||||
#define CFG_PIN_WIFI_GPIO0 90
|
#define CFG_PIN_WIFI_GPIO0 90
|
||||||
|
#define CFG_PIN_WIFI_AT_TX 91
|
||||||
|
#define CFG_PIN_WIFI_AT_RX 92
|
||||||
|
|
||||||
|
#define CFG_PIN_USB_POWER 93
|
||||||
|
|
||||||
// default I2C address
|
// default I2C address
|
||||||
#define ACCELEROMETER_TYPE_LIS3DH 0x32
|
#define ACCELEROMETER_TYPE_LIS3DH 0x32
|
||||||
|
|
@ -348,6 +352,7 @@ const enums = {
|
||||||
},
|
},
|
||||||
UF2_FAMILY: {
|
UF2_FAMILY: {
|
||||||
ATSAMD21: 0x68ed2b88,
|
ATSAMD21: 0x68ed2b88,
|
||||||
|
ATSAML21: 0x1851780a,
|
||||||
ATSAMD51: 0x55114460,
|
ATSAMD51: 0x55114460,
|
||||||
NRF52840: 0x1b57745f,
|
NRF52840: 0x1b57745f,
|
||||||
STM32F103: 0x5ee21072,
|
STM32F103: 0x5ee21072,
|
||||||
|
|
|
||||||
15
utils/uf2conv.py
Executable file → Normal file
15
utils/uf2conv.py
Executable file → Normal file
|
|
@ -14,11 +14,13 @@ UF2_MAGIC_END = 0x0AB16F30 # Ditto
|
||||||
|
|
||||||
families = {
|
families = {
|
||||||
'SAMD21': 0x68ed2b88,
|
'SAMD21': 0x68ed2b88,
|
||||||
|
'SAML21': 0x1851780a,
|
||||||
'SAMD51': 0x55114460,
|
'SAMD51': 0x55114460,
|
||||||
'NRF52': 0x1b57745f,
|
'NRF52': 0x1b57745f,
|
||||||
'STM32F1': 0x5ee21072,
|
'STM32F1': 0x5ee21072,
|
||||||
'STM32F4': 0x57755a57,
|
'STM32F4': 0x57755a57,
|
||||||
'ATMEGA32': 0x16573617,
|
'ATMEGA32': 0x16573617,
|
||||||
|
'MIMXRT10XX': 0x4FB2D5BD
|
||||||
}
|
}
|
||||||
|
|
||||||
INFO_FILE = "/INFO_UF2.TXT"
|
INFO_FILE = "/INFO_UF2.TXT"
|
||||||
|
|
@ -167,13 +169,16 @@ def convert_from_hex_to_uf2(buf):
|
||||||
resfile += blocks[i].encode(i, numblocks)
|
resfile += blocks[i].encode(i, numblocks)
|
||||||
return resfile
|
return resfile
|
||||||
|
|
||||||
|
def to_str(b):
|
||||||
|
return b.decode("utf-8")
|
||||||
|
|
||||||
def get_drives():
|
def get_drives():
|
||||||
drives = []
|
drives = []
|
||||||
if sys.platform == "win32":
|
if sys.platform == "win32":
|
||||||
r = subprocess.check_output(["wmic", "PATH", "Win32_LogicalDisk",
|
r = subprocess.check_output(["wmic", "PATH", "Win32_LogicalDisk",
|
||||||
"get", "DeviceID,", "VolumeName,",
|
"get", "DeviceID,", "VolumeName,",
|
||||||
"FileSystem,", "DriveType"])
|
"FileSystem,", "DriveType"])
|
||||||
for line in r.split('\n'):
|
for line in to_str(r).split('\n'):
|
||||||
words = re.split('\s+', line)
|
words = re.split('\s+', line)
|
||||||
if len(words) >= 3 and words[1] == "2" and words[2] == "FAT":
|
if len(words) >= 3 and words[1] == "2" and words[2] == "FAT":
|
||||||
drives.append(words[0])
|
drives.append(words[0])
|
||||||
|
|
@ -234,6 +239,8 @@ def main():
|
||||||
help='list connected devices')
|
help='list connected devices')
|
||||||
parser.add_argument('-c' , '--convert', action='store_true',
|
parser.add_argument('-c' , '--convert', action='store_true',
|
||||||
help='do not flash, just convert')
|
help='do not flash, just convert')
|
||||||
|
parser.add_argument('-D' , '--deploy', action='store_true',
|
||||||
|
help='just flash, do not convert')
|
||||||
parser.add_argument('-f' , '--family', dest='family', type=str,
|
parser.add_argument('-f' , '--family', dest='family', type=str,
|
||||||
default="0x0",
|
default="0x0",
|
||||||
help='specify familyID - number or name (default: 0x0)')
|
help='specify familyID - number or name (default: 0x0)')
|
||||||
|
|
@ -259,7 +266,9 @@ def main():
|
||||||
inpbuf = f.read()
|
inpbuf = f.read()
|
||||||
from_uf2 = is_uf2(inpbuf)
|
from_uf2 = is_uf2(inpbuf)
|
||||||
ext = "uf2"
|
ext = "uf2"
|
||||||
if from_uf2:
|
if args.deploy:
|
||||||
|
outbuf = inpbuf
|
||||||
|
elif from_uf2:
|
||||||
outbuf = convert_from_uf2(inpbuf)
|
outbuf = convert_from_uf2(inpbuf)
|
||||||
ext = "bin"
|
ext = "bin"
|
||||||
elif is_hex(inpbuf):
|
elif is_hex(inpbuf):
|
||||||
|
|
@ -271,7 +280,7 @@ def main():
|
||||||
outbuf = convert_to_uf2(inpbuf)
|
outbuf = convert_to_uf2(inpbuf)
|
||||||
print("Converting to %s, output size: %d, start address: 0x%x" %
|
print("Converting to %s, output size: %d, start address: 0x%x" %
|
||||||
(ext, len(outbuf), appstartaddr))
|
(ext, len(outbuf), appstartaddr))
|
||||||
if args.convert:
|
if args.convert or ext != "uf2":
|
||||||
drives = []
|
drives = []
|
||||||
if args.output == None:
|
if args.output == None:
|
||||||
args.output = "flash." + ext
|
args.output = "flash." + ext
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue