Porting Moddable SDK to other Microcontrollers #616
Replies: 1 comment
-
Your points cover a lot of ground. Here's some quick responses.
This is impractical in general because each platform is unique -- in the capabilities available and in the build process. The Moddable SDK is not a monolith. It is the XS JavaScript engine sitting on a very thin portable API layer. Just about all other functionality in the Moddable SDK is provided in the form of JavaScript modules. Each port is fundamentally about getting XS working on the target and then proceeding on to the modules that you want to support in that port. The XS Platforms document describes how the XS implementation is ported. While not required, we bring up support for the xsbug debugger as early as possible in the porting process. Having the debugger is very helpful for understanding failures and the instrumentation view gives helpful insights into resource use. The debugging connection is typically serial, though it is not required to be. For example, it is possible to debug over a TCP socket connection. As noted in an early discussion of the Pico port, it would be a good project for someone to put together porting notes based on the Pico effort.
XS itself is written in ANSI C and has relatively few dependencies beyond standard C library functions -- mostly memory and math. The JavaScript language itself, for example, does not have an file i/o built-in so stdio is not required. For any given module, you can quickly determine its dependencies by looking at the
Our documentation for building begins in our Getting Started document. It describe how to build the SDK tools on macOS, Windows, and Linux. There is a separate document for each embedded target. The heart of the build is
The main considerations are the resource limitations of the target device:
An efficient port needs to manage these with care.
Adding new hardware interface generally means adding a new module. For I/O, the Moddable SDK is moving to the IO Class Pattern from the forthcoming ECMAScript® Embedded Systems API Specification. Any new modules IO should follow this design pattern.
Please see our licensing page.
It is not required to commit changes to this repository. Depending on the licensing option you choose, it may be required to provide the changes publicly in some fashion. That said, we encourage those creating new ports to share them with the community that helped to build the Moddable SDK by making them available here.
That depends on what you want to do. We have demonstrated the Moddable SDK running on devices with as little as 32 KB of RAM and 256 KB of flash.
I'm not sure what you are asking. |
Beta Was this translation helpful? Give feedback.
-
Description
I'm interested to know the process of adding support for a new target microcontroller as part of the Moddable SDK?
Details Expected
Open Queries
Let me know in case additional details are required.
Beta Was this translation helpful? Give feedback.
All reactions