Compare commits

...

7 commits

Author SHA1 Message Date
Michał Moskal
89839723d8
Merge pull request #22 from arturo182/master
Add the MIMXRT10XX family
2020-01-05 13:34:06 +01:00
arturo182
84da66ce62 Add the MIMXRT10XX family 2020-01-05 13:15:38 +01:00
Michał Moskal
b23250077a
Merge pull request #21 from ElectronicCats/saml21
New family saml21
2019-11-11 16:04:55 -08:00
sabas1080
2a8c0e4984 new family saml21 2019-11-11 17:29:57 -06:00
Michal Moskal
5ec3ddbd28 Add -D option; python3 fixes
Also don't MSD-deploy bin files
2019-10-08 16:47:49 -07:00
Michal Moskal
df9920a8e9 Update configkeys.h 2019-09-25 14:07:18 +02:00
Peli de Halleux
a307533182
Merge pull request #20 from microsoft/configupdate
add a few more keys to patcher
2019-09-12 11:13:25 -07:00
3 changed files with 19 additions and 3 deletions

View file

@ -105,6 +105,7 @@ This procedure was unfortunately not used for the SAMD51 and NRF52840 below.
#### Family list
* Microchip (Atmel) SAMD21 - 0x68ed2b88
* Microchip (Atmel) SAML21 - 0x1851780a
* Microchip (Atmel) SAMD51 - 0x55114460
* Nordic NRF52840 - 0xada52840
* ST STM32F103 - 0x5ee21072
@ -114,6 +115,7 @@ This procedure was unfortunately not used for the SAMD51 and NRF52840 below.
* Microchip (Atmel) ATmega32 - 0x16573617
* Cypress FX2 - 0x5a18069b
* ESP32 - 0x1c5f21b0
* NXP i.MX RT10XX - 0x4fb2d5bd
### Rationale

View file

@ -114,6 +114,10 @@ const CONFIG_KEYS_H =
#define CFG_PIN_WIFI_BUSY 88
#define CFG_PIN_WIFI_RESET 89
#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
#define ACCELEROMETER_TYPE_LIS3DH 0x32
@ -348,6 +352,7 @@ const enums = {
},
UF2_FAMILY: {
ATSAMD21: 0x68ed2b88,
ATSAML21: 0x1851780a,
ATSAMD51: 0x55114460,
NRF52840: 0x1b57745f,
STM32F103: 0x5ee21072,

15
utils/uf2conv.py Executable file → Normal file
View file

@ -14,11 +14,13 @@ UF2_MAGIC_END = 0x0AB16F30 # Ditto
families = {
'SAMD21': 0x68ed2b88,
'SAML21': 0x1851780a,
'SAMD51': 0x55114460,
'NRF52': 0x1b57745f,
'STM32F1': 0x5ee21072,
'STM32F4': 0x57755a57,
'ATMEGA32': 0x16573617,
'MIMXRT10XX': 0x4FB2D5BD
}
INFO_FILE = "/INFO_UF2.TXT"
@ -167,13 +169,16 @@ def convert_from_hex_to_uf2(buf):
resfile += blocks[i].encode(i, numblocks)
return resfile
def to_str(b):
return b.decode("utf-8")
def get_drives():
drives = []
if sys.platform == "win32":
r = subprocess.check_output(["wmic", "PATH", "Win32_LogicalDisk",
"get", "DeviceID,", "VolumeName,",
"FileSystem,", "DriveType"])
for line in r.split('\n'):
for line in to_str(r).split('\n'):
words = re.split('\s+', line)
if len(words) >= 3 and words[1] == "2" and words[2] == "FAT":
drives.append(words[0])
@ -234,6 +239,8 @@ def main():
help='list connected devices')
parser.add_argument('-c' , '--convert', action='store_true',
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,
default="0x0",
help='specify familyID - number or name (default: 0x0)')
@ -259,7 +266,9 @@ def main():
inpbuf = f.read()
from_uf2 = is_uf2(inpbuf)
ext = "uf2"
if from_uf2:
if args.deploy:
outbuf = inpbuf
elif from_uf2:
outbuf = convert_from_uf2(inpbuf)
ext = "bin"
elif is_hex(inpbuf):
@ -271,7 +280,7 @@ def main():
outbuf = convert_to_uf2(inpbuf)
print("Converting to %s, output size: %d, start address: 0x%x" %
(ext, len(outbuf), appstartaddr))
if args.convert:
if args.convert or ext != "uf2":
drives = []
if args.output == None:
args.output = "flash." + ext