www.digitalmars.com         C & C++   DMDScript  

D.gnu - Bare metal D

reply "teachop" <is-not given.com> writes:
Looking for help / advice getting D running in an embedded 
system.  The compiler building for gdc and newlib went smoothly 
(mostly) thanks to this web page:
http://gdcproject.org/wiki/Cross%20Compiler/crosstool-NG

I have given the bitbucket-hosted timosi/minlibd a fair bit of 
time and not been able to link correctly and get an output.  The 
library built wihtout error.  The example there isn't complete.  
My targets are AVR32 and ARM Cortex M3 but am first focusing only 
on the M3.

Any advice on getting this going?  Thanks.
May 04 2013
parent reply Iain Buclaw <ibuclaw ubuntu.com> writes:
On May 4, 2013 6:40 PM, "teachop" <is-not given.com> wrote:
 Looking for help / advice getting D running in an embedded system.  The
compiler building for gdc and newlib went smoothly (mostly) thanks to this web page:
 http://gdcproject.org/wiki/Cross%20Compiler/crosstool-NG

 I have given the bitbucket-hosted timosi/minlibd a fair bit of time and
not been able to link correctly and get an output. The library built wihtout error. The example there isn't complete. My targets are AVR32 and ARM Cortex M3 but am first focusing only on the M3.
 Any advice on getting this going?  Thanks.
Seek me out if there are any blockers preventing you from doing this. Otherwise please document everything you do. :) Regards -- Iain Buclaw *(p < e ? p++ : p) = (c & 0x0f) + '0';
May 05 2013
parent reply "Timo Sintonen" <t.sintonen luukku.com> writes:
On Sunday, 5 May 2013 at 10:56:53 UTC, Iain Buclaw wrote:
 On May 4, 2013 6:40 PM, "teachop" <is-not given.com> wrote:
 Looking for help / advice getting D running in an embedded 
 system.  The
compiler building for gdc and newlib went smoothly (mostly) thanks to this web page:
 http://gdcproject.org/wiki/Cross%20Compiler/crosstool-NG

 I have given the bitbucket-hosted timosi/minlibd a fair bit of 
 time and
not been able to link correctly and get an output. The library built wihtout error. The example there isn't complete. My targets are AVR32 and ARM Cortex M3 but am first focusing only on the M3.
 Any advice on getting this going?  Thanks.
Seek me out if there are any blockers preventing you from doing this. Otherwise please document everything you do. :)
I have been able to compile, link and run a test program in stm32f4 with the tools and libs in my repo. The major thing that is missing is memory allocation. The one I used was heavily related to my hardware and I am now making a more general version. Another file that is missing is a startup file. The file should have code that sets the state of the processor so that we can call main. This means usually setting the clock oscillator, interrupt controller and memory controller. This file is totally processor dependent and the processor vendor does provide this. The license of those files may prevent me to share them in my repo. There has also been issues in linking. When an operating system loads an elf file, it can look the elf headers and find out the section locations. When the file is loaded into flash memory, this information is lost. Linker script variables are used to mark the locations but they may still be wrong. I have been a busy lately but I try to get a working example as soon as possible. It is possible and it has been done and it has worked. Meanwhile, I am interested to hear what kind of processors you are using. I can answer stm32 related questions if that is your target.
May 05 2013
next sibling parent "teachop" <is-not given.com> writes:
On Sunday, 5 May 2013 at 18:00:45 UTC, Timo Sintonen wrote:
 On Sunday, 5 May 2013 at 10:56:53 UTC, Iain Buclaw wrote:
 On May 4, 2013 6:40 PM, "teachop" <is-not given.com> wrote:
 Looking for help / advice getting D running in an embedded 
 system.  The
compiler building for gdc and newlib went smoothly (mostly) thanks to this web page:
 http://gdcproject.org/wiki/Cross%20Compiler/crosstool-NG

 I have given the bitbucket-hosted timosi/minlibd a fair bit 
 of time and
not been able to link correctly and get an output. The library built wihtout error. The example there isn't complete. My targets are AVR32 and ARM Cortex M3 but am first focusing only on the M3.
 Any advice on getting this going?  Thanks.
Seek me out if there are any blockers preventing you from doing this. Otherwise please document everything you do. :)
I have been able to compile, link and run a test program in stm32f4 with the tools and libs in my repo. The major thing that is missing is memory allocation. The one I used was heavily related to my hardware and I am now making a more general version. Another file that is missing is a startup file. The file should have code that sets the state of the processor so that we can call main. This means usually setting the clock oscillator, interrupt controller and memory controller. This file is totally processor dependent and the processor vendor does provide this. The license of those files may prevent me to share them in my repo. There has also been issues in linking. When an operating system loads an elf file, it can look the elf headers and find out the section locations. When the file is loaded into flash memory, this information is lost. Linker script variables are used to mark the locations but they may still be wrong. I have been a busy lately but I try to get a working example as soon as possible. It is possible and it has been done and it has worked. Meanwhile, I am interested to hear what kind of processors you are using. I can answer stm32 related questions if that is your target.
Thanks for the replies both of you. Probably the best approach is if I order in an inexpensive ST Micro "discovery" board so I can track along with your work. My first real goal is for ARM and specifically the NXP LPC1788.
May 05 2013
prev sibling parent "teachop" <is-not given.com> writes:
I picked up an STM32F205RF board, ready when you are Timo...
May 07 2013