Skip to content

Commit

Permalink
[M032] "Connect to Target Chip" did not work.
Browse files Browse the repository at this point in the history
  • Loading branch information
CMWU authored and CMWU committed Jul 22, 2024
1 parent 8c84869 commit c3ebb1d
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 24 deletions.
8 changes: 5 additions & 3 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,11 @@ const getBaseAddress = async (proecssorType) => {
case PROCESSOR_TYPE_ARM_CM0:
baseAddr = 0x50000000;
try {
if (processor.readMem32(0x40003FFC).toString(16) == '20171011') {
baseAddr = 0x40000000;
}
await processor.readMem32(0x40003FFC).then(function (result) {
if ((result).toString(16) == '20171011') {
baseAddr = 0x40000000;
}
});
}
catch (error) {
}
Expand Down
51 changes: 30 additions & 21 deletions src/worker/webusb.worker-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -2620,45 +2620,54 @@ var getBaseAddress = /*#__PURE__*/function () {
while (1) switch (_context6.prev = _context6.next) {
case 0:
_context6.t0 = proecssorType;
_context6.next = _context6.t0 === PROCESSOR_TYPE_ARM_CM0 ? 3 : _context6.t0 === PROCESSOR_TYPE_ARM_CM4 ? 6 : _context6.t0 === PROCESSOR_TYPE_ARM_CM23 ? 8 : 17;
_context6.next = _context6.t0 === PROCESSOR_TYPE_ARM_CM0 ? 3 : _context6.t0 === PROCESSOR_TYPE_ARM_CM4 ? 12 : _context6.t0 === PROCESSOR_TYPE_ARM_CM23 ? 14 : 23;
break;
case 3:
baseAddr = 0x50000000;
try {
if (processor.readMem32(0x40003FFC).toString(16) == '20171011') {
_context6.prev = 4;
_context6.next = 7;
return processor.readMem32(0x40003FFC).then(function (result) {
if (result.toString(16) == '20171011') {
baseAddr = 0x40000000;
}
} catch (error) {}
return _context6.abrupt("break", 18);
case 6:
});
case 7:
_context6.next = 11;
break;
case 9:
_context6.prev = 9;
_context6.t1 = _context6["catch"](4);
case 11:
return _context6.abrupt("break", 24);
case 12:
baseAddr = 0x40000000;
return _context6.abrupt("break", 18);
case 8:
return _context6.abrupt("break", 24);
case 14:
baseAddr = 0x40000000;
_context6.prev = 9;
_context6.next = 12;
_context6.prev = 15;
_context6.next = 18;
return processor.readMem32(0x50003FFC).then(function (result) {
if (result.toString(16) == '20201130') {
baseAddr = 0x50000000;
}
});
case 12:
_context6.next = 16;
case 18:
_context6.next = 22;
break;
case 14:
_context6.prev = 14;
_context6.t1 = _context6["catch"](9);
case 16:
return _context6.abrupt("break", 18);
case 17:
case 20:
_context6.prev = 20;
_context6.t2 = _context6["catch"](15);
case 22:
return _context6.abrupt("break", 24);
case 23:
throw 'getBaseAddress() Unsupported processor type!';
case 18:
case 24:
return _context6.abrupt("return", baseAddr);
case 19:
case 25:
case "end":
return _context6.stop();
}
}, _callee6, null, [[9, 14]]);
}, _callee6, null, [[4, 9], [15, 20]]);
}));
return function getBaseAddress(_x) {
return _ref6.apply(this, arguments);
Expand Down

0 comments on commit c3ebb1d

Please sign in to comment.