@satishgn has built a new feature for the Spark Core that allows the Wi-Fi connectivity stuff to run in parallel to the user application, so that your code is not blocked when the Core isn’t connected to the internet.
This has a few important wonderful implications:
- Your code will run without a Wi-Fi connection
- Your code won’t stop when the network connection dies
But it’s not without its downsides:
- This “multithreading” is accomplished by switching back and forth between the user application and the Spark background tasks at a microsecond level. This may affect high speed timing-sensitive code (I’m looking at you @BDub)
- This takes WAY more RAM than our firmware did previously, leaving less available RAM for your application.
This feature isn’t yet ready for primetime; it hasn’t been tested sufficiently, and we need to optimize memory use to provide more RAM for the user application. But if you want to live on the bleeding edge, and are building code locally, try it out!
To enable multithreading, check out the
context-switching branches of all three firmware repositories. Basically, once you’ve got your local core-firmware toolchain, do this:
cd core-firmware git checkout context-switching cd ../core-communication-lib git checkout context-switching cd ../core-common-lib git checkout context-switching cd ../core-firmware/build make dfu-util -d 1d50:607f -a 0 -s 0x08005000:leave -D core-firmware.bin
Feedback and pull requests welcome!