[FPC, CROSS ARM] for LPC1114 lazarus / 79-Embedded - ARM ---------------------------------------------------------------------- devport · 2019-10-29 20:43 Hey i compile simple code for my LPC1114. I have questions: 1. i can use ObjFPC mode ? 2. If use SetLenght my program stoped why? 3. I muset settings heap size?  Please help. Sorry, my english is not perfet I from Poland. Thx ---------------------------------------------------------------------- Laksen · 2019-10-29 21:31 1. Yes, but as you have found out you need to ensure that you are aware of your memory usage 2. Because you need to install a memory manager explicitly. You can do that by adding "heapmgr" to your uses list as one of the first units. Then you need to set the heap size as in your third question 3. Setting the heap size only does something if you use the heap area. The heapmgr unit does that, for example. So if you set heap size (command line option -Ch) and use heapmgr you should see you should be able to allocate dynamic memory ---------------------------------------------------------------------- devport · 2019-10-30 07:42 Thank you I like Pascal Dialect and last 6 years programmed in C... Does it make sense to write in this language? on embedded devices? More as a hobby codding ---------------------------------------------------------------------- Laksen · 2019-10-30 08:20 Definitely ---------------------------------------------------------------------- lvaskov · 2019-11-23 13:52 Hi, I am trying to do exactly as you wrote here - set heap size and add heapmgr unit to uses clause. But on compilation it gives an error: Cannot find heapmgr used by ... My Target OS is Linux, target CPU is arm. Should I add some more paths to the project options? The heapmgr unit is found only in fpc\fpcsrc\rtl\embeded directory and if I add it to the path, then a lot more errors start to emerge. ---------------------------------------------------------------------- Laksen · 2019-11-23 19:52 What options did you use? ---------------------------------------------------------------------- lvaskov · 2019-11-23 20:10 These are the options as reported by Lazarus (excluding some project specific paths): C:\FreePascal\fpc\bin\x86_64-win64\fpc.exe -Tlinux -Parm -CpARMV7A -MDelphi -Scaghi -CirotR -Ch33554432 -O1 -gw2 -godwarfsets -gl -Xg -gt -vewnhibq -Fi..\..\Binary\Linux32ARM\Debug\Units -FuC:\FreePascal\lazarus\lcl\units\arm-linux\gtk2 -FuC:\FreePascal\lazarus\lcl\units\arm-linux -FuC:\FreePascal\lazarus\components\lazutils\lib\arm-linux -FuC:\FreePascal\lazarus\packager\units\arm-linux -Fu. -FU..\..\Binary\Linux32ARM\Debug\Units -FE..\..\Binary\Linux32ARM\Debug -o..\..\Binary\Linux32ARM\Debug\Project -dLCL -dLCLgtk2 Lazarus manages to find and open the file when I Control+Click on it, so it must be something with the compiler. I tried to copy heapmgr.pp to my project's directory and add it to the project but when it is compiled it gives an error: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i heapmgr.pp(288,38) Fatal: Syntax error, ":" expected but "identifier NAME" found at this section: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i var  initialheap : record end; external name '__fpc_initialheap';  heapsize : PtrInt; external name '__heapsize'; ---------------------------------------------------------------------- lvaskov · 2019-11-23 22:22 Further tries: Since the project is marked as {$MODE DELPHI}, looks like it prevents heapmgr from compiling, as mentioned in the previous comment. I put a {$MODE OBJFPC} in the beginning of it and the project compiled . But next another error follows: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i (9015) Linking C:\FreePascal\Projects\Test\Binary\Linux32ARM\Debug\ProjectC:\ FreePascal\Projects\Test\Binary\Linux32ARM\Debug\Units\heapmgr.o: In function `HEAPMGR_$$_init$':C:/FreePascal/Projects/Test/Packages/Appli cation//heapmgr.pp:289: undefined reference to `__fpc_initialheap'C:\F reePascal\Projects\Test\Packages\Application\Project.lpr(40,1) Error: (9013) Error while linkingC:\FreePascal\Projects\Test\Packages\Applica tion\Project.lpr(40,1) Fatal: (10026) There were 1 errors compiling module, stoppingFatal: (1018) Compilation abortedError: C:\FreePascal\fpc\bin\x86_64-win64\ppcrossarm.exe returned an error exitcode