Forum > Embedded

Running a minimal fpc on a microcontroller

(1/4) > >>

SymbolicFrank:
The fpc specifications require at least 8 MB of memory, and 80 MB of storage. Would it be possible to make a very minimal build that would run on an ARM Cortex microcontroller? Say, at most 256 kB of memory and 1 MB of storage. How would that look like? An old build?

If that is not possible, what else could be done?

It wouldn't have an OS, so what other requirements (memory management, libraries and such) would there be?


The goal is to be able to compile and link small (Object) Pascal units and programs, at most a few kilobytes each. A subset is fine, objects would be nice. A bit like LUA.

If possible, is there some documentation somewhere, or do I download the source and try to figure it out myself?

marcov:
I think those values are very old (like FPC 1.0.x and dos).  You can simply start debugging a typical job and try to avoid and minimize buffers.

But 256kb is awfully little, and you probably also need to run AS and LD after. Doesn't seem easy to me.

Jonas Maebe:
The compiler binary itself is already 3MB. The compiler is not designed for minimal size, but for maximal maintainability and portability. This means it contains lots of abstractions, which is bad both for code size and memory use.

I don't think it's possible to adapt the compiler to fit in the constraints you mention.

avra:

--- Quote from: SymbolicFrank on May 28, 2019, 12:26:58 am ---Would it be possible to make a very minimal build that would run on an ARM Cortex microcontroller? Say, at most 256 kB of memory and 1 MB of storage.
--- End quote ---
Running FPC on 256Kb/1Mb is not a realistic request. Since I don't think cross compilation is what you're after, maybe building your own pascal compiler or interpreter could satisfy you? You might even try to get away with just adapting and cross compiling PascalScript or some other simpler Pascal interpreter and then building around it. Lot's of work, but result would be similar to existing MicroPython or Lua...

mischi:
Maybe the pico pascal compiler (https://github.com/paulherman/ppc) can help you.

If you could get along with old style iso pascal without objects, the p5 pascal compiler might do a job.

Navigation

[0] Message Index

[#] Next page

Go to full version