Thread overview
Severin Teona - SAOC Milestone 3 Update 4 - Druntime for Microcontrollers
Dec 21, 2020
Severin Teona
Dec 21, 2020
IGotD-
Dec 21, 2020
Severin Teona
December 21, 2020
Hi all!

This is my last update of the 3rd Milestone in #SAoC2020.

My last post is at [1]. The original plans for this week were to:
- solve the problems I had with my emulator to have a working testing environment;
- versioning the DRuntime, if the application would be working correctly;
- if any error appear, I would dig in the current setup to solve the problems.

Since last week, I did the following:
- I changed the version of renode (until last week, I was using the last stabe release of renode, and from now on I will be using the master repository directly - the support for the STM32F4-based board is better on the master repo).
- I tried emulating the simple application I managed to link the previous week, but I had some errors;
- I tried running the application directly on the development board (in theory it should have fit, because the size of the application was smaller than 2MB), but it ended in some errors;
- I started debugging the application and I discovered some problems with the memory alignment (long story short, the final userspace application was not aligned in a manner that the TockOS kernel process could load it correctly). I managed to resolve this problem by making some sections 16-bytes aligned.
- I managed to run on the microcontroller a simple application that does not need the DRuntime but is linked with it.
- I tried running an application that does this: `auto x = new int;` but I had errors.
- I updated the testing environment using Docker [2]

I do not know how much will I be able to do the next month and I am pretty sure this project will not end when #SAoC2020 ends, but the next steps for me are:
- start debugging the current DRuntime and find where the errors come from;
- as the DRuntime is a shared library that automatically starts the GC and the DRuntime I am working with is a static library, my mentor suggested that I could try to manually call the `Runtime.initialize()` from my application to start de GC. I will focus my work on this.

[1]: https://forum.dlang.org/post/xqiaphttdtbohfmwwppm@forum.dlang.org
[2]: https://github.com/DLang-IoT/renode_tester.git
December 21, 2020
On Monday, 21 December 2020 at 16:23:09 UTC, Severin Teona wrote:
>
> - I managed to run on the microcontroller a simple application that does not need the DRuntime but is linked with it.

Sorry, I had difficulties understanding that sentence. If the simple program doesn't need druntime, why link to it? I'm confused.

December 21, 2020
On Monday, 21 December 2020 at 17:34:59 UTC, IGotD- wrote:

> Sorry, I had difficulties understanding that sentence. If the simple program doesn't need druntime, why link to it? I'm confused.

It was an intermediate step and I only wanted to see if the current size of the DRuntime could fit the small flash memory of the microcontroller.