-
-
Notifications
You must be signed in to change notification settings - Fork 754
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add board: Seeed XIAO BLE #2591
base: master
Are you sure you want to change the base?
Conversation
Thanks - this looks great! Do you think it'd be possible to change |
6fc4180
to
44d2473
Compare
Thanks for the feedback! |
Does the board definition file need to use |
boards/XIAOBLE.py
Outdated
"link": ["https://www.seeedstudio.com/Seeed-XIAO-BLE-nRF52840-p-5201.html"], | ||
"default_console": "EV_USBSERIAL", | ||
"variables": 14000, # How many variables are allocated for Espruino to use. RAM will be overflowed if this number is too high and code won't compile. | ||
"binary_name": "espruino_%v_xiaoble.hex", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if this is .uf2? It may be you don't need the ifdef XIAOBLE ... proj: $(PROJ_NAME).uf2
line if it is...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hardcoding only the XIAOBLE to create a UF2 in that makefile does seem rather hacky...
Turns out I needed to change a bit more; something kept adding ".hex" to the end of the binary name.
See d40b0ca for what I did to make this work :)
@@ -2887,6 +2887,14 @@ void jshReboot() { | |||
NVIC_SystemReset(); | |||
} | |||
|
|||
#ifdef ESPR_HAS_BOOTLOADER_UF2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, thanks! Please could you add a comment in https://github.com/espruino/Espruino/blob/master/README_BuildProcess.md#infomakefile-definitions though? I'm trying to keep all the defines documented somewhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added 👍
Reminder for future me: Do this for BLE private address support as well.
src/jsflash.c
Outdated
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a shame the board doesn't have a button so this is needed - but I feel like it's very unlikely anyone would make a custom build that includes this?
Maybe you could:
- Make the UF2 include the flash area used for saved code so it always overwrites it
- Make a special UF2 that just overwrites the saved code area to allow you to clear it if you want to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but I feel like it's very unlikely anyone would make a custom build that includes this
Yeah, you're probably right.
The board does have a (reset) button; pressing it just immediately resets the board...
Make the UF2 include the flash area used for saved code
Probably not an option if saved code is on SPI flash though 🙈
(And I really want to use those 2 MB of external flash.)
Make a special UF2 that just overwrites the saved code area
I'd rather have something that allows recovering other data saved to storage, but I guess this will be the way to go if you don't like the "pull a magic pin to ground on boot" thing I added with my latest push.
Thanks for those changes to UF2 reboot - that looks really good.
No, that's fine - generate_pins was just a utility function to generate a bunch of contiguous pins. If you want to renumber the pins so they match the board what you've done is the right way to handle it. |
Thanks for the review!
If you think that the whole skipping boot js stuff is not that good of an idea I'll just drop that for now and look into the other recovery option you suggested, where we'd have an "I messed up and want to reset my board" build. |
that pin can be pulled to ground on boot to recover from .boot0 containing bad stuf
on devices that have such a bootloader the device will reappear as a USB drive
Thanks! This is looking really good.
As D1 is configured as the button in the bootloader anyway, could we not just add |
This adds support for the Seeed XIAO BLE, a tiny development board with a nRF52840 and 2 MB of external flash.
The board definition file is based on this one by Espruino forums user parasquid.
Some goodies that are included as well:
E.rebootToDFU()
triggers a reboot to UF2 bootloader mode