Tarides Internship Project: OCaml bytecode running on a highly-constrained embedded platform
  • C 78.5%
  • OCaml 10.2%
  • C++ 3%
  • Makefile 2.2%
  • Python 1.6%
  • Other 4.4%
Find a file
2021-09-30 14:10:06 +02:00
.circleci .circleci: use riot/static-test-tools Docker image 2021-01-14 19:08:15 +01:00
.github gh_actions: add step for riotboot_serial 2021-07-20 22:51:59 +02:00
boards Merge pull request #16694 from benpicco/boards/saml21-xpro_EXT3 2021-07-30 14:55:28 +02:00
bootloaders riotboot: factor out common Makefile parts 2021-07-20 22:51:56 +02:00
core Merge pull request #16098 from kfessel/p-remove-lifo 2021-06-15 13:55:30 +02:00
cpu cpu/saml21: uart: disable fractional baud rate 2021-07-30 11:28:02 +02:00
dist Merge pull request #15493 from benpicco/riotboot-serial 2021-07-21 11:01:31 +02:00
doc doc/doxygen: increase DOT_GRAPH_MAX_NODES to 275 2021-07-27 21:20:34 +02:00
drivers Merge pull request #16533 from jia200x/pr/submac_fixes 2021-08-04 16:53:58 +02:00
examples First 2021-09-14 13:50:49 +02:00
fuzzing gnrc_tcp: add listen/accept 2021-07-08 09:40:02 +02:00
kconfigs drivers/periph/uart: add periph_uart_rx_start feature 2021-07-27 16:29:30 +02:00
makefiles Further progress made 2021-09-15 14:39:02 +02:00
omicrob Fixed Makefile 2021-09-30 14:09:06 +02:00
pkg Merge pull request #16708 from fjmolinas/pr_edhoc_c_bump 2021-08-06 09:26:28 +02:00
sys First 2021-09-08 11:11:37 +02:00
tests First 2021-09-14 13:50:49 +02:00
.bandit
.drone.yml
.DS_Store Removing redundant mlvalues in the OCaml runtime 2021-09-17 14:43:04 +02:00
.gitattributes
.gitignore .gitignore: add *.plist and .cache/ 2021-03-17 09:55:00 +01:00
.mailmap
.murdock .murdock: Add board to kconfig test 2021-07-02 15:11:10 +02:00
CODE_OF_CONDUCT.md
CODEOWNERS CODEOWNERS: Notify @chrysn on CoAP changes 2021-05-08 10:57:00 +02:00
CODING_CONVENTIONS.md Coding_Convention: clarify: none return is allowed 2021-03-08 14:46:34 +01:00
CODING_CONVENTIONS_C++.md
CONTRIBUTING.md CONTRIBUTING: Remove Freenode reference 2021-06-18 11:11:27 +02:00
doc.txt doc: Describe interaction between DEVELHELP and assert 2020-10-25 23:27:51 +01:00
Kconfig Kconfig: source EXTERNAL_MODULES configurations 2021-02-23 19:16:33 +01:00
LICENSE
LOSTANDFOUND.md lostandfound: document removal of boards/slwstk6220a 2021-01-05 12:19:47 +01:00
MAINTAINING.md MAINTAINING: Clarify guidelines 2020-07-13 10:57:03 +02:00
Makefile make: Remove mailing list advertisement 2021-05-12 11:41:25 +02:00
Makefile.base cpp: Use modules for cpp and libstdcpp 2021-07-02 15:11:10 +02:00
Makefile.dep cpp: Use modules for cpp and libstdcpp 2021-07-02 15:11:10 +02:00
Makefile.features treewide: model newlib as a FEATURE 2021-01-27 09:24:25 +01:00
Makefile.include Added standard OCaml runtime to fill in the gaps that OMicroB has 2021-09-16 11:05:19 +02:00
README.md Amended building tutorial 2021-09-30 14:10:06 +02:00
release-notes.txt release-notes.txt: add 2021.07 release notes 2021-07-16 12:17:58 +02:00
SECURITY.md SECURITY.md: fix mailto link 2020-12-10 14:18:19 +01:00
uncrustify-riot.cfg uncrustify-riot.cfg: update to coding convention 2021-03-04 17:23:46 +01:00
Vagrantfile

omicrob-riot-nrf52

This project gets OCaml bytecode running on the nRF52840 board. It uses OMicroB for the runtime and bytecode optimisation, and RIOT OS for the base layer between the runtime and the board, as well as for its robust build system.

This is an offshoot of ocaml-riot-nrf52, which uses the standard OCaml runtime instead of OMicroB. This led to overly large images as well as issues with dynamic memory allocation that prevented the usage of OCaml modules. ocaml-riot-nrf52 is kept public as it is still useful to learn from.

This project is currently not working, as OMicroB and its dependencies target OCaml 4.07, while I am targeting 4.12. Between 4.07 and 4.12 there was a significant change in the structure of closure environments, which prevents 4.12 bytecode functions from being called by 4.07 OMicroB. Without functions the image is produced correctly, but obviously non-trivial programs need functions.

The projects that need to be updated to 4.12 are:

  • OMicroB
  • OcamlClean
  • OByteLib

Building

git clone https://github.com/benmandrew/omicrob-riot-nrf52.git
cd omicrob-riot-nrf52/omicrob
./configure
make