Thread overview
Dlang for embedded: need real project
Oct 22
aberba
Jan 03
aberba
October 22
Hi!

Looks like druntime fork dedicated "to support almost any system" (https://github.com/denizzzka/druntime) works well with ARM Cortex-M3 backend! Almost all unittests is passed on QEMU emulated hardware (except threads and fiberes, see more: https://github.com/denizzzka/d_c_arm_test/issues/5)

So, it will be cool if some real project will have its firmware implemented on D!
ARM Cortex or MCU based on RISC-V is preferred, but another architectures is also appropriate.

Any ideas?

October 22
On Thursday, 22 October 2020 at 08:04:48 UTC, Denis Feklushkin wrote:
> Hi!
>
> Looks like druntime fork dedicated "to support almost any system" (https://github.com/denizzzka/druntime) works well with ARM Cortex-M3 backend! Almost all unittests is passed on QEMU emulated hardware (except threads and fiberes, see more: https://github.com/denizzzka/d_c_arm_test/issues/5)
>
> So, it will be cool if some real project will have its firmware implemented on D!
> ARM Cortex or MCU based on RISC-V is preferred, but another architectures is also appropriate.
>
> Any ideas?

The PineTime[1] is one which is really inexpensive and has really fun proper use-cases. (Time & date, Bluetooth communication/integration with phone, heart rate measuring, etc.)

I wanted to start on that a while ago but haven't gotten around to it yet. Now there is even OTA flashing shipped with the watch in the included (community) OS which makes it even easier as you don't need to get a flashing device + cable anymore. (It's very cheap, 15€ for one with integrated debugger by a big trusted company for open source/personal use, but putting the cable in the watch and flashing with it is kind of a pain)

[1]: https://www.pine64.org/pinetime/
October 22
On Thursday, 22 October 2020 at 08:04:48 UTC, Denis Feklushkin wrote:
> Hi!
>
> Looks like druntime fork dedicated "to support almost any system" (https://github.com/denizzzka/druntime) works well with ARM Cortex-M3 backend! Almost all unittests is passed on QEMU emulated hardware (except threads and fiberes, see more: https://github.com/denizzzka/d_c_arm_test/issues/5)
>
> So, it will be cool if some real project will have its firmware implemented on D!
> ARM Cortex or MCU based on RISC-V is preferred, but another architectures is also appropriate.
>
> Any ideas?

Nice!
October 23
On Thursday, 22 October 2020 at 08:15:41 UTC, WebFreak001 wrote:
> On Thursday, 22 October 2020 at 08:04:48 UTC, Denis Feklushkin wrote:
>> Hi!
>>
>> Looks like druntime fork dedicated "to support almost any system" (https://github.com/denizzzka/druntime) works well with ARM Cortex-M3 backend! Almost all unittests is passed on QEMU emulated hardware (except threads and fiberes,

Only threads, fibers work like a charm!

> The PineTime[1] is one which is really inexpensive and has really fun proper use-cases. (Time & date, Bluetooth communication/integration with phone, heart rate measuring, etc.)

Looks like what I am need, thanks!

November 15
On Thursday, 22 October 2020 at 08:04:48 UTC, Denis Feklushkin wrote:
> Hi!
>
> Looks like druntime fork dedicated "to support almost any system" (https://github.com/denizzzka/druntime) works well with ARM Cortex-M3 backend! Almost all unittests is passed on QEMU emulated hardware (except threads and fiberes, see more: https://github.com/denizzzka/d_c_arm_test/issues/5)

I'm just in a hurry to share news: threads module just have started working and now druntime passes threads unittests on ARM Cortex-M3!

It looks like this:

$ qemu-system-arm -machine mps2-an511 -nographic -rtc clock=vm -icount shift=2 -semihosting -kernel firmware.elf
unexpected pointers 0x2184e008 and 0x21865008
Not safe to migrate Fibers between Threads on your system. Consider setting version CheckFiberMigration for this system in thread.d
28 modules passed unittests
$

There are a few more unfinished parts but they are not fundamental:
- disabled demangle tests (demangle consumes huge memory amounts sometimes, https://github.com/dlang/druntime/pull/3262)
- disabled some TickDuration tests - don't know how to fix it, but remember what TickDuration is deprecated
- core.sync.condition is not implemented
- more what is not used in current unittests but depends from OS (just errors is not triggered in this case)


More info at:
https://github.com/denizzzka/d_c_arm_test
(look into "issues" section)
January 03
On Sunday, 15 November 2020 at 04:00:31 UTC, Denis Feklushkin wrote:
> On Thursday, 22 October 2020 at 08:04:48 UTC, Denis Feklushkin wrote:
>> Hi!
>>
>> Looks like druntime fork dedicated "to support almost any system" (https://github.com/denizzzka/druntime) works well with ARM Cortex-M3 backend! Almost all unittests is passed on QEMU emulated hardware (except threads and fiberes, see more: https://github.com/denizzzka/d_c_arm_test/issues/5)

Good news!

This fork of druntime at this moment started to run on real hardware with appropriate ARM Cortex backend!

https://youtu.be/PE6pMUA0vNQ

STM32F411CEU6 MCU is used (512kB of flash)

$ size firmware.elf
text	   data	    bss	    dec	    hex	filename
 256884	  21012	   2292	 280188	  4467c	firmware.elf

app.d is here: https://github.com/denizzzka/d_c_arm_test/blob/master/d/source/app.d

Happy New Year!
January 03
On Sunday, 3 January 2021 at 14:20:26 UTC, Denis Feklushkin wrote:
> On Sunday, 15 November 2020 at 04:00:31 UTC, Denis Feklushkin wrote:
>> On Thursday, 22 October 2020 at 08:04:48 UTC, Denis Feklushkin wrote:
>>> [...]
>
> Good news!
>
> This fork of druntime at this moment started to run on real hardware with appropriate ARM Cortex backend!
>
> https://youtu.be/PE6pMUA0vNQ
>
> STM32F411CEU6 MCU is used (512kB of flash)
>
> $ size firmware.elf
> text	   data	    bss	    dec	    hex	filename
>  256884	  21012	   2292	 280188	  4467c	firmware.elf
>
> app.d is here: https://github.com/denizzzka/d_c_arm_test/blob/master/d/source/app.d
>
> Happy New Year!

Wait, what does this mean.. It's not betterC, so what can be used?

Nice anyhow 👍
January 03
On Sunday, 3 January 2021 at 15:45:52 UTC, Imperatorn wrote:
> On Sunday, 3 January 2021 at 14:20:26 UTC, Denis Feklushkin wrote:
>> On Sunday, 15 November 2020 at 04:00:31 UTC, Denis Feklushkin wrote:
>>> On Thursday, 22 October 2020 at 08:04:48 UTC, Denis Feklushkin wrote:
>>>> [...]
>>
>> Good news!
>>
>> This fork of druntime at this moment started to run on real hardware with appropriate ARM Cortex backend!
>>
>> https://youtu.be/PE6pMUA0vNQ
>>
>> STM32F411CEU6 MCU is used (512kB of flash)
>>
>> $ size firmware.elf
>> text	   data	    bss	    dec	    hex	filename
>>  256884	  21012	   2292	 280188	  4467c	firmware.elf
>>
>> app.d is here: https://github.com/denizzzka/d_c_arm_test/blob/master/d/source/app.d
>>
>> Happy New Year!
>
> Wait, what does this mean.. It's not betterC, so what can be used?

It is just "regular" druntime! Ok, this is druntime fork, with some additions to support ANY hardware/OS backend: https://github.com/denizzzka/druntime

Looks like it is only remains to get rid of unnecessary RTTI.

January 03
On Sunday, 3 January 2021 at 16:24:49 UTC, Denis Feklushkin wrote:
> On Sunday, 3 January 2021 at 15:45:52 UTC, Imperatorn wrote:
>> On Sunday, 3 January 2021 at 14:20:26 UTC, Denis Feklushkin wrote:
>>> [...]
>>
>> Wait, what does this mean.. It's not betterC, so what can be used?
>
> It is just "regular" druntime! Ok, this is druntime fork, with some additions to support ANY hardware/OS backend: https://github.com/denizzzka/druntime
>
> Looks like it is only remains to get rid of unnecessary RTTI.

Awesome!!!