Thread overview
Severin Teona - SAOC Milestone 1 Update 1 - Druntime for Microcontrollers
Sep 24, 2020
Severin Teona
Sep 24, 2020
kinke
Sep 25, 2020
Severin Teona
Sep 25, 2020
Denis Feklushkin
September 24, 2020
Hi all,

This is an update for the first week of the first milestone for SAOC 2020.

My idea for the first two weeks (the original outline is at [1]) was to:
- try to build the druntime for an embedded architecture (the microcontroller I’m working with has an ARM Cortex-M4 CPU).

Before the start of the SAoC 2020 I tried to build it using the ‘lcd-build-runtime’ tool, but an cmake error [2] that I have not been able to resolve yet has stopped me.

This week:
- I followed Denis’ advice [3] and tried to build the runtime using the Meson build system.
- I have not succeeded yet and somehow there are still errors to resolve, but I have a feeling I am close.

In the following week:
- I hope I’ll manage to build the runtime so that I’ll have a working environment to help me in the next months of SAoC 2020.

[1]: https://forum.dlang.org/post/cwtkntyjhrwvpahfkdnm@forum.dlang.org
[2]: https://forum.dlang.org/post/btiahosjluxddsjjnleq@forum.dlang.org
[3]: https://forum.dlang.org/post/ufnrarqxshkztucbxggr@forum.dlang.org

September 24, 2020
On Thursday, 24 September 2020 at 19:03:36 UTC, Severin Teona wrote:
> Before the start of the SAoC 2020 I tried to build it using the ‘lcd-build-runtime’ tool, but an cmake error [2] that I have not been able to resolve yet has stopped me.

So it looks like you haven't even tried what I wrote in https://forum.dlang.org/post/vgnlauzerzezwfrgnrkv@forum.dlang.org?
September 25, 2020
On Thursday, 24 September 2020 at 19:03:36 UTC, Severin Teona wrote:
> Hi all,
>
> This is an update for the first week of the first milestone for SAOC 2020.
>
> My idea for the first two weeks (the original outline is at [1]) was to:
> - try to build the druntime for an embedded architecture (the microcontroller I’m working with has an ARM Cortex-M4 CPU).

It is important to remember that it is impossible to build default druntime just for some (hardware) architecture.

druntime needs architecture + "OS", because it is need to call something for memory allocations (malloc) and for other stuff like this. This "OS" can be reduced to few your own functions or maybe to TockOS calls or to baremetal libc implementation.

(Current druntime slightly uses libc calls. This is not as bad as it might seem, this is not touches "purity" of the language. In fact, libc isn't only C library, but de-facto standard for access to OSes functions.)

September 25, 2020
On Thursday, 24 September 2020 at 19:16:26 UTC, kinke wrote:
> So it looks like you haven't even tried what I wrote in https://forum.dlang.org/post/vgnlauzerzezwfrgnrkv@forum.dlang.org?

I tried this, but at that moment I couldn't make it work. I will try it again these days and will come with an update. Thanks for the advice :D