
Lately, I've not been doing much Haskell because I've buried in embedded systems work. The code is all C, with only a smidgen of C++ (for which I am grateful). One of the things I've been toying with is turning part of the on-chip configuration information a haskel functions. They'd even be pure code, and would be a lot more expressive than what's there now. The target platforms are running Cortex M3 CPUs. I know that jhc/ajhc will generate code for those CPUs, but I really need at least a subset of the compiler running on the target processor with no pre-installed RTOS. Has that been done? Is it likely to even be possible? As part of the project, I'll need to install both a cross-compiler on my Unix box, and the the compiler (or parts of it) on the M3. Can someone provide pointers to tutorials on that? My google-foo wasn't powerful enough to find any. I'm thinking about using either an Aruino Due (as it has the M3 CPU on it) as a testbed platform. So tutorials targeted for that platform would be particularly appreciated. Since I hopefully have the eyes of people experienced with these things, should I be considering a raspberry pi or something similar instead of the Due? Basically, will I be able to run code built for the M3 CPU on the pi CPUs? thanks, Mike

I'm not aware of state of Haskell compilers for ARM platform, but I'm an
embedded developer. As far as I know, you can't run Cortex-M3 code on
Raspberry Pi, because latest is Cortex-A8 and I believe M3 and A8 are
binary incompatible.
Regards,
Alexey
2015-02-06 4:18 GMT+02:00 Mike Meyer
Lately, I've not been doing much Haskell because I've buried in embedded systems work. The code is all C, with only a smidgen of C++ (for which I am grateful).
One of the things I've been toying with is turning part of the on-chip configuration information a haskel functions. They'd even be pure code, and would be a lot more expressive than what's there now.
The target platforms are running Cortex M3 CPUs. I know that jhc/ajhc will generate code for those CPUs, but I really need at least a subset of the compiler running on the target processor with no pre-installed RTOS. Has that been done? Is it likely to even be possible?
As part of the project, I'll need to install both a cross-compiler on my Unix box, and the the compiler (or parts of it) on the M3. Can someone provide pointers to tutorials on that? My google-foo wasn't powerful enough to find any.
I'm thinking about using either an Aruino Due (as it has the M3 CPU on it) as a testbed platform. So tutorials targeted for that platform would be particularly appreciated.
Since I hopefully have the eyes of people experienced with these things, should I be considering a raspberry pi or something similar instead of the Due? Basically, will I be able to run code built for the M3 CPU on the pi CPUs?
thanks, Mike
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

I would say no way to run ghci on M3, but this should be possible on RPi especially if you consider v2 which provides quad-core ARMv7 CPU. ARMv6 on the v1 should also be possible if the support has not bit-roted that much. Anyway, GHC for ARM requires LLVM and the situation with GHC/LLVM is not currently stable as it's kind of in transition period from old LLVM support to new LLVM support. Ben Gamari (cced to this) knows more about it. Cheers, Karel On 02/ 6/15 03:18 AM, Mike Meyer wrote:
Lately, I've not been doing much Haskell because I've buried in embedded systems work. The code is all C, with only a smidgen of C++ (for which I am grateful).
One of the things I've been toying with is turning part of the on-chip configuration information a haskel functions. They'd even be pure code, and would be a lot more expressive than what's there now.
The target platforms are running Cortex M3 CPUs. I know that jhc/ajhc will generate code for those CPUs, but I really need at least a subset of the compiler running on the target processor with no pre-installed RTOS. Has that been done? Is it likely to even be possible?
As part of the project, I'll need to install both a cross-compiler on my Unix box, and the the compiler (or parts of it) on the M3. Can someone provide pointers to tutorials on that? My google-foo wasn't powerful enough to find any.
I'm thinking about using either an Aruino Due (as it has the M3 CPU on it) as a testbed platform. So tutorials targeted for that platform would be particularly appreciated.
Since I hopefully have the eyes of people experienced with these things, should I be considering a raspberry pi or something similar instead of the Due? Basically, will I be able to run code built for the M3 CPU on the pi CPUs?
thanks, Mike
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Try this demo on Cortex-M3:
https://github.com/ajhc/demo-cortex-m3/tree/master/stm32f3-discovery
I only have Cortex-M0+ and Cortex-M4 in my disposition but I think the
above should run on your hardware. You would likely need to modify the
linker script stm32f3.ld for your memory layout.
BTW, Raspberry Pi is ARM11 (ARM architecture v6) and not Cortex-M3
(arm architecture v7). On Raspberry Pi you can run bare metal binaries
on as little as 32KiB RAM in a similar way to the above demo, with a
GCC cross-compiler rather than in Linux under LLVM. I understand your
question was about bare metal support for Haskell and not LLVM.
--Vladimir
On 6 February 2015 at 02:18, Mike Meyer
Lately, I've not been doing much Haskell because I've buried in embedded systems work. The code is all C, with only a smidgen of C++ (for which I am grateful).
One of the things I've been toying with is turning part of the on-chip configuration information a haskel functions. They'd even be pure code, and would be a lot more expressive than what's there now.
The target platforms are running Cortex M3 CPUs. I know that jhc/ajhc will generate code for those CPUs, but I really need at least a subset of the compiler running on the target processor with no pre-installed RTOS. Has that been done? Is it likely to even be possible?
As part of the project, I'll need to install both a cross-compiler on my Unix box, and the the compiler (or parts of it) on the M3. Can someone provide pointers to tutorials on that? My google-foo wasn't powerful enough to find any.
I'm thinking about using either an Aruino Due (as it has the M3 CPU on it) as a testbed platform. So tutorials targeted for that platform would be particularly appreciated.
Since I hopefully have the eyes of people experienced with these things, should I be considering a raspberry pi or something similar instead of the Due? Basically, will I be able to run code built for the M3 CPU on the pi CPUs?
thanks, Mike
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
participants (4)
-
Alexey Shmalko
-
Karel Gardas
-
Mike Meyer
-
Vladimir Komendantskiy