Lazarus cross-compiler for embedded arm lazarus / 77-Embedded ---------------------------------------------------------------------- krolikbest · 2025-09-18 11:57 Hi,  despite having a separate copy of Lazarus for compiling for arm I wanted the same option for compiling for arm in my normal (normal=windows os) installation. I used fpcupdeluxe as ususall for that purpouse; have selected embedded(os) and arm(cpu) from cross tab of fpcupdeluxe application. Installation went ok. So started Lazarus, selected new program and in Project->Project options->Config and target: Target os: Embedded, Target cpu: Arm. Then hit OK button. But then I get popup window with info (see attachment below). I already have compilers installed for other platforms (Linux, ARM, WinCE) and I don't really have any problems compiling for them. Does embedded require some different way than other os-targets? or is this because of this a little outdated version of Lazarus, or am I something missed.. Regards, Martin Lazarus 2.2.6, FPC 3.2.2, win64 ---------------------------------------------------------------------- ccrause · 2025-09-18 14:29 I also get that warning when using Lazarus (even recent main branch) for some embedded & freertos targets. Perhaps it is due to these targets saving the rtl units in subarch specific structures?  But not IIRC for avr-embedded, so not sure exactly what is causing this. What happens if you click OK and compile your example?  In my case (if the cross compiler, rtl units and cross binutils are installed correctly) the project should compile successfully despite this warning. ---------------------------------------------------------------------- krolikbest · 2025-09-18 16:25 I did a test on my other computer with win10 64bit and the same Lazarus ver as in my first post and this time I could choose Target: Embedded and CPU: arm but no luck with compiling (please see photo below). No matter Target processor (tested: default, arm7, armv7em, ..). Not yet investigated what the error does mean. ---------------------------------------------------------------------- ccrause · 2025-09-18 16:57 Disable line info option.  There is no lnfodwrf unit provided for embedded targets. ---------------------------------------------------------------------- krolikbest · 2025-09-18 17:28 Aha!  Very helpful hint. Thank you. However.. one must remember to avoid spaces in saving path of project. After saving project files and attempting to compile I got a message (in attachment). Then I recollected a similar problem related to spaces in directories. No spaces no problem ---------------------------------------------------------------------- krolikbest · 2025-09-24 13:48 Hi,  if a program for pico looks like 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 program prg1;{$MODE OBJFPC}{$H+}{$MEMORY 10000,10000}  beginend.then there is not a problem to compile but if it looks like 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 program prg1;{$MODE OBJFPC}{$H+}{$MEMORY 10000,10000}  uses pico_gpio_c, pico_timer_c; beginend.  I get error during compiling. The error says Quotepico_c.pas(195,15) Error: Identifier not found "resets" Use Win10/64bit, FPC 3.2.2. The file pico_c.pas obtained from picoexamples4fpc. ---------------------------------------------------------------------- avra · 2025-09-25 09:21 Maybe identifier was not defined in FPC 3.2.2 and you need more fresh version? Have you tried FPC trunk? That would probably need newer Lazarus as well... ---------------------------------------------------------------------- ccrause · 2025-09-25 09:48 Quote from: avra on September 25, 2025, 11:21:48 amMaybe identifier was not defined in FPC 3.2.2 and you need more fresh version? Correct, the RP2040 unit was added after FPC 3.2.2 was released.  Thus one needs to build a new compiler based on the FPC main source branch.  As per the wiki, one only needs FPC 3.2.2 to bootstrap the new compiler version. ---------------------------------------------------------------------- krolikbest · 2025-09-25 12:21 That's how I felt it should be, but I didn't want to change my Laz/fpc instalations. Anyway thanks a lot guys for explanations. ---------------------------------------------------------------------- krolikbest · 2025-09-27 08:47 Hi, it's me again.. sorry to bother anybody but I installed fpc+Laz using button PICO from  fpcupdeluxe. Now if I choose new simply project (like begin end.) and set in config OS-embedded, Family-arm, Processor=armv6m, deselect in Debugging option Display Line Number I get this(see please image1). How to fix it? It looks that I'm back at beginning of this topic ---------------------------------------------------------------------- avra · 2025-09-27 13:40 Did you build a cross compiler for your target in fpcupdeluxe? Did you use the new desktop shortcut made for PICO Laz/FPC combo? ---------------------------------------------------------------------- ccrause · 2025-09-27 13:47 Quote from: krolikbest on September 27, 2025, 10:47:44 amHi, it's me again.. sorry to bother anybody but I installed fpc+Laz using button PICO from  fpcupdeluxe. Now if I choose new simply project (like begin end.) and set in config OS-embedded, Family-arm, Processor=armv6m, deselect in Debugging option Display Line Number I get this(see please image1). How to fix it? It looks that I'm back at beginning of this topic As already mentioned, Lazarus performs some checks, but it is not perfect so ignore the error.  What happens when you click OK, then build an empty project? ---------------------------------------------------------------------- krolikbest · 2025-09-27 17:32 Compilation attempt of blinking example ended up successfully. I have one more small question about the configuration in Lazarus: if I start new project (for Pico) it would be nice to check someting in the project that this is for Pico, so then all necesarry options like Quote-Wpraspi_pico -godwarfsets -godwarfcpp -XuI wouldn't have to add them manually; they would be added automatically after selecting a project for Pico. I'm not sure if am I making myself clear? Maybe I've even seen it somewhere before, but I forgot how to do it... ---------------------------------------------------------------------- DonAlfredo · 2025-09-28 06:22 In case of the Lazarus error you encountered, you might try to rescan the FPC sources. See: https://github.com/LongDirtyAnimAlf/fpcupdeluxe/issues/779#issuec omment-3275789669 ---------------------------------------------------------------------- krolikbest · 2025-09-28 12:07 In my case it doesn't help, but I can live with such harmless (presumably) error. ---------------------------------------------------------------------- dbannon · 2025-09-29 08:57 Quote from: krolikbest on September 27, 2025, 07:32:01 pmCompilation attempt of blinking example ended up successfully. I have one more small question about the configuration in Lazarus: if I start new project (for Pico) it would be nice to check someting in the project that this is for Pico, so then all necesarry options like Quote-Wpraspi_pico -godwarfsets -godwarfcpp -XuI wouldn't have to add them manually; they would be added automatically after selecting a project for Pico. I'm not sure if am I making myself clear? Maybe I've even seen it somewhere before, but I forgot how to do it... I am not aware of  specific define for the Pico but CPUARM should be defined. So, possibly, if you are not doing any other ARM work, you could add Code: [Select]#ifdef CPUARM -Wpraspi_pico -godwarfsets -godwarfcpp -Xu #endif into your fpc.cfg file. Untested ! Davo ---------------------------------------------------------------------- krolikbest · 2025-09-29 18:33 Good point, although I compile to RPi 3/4 as well, but maybe it can be distinguished somehow with a compilation directive too? Btw, I installed in my trunk Fpc/Lazarus  pas2js rtl/WCL. It was not simply..Somehow, the pas2js version installed with fpcupdeluxe compiled the project, but opening project1.html in the browser didn't look right. I removed that version and manually installed version 2.2.0. I have the same version installed in Lazarus 2.2.6. Now, if I have a moment, I'll connect a LAN adapter to my PICO and try to write an HTTP server with gui made with pas2js ---------------------------------------------------------------------- dbannon · 2025-09-30 05:11 Quote from: krolikbest on September 29, 2025, 08:33:50 pmGood point, although I compile to RPi 3/4 as well, but maybe it can be distinguished somehow with a compilation directive too? Hmm, RasPi3 is 64bit but because of limited hardware, some people recommend using the 32bit OS. I don't, so, I can depend on #ifdef CPUAARCH64  I'd expect there to be some define specific for the Pico but I cannot find it, might be a case of reading through the source ? I have never touch pas2js, no idea I am afraid. Davo