X-Git-Url: https://robinkrens.nl/gitweb/?a=blobdiff_plain;f=src%2FRAFlasher.py;fp=src%2FRAFlasher.py;h=0e5659bc1519ce2633323ca683faa7bcb524d690;hb=dd0b210e12a5ee5b62437eff857b8ea1573493c7;hp=f9eab39eaf05da8eaea199f57e0fe2e873da9361;hpb=7eac14b814d91e6a717b92e7a99ad69788b15cc0;p=renesas-ra-flasher diff --git a/src/RAFlasher.py b/src/RAFlasher.py index f9eab39..0e5659b 100644 --- a/src/RAFlasher.py +++ b/src/RAFlasher.py @@ -26,38 +26,33 @@ def inquire_connection(dev): def get_area_info(dev): for i in [0,1,2]: - print("===================") packed = pack_pkt(ARE_CMD, [str(i)]) dev.send_data(packed) info = dev.recv_data(23) msg = unpack_pkt(info) fmt = '>BIIII' KOA, SAD, EAD, EAU, WAU = struct.unpack(fmt, bytes(int(x, 16) for x in msg)) - print(f'Area {KOA} - {hex(SAD)}:{hex(EAD)}') - print(f'Erase {hex(EAU)} bytes - write {hex(WAU)} bytes') + print(f'Area {KOA}: {hex(SAD)}:{hex(EAD)} (erase {hex(EAU)} - write {hex(WAU)})') def get_dev_info(dev): - packed = pack_pkt(SIG_CMD, "") dev.send_data(packed) info = dev.recv_data(18) fmt = '>IIIBBHH' _HEADER, SCI, RMB, NOA, TYP, BFV, _FOOTER = struct.unpack(fmt, info) - print('Chip info:') print('====================') - print(f'Serial interface speed: {SCI} Hz') - print(f'Recommend max UART baud rate {RMB} bps') - print(f'User area in Code flash [{NOA & 0x1}|{NOA & 0x02 >> 1}]') - print(f'User area in Data flash [{NOA & 0x03 >> 2}]') - print(f'Config area [{NOA & 0x04 >> 3}]') if TYP == 0x02: - print('RA MCU + RA2/RA4 Series') + print('Chip: RA MCU + RA2/RA4 Series') elif TYP == 0x03: - print('RA MCU + RA6 Series') + print('Chip: RA MCU + RA6 Series') else: print('Unknown MCU type') - print(f'Boot firmware version {BFV >> 8}.{BFV & 0xFF}') - print('====================') + print(f'Serial interface speed: {SCI} Hz') + print(f'Recommend max UART baud rate: {RMB} bps') + print(f'User area in Code flash [{NOA & 0x1}|{NOA & 0x02 >> 1}]') + print(f'User area in Data flash [{NOA & 0x03 >> 2}]') + print(f'Config area [{NOA & 0x04 >> 3}]') + print(f'Boot firmware: version {BFV >> 8}.{BFV & 0xFF}') def verify_img(dev, img, start_addr, end_addr):