mir toolset not working lazarus / 79-Embedded - ARM ---------------------------------------------------------------------- petex · 2021-03-11 09:11 hello, did a bog standard install of toolset from fcupdeluxe. Get error compiling project1. QuoteCompile Project, OS: embedded, CPU: arm, Target: C:\fpcupdeluxe- mir\projects\project1.elf: Exit code 1, Errors: 1, Hints: 2 Hint: Start of reading config file C:\fpcupdeluxe- mir\fpc\bin\x86_64-win64\fpc.cfg Hint: End of reading config file C:\fpcupdeluxe- mir\fpc\bin\x86_64-win64\fpc.cfg Verbose: Free Pascal Compiler version 3.3.1-r48734 [2021/03/11] for arm Verbose: Copyright (c) 1993-2021 by Florian Klaempfl and others Verbose: Target OS: Embedded Verbose: Compiling C:\fpcupdeluxe-mir\projects\project1.lpr Verbose: PPU Loading C:\fpcupdeluxe-mir\fpc\units\arm- embedded\system.ppu Verbose: PPU is compiled for another processor Fatal: Can't find unit system used by Project1 Verbose: Compilation aborted Verbose: C:\fpcupdeluxe-mir\fpc\bin\x86_64-win64\ppcrossarm.exe returned an error exitcode install options shown in attached ---------------------------------------------------------------------- MiR · 2021-03-11 09:54 Just for me to understand: You tried to compile the empty default project that opens up when you have built & installed a fresh copy of fpcupdeluxe? Or did you open one of your projects and that one failed? please provide a copy of the lpi file you used... ---------------------------------------------------------------------- petex · 2021-03-11 13:09 i installed a fresh instance of lazarus,fpc and embedded compiler. I then tried to build a working project using the existing compiler i have been using for embedded and I got the error. I then created a new project, changed the target to embedded with no compiler switches and i got the same error. Am i using the correct combination in fcup ? I am using the toolset to build STM32 projects and I thought I would keep up with latest changes, especially with the pico. ---------------------------------------------------------------------- MiR · 2021-03-11 13:15 only setting embedded is not enough you have to tell the system to use arm, subarch and put in a correct -Wp. Please clone the pico repository and open an lpi provided there and try compile. Sharing your lpi will make helping you a lot easier, my magic glass spere is a litty cloudy atm, I cannot see what you actually tried to do... Also it is important to have the correct subarch compiler, please check the doku on the wiki.... https://wiki.freepascal.org/ARM_Embedded_Tutorial_- _Installing_Lazarus_and_Free_Pascal ---------------------------------------------------------------------- ASBzone · 2021-03-11 13:16 What folders did you install the new and old instances into? You will need to provide more info to get good troubleshooting assistance... ---------------------------------------------------------------------- petex · 2021-03-11 15:47 project 1 LPI file Code: XML  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i                                                                           <UseAppBundle Value="False"/>      <ResourceType Value="res"/>    </General>    <BuildModes Count="1">      <Item1 Name="Default" Default="True"/>    </BuildModes>    <PublishOptions>      <Version Value="2"/>      <UseFileFilters Value="True"/>    </PublishOptions>  <RunParams>      <FormatVersion Value="2"/>    </RunParams>    <Units Count="1">      <Unit0>        <Filename Value="project1.lpr"/>      <IsPartOfProject Value="True"/>      </Unit0>    </Units>  </ProjectOptions>  <CompilerOptions>    <Version Value="11"/>    <PathDelim Value="\"/>    <Target>      <Filename Value="project1"/>  </Target>    <SearchPaths>      <IncludeFiles Value="$(ProjOutDir)"/>      <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>    </SearchPaths>    <CodeGeneration>      <TargetProcessor Value="ARMV7M"/>      <TargetCPU Value="arm"/>      <TargetOS Value="embedded"/>    </CodeGeneration>    <Other>      <CustomOptions Value="-Wpbluepill- dbluepill-godwarfsets-godwarfcpp"/>    </Other>  </CompilerOptions>  <Debugging>    <Exceptions Count="3">      <Item1>        <Name Value="EAbort"/>      </Item1>      <Item2>        <Name Value="ECodetoolError"/>      </Item2>      <Item3>        <Name Value="EFOpenError"/>      </Item3>    </Exceptions>  </Debugging></CONFIG>    Toolset was installed to "C:\fpcupdeluxe-mir" ---------------------------------------------------------------------- MiR · 2021-03-11 17:40 The relevant entries are in, did you compile a cross compiler for armv7m? If that is the case then try a full clean before build. Minor thing: -dbluepill is not needed anymore unless you need it for yourself. I just now realized this entry: Verbose: PPU Loading C:\fpcupdeluxe-mir\fpc\units\arm- embedded\system.ppu and that is likely the cause of the issues. This directory should be C:\fpcupdeluxe-mir\fpc\units\arm- embedded\armv7m/eabi/rtl/system.ppu Not sure how this happened, can you please put your fpcupdeluxe binary in an empty directory, then delete fpcupdeluxe-mir and start fpcupdeluxe from the empty directory? Then select sgain the  C:\fpcupdeluxe-mir directory and build fpc+lazarus and then build the compiler for arm-embedded armv7m. Do not modify the settings in the subarch dialog, only select the subarch you would like to use and close the dialog ---------------------------------------------------------------------- petex · 2021-03-11 19:38 OK, have re-installed as directed. Now get "Fatal: Can't find unit lnfodwrf used by project1" - had this before, can't remember how it was corrected though. QuoteCompile Project, OS: embedded, CPU: arm, Target: project1.elf: Exit code 1, Errors: 1, Hints: 2 Hint: Start of reading config file C:\fpcupdeluxe- mir\fpc\bin\x86_64-win64\fpc.cfg Hint: End of reading config file C:\fpcupdeluxe- mir\fpc\bin\x86_64-win64\fpc.cfg Verbose: Free Pascal Compiler version 3.3.1-r48734 [2021/03/11] for arm Verbose: Copyright (c) 1993-2021 by Florian Klaempfl and others Verbose: Target OS: Embedded Verbose: Compiling project1.lpr Fatal: Can't find unit lnfodwrf used by project1 Verbose: Compilation aborted Verbose: C:\fpcupdeluxe-mir\fpc\bin\x86_64-win64\ppcrossarm.exe returned an error exitcode ---------------------------------------------------------------------- MiR · 2021-03-11 19:51 Sorry, no idea, I think I had this once when I compiled code with -dDEBUG but I may be totally wrong here. Can you please clone pico code (and install armv6m crosscompiler) or compile some mbf projects to find out if it is your project or a general problem? ---------------------------------------------------------------------- DonAlfredo · 2021-03-11 20:08 Disable line-info in debug options or disable debug as a whole. ---------------------------------------------------------------------- petex · 2021-03-12 16:33 ok, all is well, can compile my existing projects and the pico blinky project. The pico bootloader runs the blinky.uf2 file ok. I have been using a Raspberry PI to run the openocd remote gdb debugger with the STM32. I now want to use the same configuration with the pico. (I do not have a second pico which looks like the easy option) I cannot find the 2040 configuration for it. Any ideas on how to get this working. (I am upgrading openocd on the PI at the moment- but it takes a long time) ---------------------------------------------------------------------- MiR · 2021-03-12 16:41 https://datasheets.raspberrypi.org/pico/getting-started-with-pico.pdf has you covered. Google would also been able to tell you so. ---------------------------------------------------------------------- petex · 2021-03-12 21:21 Well, i looked at the docu and re-installed openocd using the recommended script. Got the debugger working with the pico blinky build with a gdb server on the rpi. Great!! My original STM32 setup however has been prevented from working. It initially complained about the target speed not set, so i added "adapter speed 1000" to prevent that error but the GDB server doesn't start..... There's also confusion about whether it should be "adapter_khz 1000" Seems that openocd has been changed and is not backwards compatible. At least i won't need a haircut. Quotepen On-Chip Debugger 0.10.0+dev-gf8e14ec-dirty (2021-03-12-18:04) Licensed under GNU GPL v2 For bug reports, read    http://openocd.org/doc/doxygen/bugs.html /usr/local/bin/../share/openocd/scripts/target/swj-dp.tcl:32: Error: Unknown param: 4, try one of: -irlen, -irmask, -ircapture, -enable, -disable, -expected-id, -ignore-version, -dp-id, or -instance-id in procedure 'script' at file "embedded:startup.tcl", line 26 at file "openocd.cfg", line 9 in procedure 'swj_newdap' called at file "stm32f1x.cfg", line 46 at file "/usr/local/bin/../share/openocd/scripts/target/swj-dp.tcl", line 32 Info : Listening on port 6666 for tcl connections Info : Listening on port 4444 for telnet connections Info : BCM2835 GPIO JTAG/SWD bitbang driver Info : clock speed 1006 kHz Warn : gdb services need one or more targets defined ---------------------------------------------------------------------- MiR · 2021-03-12 21:44 You could try to recompile your old version again and install it in another directory (or use it from the directory where you compiled it) ---------------------------------------------------------------------- petex · 2021-03-13 09:52 luckily i have put the source and compilations in two separate folders.(these took a very long time to do) So at the moment i can re- install the required version with Quotesudo make install That doesn't take long. I am not enough of a unix wizard to simplify the job. ---------------------------------------------------------------------- MiR · 2021-03-13 10:33 Don't do that, you will very likely overwrite the installation for the pico. install it to another directory (sudo make install DESTDIR=/opt/openocd-rpi) or use it from the directory where you compiled it. ---------------------------------------------------------------------- petex · 2021-03-13 17:54 Thanks. I did realise that. I would not very likely overwrite it but certainly overwrite it I was hoping that by the time I figured how to have two separate installations, the openocd guys would have an universal installation !