Skip to content

Commit

Permalink
add define for skipping boot js
Browse files Browse the repository at this point in the history
to allow flashing an image built with that option, to recover from .boot0 containing bad stuff
  • Loading branch information
ssievert42 committed Jan 6, 2025
1 parent 2f6fd95 commit ba9eedb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions boards/XIAOBLE.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"DEFINES += -DBLUETOOTH_NAME_PREFIX='\"XIAOBLE\"'",
"DEFINES += -DSPIFLASH_READ2X", # Read SPI flash at 2x speed using MISO and MOSI for IO
"DEFINES += -DESPR_UNICODE_SUPPORT=1",
# "DEFINES += -DESPR_NO_BOOT_JS", # Skip boot js; allows recovering from .boot0 containing bad stuff
"DEFINES += -DNRF_SDH_BLE_GATT_MAX_MTU_SIZE=131", # 23+x*27 rule as per https://devzone.nordicsemi.com/f/nordic-q-a/44825/ios-mtu-size-why-only-185-bytes
# 'DEFINES += -DPIN_NAMES_DIRECT=1', # Package skips out some pins, so we can't assume each port starts from 0
"LDFLAGS += -Xlinker --defsym=LD_APP_RAM_BASE=0x2ec0", # set RAM base to match MTU
Expand Down
4 changes: 4 additions & 0 deletions src/jsflash.c
Original file line number Diff line number Diff line change
Expand Up @@ -1374,6 +1374,7 @@ JsVar *jsfGetBootCodeFromFlash(bool isReset) {

bool jsfLoadBootCodeFromFlash(bool isReset) {
// Load code in .bootFirst at first boot UNLESS BTN1 IS HELD DOWN (BTN3 for Dickens)
#ifndef ESPR_NO_BOOT_JS
#ifndef SAVE_ON_FLASH
#if defined(BANGLEJS)
#if defined(DICKENS)
Expand Down Expand Up @@ -1413,6 +1414,9 @@ bool jsfLoadBootCodeFromFlash(bool isReset) {
if (!code) return false;
jsvUnLock2(jspEvaluateVar(code,0,0), code);
return true;
#else
return false;
#endif
}

bool jsfFlashContainsCode() {
Expand Down

0 comments on commit ba9eedb

Please sign in to comment.