Thread overview
is there something like `stm32-rs` in D?
Sep 26, 2018
dangbinghoo
Sep 26, 2018
Radu
Sep 26, 2018
dangbinghoo
Sep 26, 2018
Radu
Oct 16, 2018
wiffel
September 26, 2018
hi,

https://github.com/adamgreig/stm32-rs looks great, is there something like this in Dlang?

thanks!
---
dangbinghoo

September 26, 2018
On Wednesday, 26 September 2018 at 03:46:21 UTC, dangbinghoo wrote:
> hi,
>
> https://github.com/adamgreig/stm32-rs looks great, is there something like this in Dlang?
>
> thanks!
> ---
> dangbinghoo

You might take a look at

https://github.com/JinShil/stm32f42_discovery_demo
and
https://github.com/JinShil/stm32_datasheet_to_d
September 26, 2018
On Wednesday, 26 September 2018 at 05:24:08 UTC, Radu wrote:
> On Wednesday, 26 September 2018 at 03:46:21 UTC, dangbinghoo wrote:
>> hi,
>>
>> https://github.com/adamgreig/stm32-rs looks great, is there something like this in Dlang?
>>
>> thanks!
>> ---
>> dangbinghoo
>
> You might take a look at
>
> https://github.com/JinShil/stm32f42_discovery_demo
> and
> https://github.com/JinShil/stm32_datasheet_to_d

thanks, Radu, I knew that there's a minimal D demo on STM32 exist for years. But, what I'm talking about is that rust community is doing a rust library for very production use. If you look at stm32-rs, you will found that stm32-rs is covering the whole STM32 MCU product line and making a promising peripherals library.

The library was generated using CMSIS-SVD files which were maintained by MCU vendors.

Anyway, I don't know what's the runtime size situation D vs rust. for those kinds of MCU devices, a runtime code size greater than 5KB may even not suitable for  L0 lines MCU from ST.

It's not quite clear that whether D or rust is valuable for MCU development, but C is really lacking lots of things for quick development, today MCU is interfacing more IoT modules using AT command, and deal with these string things is quite painful in C. Maybe this is an opportunity for D?

Thanks!

---
dangbinghoo
September 26, 2018
On Wednesday, 26 September 2018 at 05:55:49 UTC, dangbinghoo wrote:
> On Wednesday, 26 September 2018 at 05:24:08 UTC, Radu wrote:
>> On Wednesday, 26 September 2018 at 03:46:21 UTC, dangbinghoo wrote:
>>> hi,
>>>
>>> https://github.com/adamgreig/stm32-rs looks great, is there something like this in Dlang?
>>>
>>> thanks!
>>> ---
>>> dangbinghoo
>>
>> You might take a look at
>>
>> https://github.com/JinShil/stm32f42_discovery_demo
>> and
>> https://github.com/JinShil/stm32_datasheet_to_d
>
> thanks, Radu, I knew that there's a minimal D demo on STM32 exist for years. But, what I'm talking about is that rust community is doing a rust library for very production use. If you look at stm32-rs, you will found that stm32-rs is covering the whole STM32 MCU product line and making a promising peripherals library.
>
> The library was generated using CMSIS-SVD files which were maintained by MCU vendors.
>
> Anyway, I don't know what's the runtime size situation D vs rust. for those kinds of MCU devices, a runtime code size greater than 5KB may even not suitable for  L0 lines MCU from ST.
>
> It's not quite clear that whether D or rust is valuable for MCU development, but C is really lacking lots of things for quick development, today MCU is interfacing more IoT modules using AT command, and deal with these string things is quite painful in C. Maybe this is an opportunity for D?
>
> Thanks!
>
> ---
> dangbinghoo

I think you should get in touch with Mike Franklin and see what are his plans with the demo code. I know there were some blocking issues and he was working to solve them.

Maybe the tool-chain and language is mature enough to revisit this project and make it production ready. I'm not an MCU expert but maybe you can join in with ideas and some insights and help boot-strap a new project.
October 16, 2018
On Wednesday, 26 September 2018 at 08:51:11 UTC, Radu wrote:
> On Wednesday, 26 September 2018 at 05:55:49 UTC, dangbinghoo wrote:
>> On Wednesday, 26 September 2018 at 05:24:08 UTC, Radu wrote:
>>> On Wednesday, 26 September 2018 at 03:46:21 UTC, dangbinghoo wrote:
>>>> hi,
>>>>
>>>> https://github.com/adamgreig/stm32-rs looks great, is there something like this in Dlang?
>>>>
>>>> thanks!
>>>> ---
>>>> dangbinghoo
>>>
>>> You might take a look at
>>>
>>> https://github.com/JinShil/stm32f42_discovery_demo
>>> and
>>> https://github.com/JinShil/stm32_datasheet_to_d
>>
>> thanks, Radu, I knew that there's a minimal D demo on STM32 exist for years. But, what I'm talking about is that rust community is doing a rust library for very production use. If you look at stm32-rs, you will found that stm32-rs is covering the whole STM32 MCU product line and making a promising peripherals library.
>>
>> The library was generated using CMSIS-SVD files which were maintained by MCU vendors.
>>
>> Anyway, I don't know what's the runtime size situation D vs rust. for those kinds of MCU devices, a runtime code size greater than 5KB may even not suitable for  L0 lines MCU from ST.
>>
>> It's not quite clear that whether D or rust is valuable for MCU development, but C is really lacking lots of things for quick development, today MCU is interfacing more IoT modules using AT command, and deal with these string things is quite painful in C. Maybe this is an opportunity for D?
>>
>> Thanks!
>>
>> ---
>> dangbinghoo

In Rust it is not very obvious to use an external MCU library and still be OK with the borrow checker. Using unsafe code everywhere is a possible approach, but then you would loose a lot of what Rust has to offer. I have the impression that most of the work on embedded rust is about that: creating libraries that still offer the benefits of rust.

In D it's easier to use existing C libraries, e.g. openlibcm3 for STM32 devices. I've been trying a few toy-examples on two STM32F103 platforms (the plain bluepill board and a more advance oled/loram board). I did a version in D (https://github.com/tilient/stm32/tree/master/miniblink/d) using openlibcm3 and the LDC2 cross-compiler. It took a while to figure out the correct way of compiling and linking (cfr. make.sh file), but it works fine now.

As a test, I also made a version in Rust (https://github.com/tilient/stm32/tree/master/miniblink/rust). That works fine too, but it's a lot harder to deal with the borrow checker from time to time. And the libraries are still quite in flux.

I'm not a power-user in either D or Rust, but - for now - I do prefer going with D when targetting STM32 platforms.