Trying to build for armv7

Lately there are a number of REALLY cheap development boards that I would like to use for some hardware development projects. However they are 32 bit armv7l architecture.

The platforms page says it’s a tier 2 platform, so “it should work but CI doesn’t run”

Is there any guide on how to try building the compiler in that platform or to build a compiler that targets that platform?

You can cross compile with the following then link on the ARM board, if running linux. Otherwise you’ll need an arm cross compiler toolchain.

$ crystal build --cross-compile --target arm-linux-gnu

Except that it’s an ARM micro-controller, so you’ll have to do without the stdlib :smile:

Actually these things boot Ubuntu :smiley:

I missed the 3 × Cortex-A7 core (+ 1 × M0 core). Then you might be fine. You’ll probably want these args:

  • --target=arm-linux-gnu
  • --mcpu=armv7-a

I would be really interested to see how this pans out if you get it working.
especially accessing gpio.

Crystal on micro controllers would be so cool!!

For gpio it probably needs a FFI wrapper. I am thinking of buying some of these (the lyra plus, probably) but shipping to Argentina is a bit expensive.

@RX14 wrote a tool to generate bindings from SVD definitions: GitHub - RX14/svd.cr

But you need SVD definitions for the board.