Skip to content

Commit

Permalink
Merge remote-tracking branch 'microsoft/master' into pybadge_lc
Browse files Browse the repository at this point in the history
  • Loading branch information
dhalbert committed May 17, 2019
2 parents e1d727f + fe9b8b4 commit 572caca
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ run: burn wait logs
# This currently only works on macOS with a BMP debugger attached.
# It's meant to flash the bootloader in a loop.
BMP = $(shell ls -1 /dev/cu.usbmodem* | head -1)
BMP_ARGS = --nx -ex "set mem inaccessible-by-default off" -ex "set confirm off" -ex "target extended-remote $(BMP)" -ex "mon swdp_scan" -ex "attach 1"
BMP_ARGS = --nx -ex "set mem inaccessible-by-default off" -ex "set confirm off" -ex "target extended-remote $(BMP)" -ex "mon tpwr enable" -ex "mon swdp_scan" -ex "attach 1"
GDB = arm-none-eabi-gdb

bmp-flash: $(BUILD_PATH)/$(NAME).bin
Expand Down
5 changes: 2 additions & 3 deletions scripts/dbgtool.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ function main() {
if (process.platform == "win32")
openocdBin += ".exe"

let zeroCfg = pkgDir + "hardware/samd/1.6.17/variants/arduino_zero/openocd_scripts/arduino_zero.cfg"

let cmd = `telnet_port disabled; init; halt; `
if (mode == "map")
cmd += `set M(0) 0; mem2array M 8 ${addr} ${logSize}; resume; parray M; shutdown`
Expand All @@ -81,7 +79,8 @@ function main() {

let args = ["-d2",
"-s", openocdPath + "/share/openocd/scripts/",
"-f", zeroCfg,
"-f", "interface/cmsis-dap.cfg",
"-f", "target/at91samdXX.cfg",
"-c", cmd]

if (mode == "server") {
Expand Down
2 changes: 2 additions & 0 deletions src/selfmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ int main(void) {
const uint8_t *ptr = bootloader;
int i;

#ifdef SAMD21
for (i = 0; i < BOOTLOADER_K; ++i) {
int crc = 0;
for (int j = 0; j < 1024; ++j) {
Expand All @@ -151,6 +152,7 @@ int main(void) {
panic(1);
}
}
#endif

for (i = 0; i < BOOTLOADER_K * 1024; i += FLASH_ROW_SIZE) {
memcpy(pageBuf, &bootloader[i], FLASH_ROW_SIZE);
Expand Down

0 comments on commit 572caca

Please sign in to comment.