Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Gerd Stolpmann <info@gerd-stolpmann.de>
To: Dwight Schauer <dschauer@gmail.com>
Cc: Gerd Stolpmann <info@gerd-stolpmann.de>, caml-list@inria.fr
Subject: Re: [Caml-list] Ocaml on an embedded arm system (no linux)
Date: Fri, 20 Sep 2013 18:46:13 +0200	[thread overview]
Message-ID: <1379695573.11824.39.camel@thinkpad> (raw)
In-Reply-To: <CAKdt_-aRvGpXTnAC4T5QmLpi8d3FeC+zv9Rt4D56vAFiJr0QxA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 4350 bytes --]

Am Freitag, den 20.09.2013, 11:19 -0500 schrieb Dwight Schauer:
> No, the Flash/RAM sizes I mentioned are not a typo.
> 
> 
> OCaPIC is a similar OCaml project for PIC microntrollers.
> http://www.algo-prog.info/ocapic/web/index.php?id=OCAPIC:OCAPIC
> 
> 
> The microcontrollers targetted by OCaPIC have the following
> characteristics:
>   RAM memory: a few kB.
>   Flash memory: a few tens of kB.
>   Clock: a few MHz
> 
> 
> The ARM microcontrollers I'm looking to target are much bigger than
> PIC microcontrollers on all 3 of those counts are significantly
> larger.

Just looked at the slides. They implemented a lot of things to increase
the compactness (bytecode compression, 16 bit integers and pointers, a
simple stop-and-copy GC, a utility to remove dead code, ...). This is
essentially a complete port of ocaml to a new architecture, with heavy
modification of the runtime. At the end, it is possible to run programs
with a few hundred lines of code (which is really impressive). You
cannot run the toploop shell.

What you could do, of course, it to port OcaPIC to ARM (well, there is
some assembly code, but not that much). But this doesn't give you a
toploop, probably not even dynamic loading of bytecode.

I really wonder what makes these very small devices so interesting as
platform for OCaml (other than, of course, having fun to run some code
in the favorite language there).

Gerd



> 
> 
> 
> 
> 
> On Fri, Sep 20, 2013 at 10:54 AM, Gerd Stolpmann
> <info@gerd-stolpmann.de> wrote:
>         Am Freitag, den 20.09.2013, 09:13 -0500 schrieb Dwight
>         Schauer:
>         
>         > The ARM processors I'm looking to target are:
>         > STM32F407ZGT6 ARM Cortex-M4, 1MB Flash, 196KB RAM (Has
>         floating point)
>         > STM32F103RB ARM Cortex-M3, 128 KB Flash, 20K RAM (No
>         floating point)
>         
>         
>         I hope this isn't a typo. 196 KB RAM is way too low to even
>         run a hello
>         world program. The predecessor of ocaml, caml-light, needed
>         640K at
>         minimum for running it on DOS, and that was 16 bit code. Ocaml
>         is a lot
>         larger, and generates less dense 32 bit code.
>         
>         For a very small app on bare metal, I think you need at least
>         4-8 MB of
>         memory. For making you happy, calculate 64 MB. I cannot say
>         much about
>         the split flash mem vs. RAM - but you should take into account
>         that the
>         representation of values isn't optimized for compactness, and
>         you also
>         need extra RAM to give the garbage collector room.
>         
>         Maybe it is possible to lower the memory requirements by
>         modifying the
>         ocaml runtime (e.g. make the bytecode more compact at the cost
>         of extra
>         decoding steps, remove unneeded parts like the
>         compactor, ...), but I
>         doubt you'll be able to hit the mentioned limits.
>         
>         Gerd
>         
>         
>         >
>         >
>         > On both I'd like to be able to run bytecode both out of
>         Flash and RAM.
>         > (Primarily flash, but RAM for debugging).
>         >
>         >
>         > Speed is on overly important as long as I can control when
>         the garbage
>         > collection is run (could be done in C in the multitasker?).
>         >
>         >
>         >
>         > Dwight
>         >
>         >
>         
>         
>         --
>         ------------------------------------------------------------
>         Gerd Stolpmann, Darmstadt, Germany    gerd@gerd-stolpmann.de
>         Creator of GODI and camlcity.org.
>         Contact details:        http://www.camlcity.org/contact.html
>         Company homepage:       http://www.gerd-stolpmann.de
>         ------------------------------------------------------------
> 
> 

-- 
------------------------------------------------------------
Gerd Stolpmann, Darmstadt, Germany    gerd@gerd-stolpmann.de
Creator of GODI and camlcity.org.
Contact details:        http://www.camlcity.org/contact.html
Company homepage:       http://www.gerd-stolpmann.de
------------------------------------------------------------

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

  reply	other threads:[~2013-09-20 16:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-20 14:13 Dwight Schauer
2013-09-20 15:54 ` Gerd Stolpmann
2013-09-20 16:19   ` Dwight Schauer
2013-09-20 16:46     ` Gerd Stolpmann [this message]
2013-09-21 12:08     ` Jonathan Kimmitt
2013-09-23 12:30 ` Goswin von Brederlow
2013-09-23 21:10   ` Anil Madhavapeddy
2013-09-30 13:48     ` Goswin von Brederlow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1379695573.11824.39.camel@thinkpad \
    --to=info@gerd-stolpmann.de \
    --cc=caml-list@inria.fr \
    --cc=dschauer@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox