Recent

Author Topic: mir toolset not working  (Read 5022 times)

petex

  • Jr. Member
  • **
  • Posts: 69
mir toolset not working
« on: March 11, 2021, 10:11:39 am »
hello,
did a bog standard install of toolset from fcupdeluxe. Get error compiling project1.

Quote
Compile 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

  • Sr. Member
  • ****
  • Posts: 250
Re: mir toolset not working
« Reply #1 on: March 11, 2021, 10:54:38 am »
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

  • Jr. Member
  • **
  • Posts: 69
Re: mir toolset not working
« Reply #2 on: March 11, 2021, 02:09:15 pm »
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

  • Sr. Member
  • ****
  • Posts: 250
Re: mir toolset not working
« Reply #3 on: March 11, 2021, 02:15:57 pm »
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

  • Hero Member
  • *****
  • Posts: 678
  • Automation leads to relaxation...
    • Free Console Utilities for Windows (and a few for Linux) from BrainWaveCC
Re: mir toolset not working
« Reply #4 on: March 11, 2021, 02:16:39 pm »
What folders did you install the new and old instances into?

You will need to provide more info to get good troubleshooting assistance...
-ASB: https://www.BrainWaveCC.com/

Lazarus v2.2.7-ada7a90186 / FPC v3.2.3-706-gaadb53e72c
(Windows 64-bit install w/Win32 and Linux/Arm cross-compiles via FpcUpDeluxe on both instances)

My Systems: Windows 10/11 Pro x64 (Current)

petex

  • Jr. Member
  • **
  • Posts: 69
Re: mir toolset not working
« Reply #5 on: March 11, 2021, 04:47:40 pm »
project 1 LPI file


Code: XML  [Select][+][-]
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <CONFIG>
  3.   <ProjectOptions>
  4.     <Version Value="12"/>
  5.     <PathDelim Value="\"/>
  6.     <General>
  7.       <Flags>
  8.         <MainUnitHasCreateFormStatements Value="False"/>
  9.         <MainUnitHasTitleStatement Value="False"/>
  10.         <MainUnitHasScaledStatement Value="False"/>
  11.         <CompatibilityMode Value="True"/>
  12.       </Flags>
  13.       <SessionStorage Value="InProjectDir"/>
  14.       <Title Value="project1"/>
  15.       <UseAppBundle Value="False"/>
  16.       <ResourceType Value="res"/>
  17.     </General>
  18.     <BuildModes Count="1">
  19.       <Item1 Name="Default" Default="True"/>
  20.     </BuildModes>
  21.     <PublishOptions>
  22.       <Version Value="2"/>
  23.       <UseFileFilters Value="True"/>
  24.     </PublishOptions>
  25.     <RunParams>
  26.       <FormatVersion Value="2"/>
  27.     </RunParams>
  28.     <Units Count="1">
  29.       <Unit0>
  30.         <Filename Value="project1.lpr"/>
  31.         <IsPartOfProject Value="True"/>
  32.       </Unit0>
  33.     </Units>
  34.   </ProjectOptions>
  35.   <CompilerOptions>
  36.     <Version Value="11"/>
  37.     <PathDelim Value="\"/>
  38.     <Target>
  39.       <Filename Value="project1"/>
  40.     </Target>
  41.     <SearchPaths>
  42.       <IncludeFiles Value="$(ProjOutDir)"/>
  43.       <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
  44.     </SearchPaths>
  45.     <CodeGeneration>
  46.       <TargetProcessor Value="ARMV7M"/>
  47.       <TargetCPU Value="arm"/>
  48.       <TargetOS Value="embedded"/>
  49.     </CodeGeneration>
  50.     <Other>
  51.       <CustomOptions Value="-Wpbluepill
  52. -dbluepill
  53. -godwarfsets
  54. -godwarfcpp"/>
  55.     </Other>
  56.   </CompilerOptions>
  57.   <Debugging>
  58.     <Exceptions Count="3">
  59.       <Item1>
  60.         <Name Value="EAbort"/>
  61.       </Item1>
  62.       <Item2>
  63.         <Name Value="ECodetoolError"/>
  64.       </Item2>
  65.       <Item3>
  66.         <Name Value="EFOpenError"/>
  67.       </Item3>
  68.     </Exceptions>
  69.   </Debugging>
  70. </CONFIG>
  71.  
  72.  
  73.  

Toolset was installed to "C:\fpcupdeluxe-mir"


MiR

  • Sr. Member
  • ****
  • Posts: 250
Re: mir toolset not working
« Reply #6 on: March 11, 2021, 06:40:19 pm »
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

  • Jr. Member
  • **
  • Posts: 69
Re: mir toolset not working
« Reply #7 on: March 11, 2021, 08:38:16 pm »
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.


Quote
Compile 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

  • Sr. Member
  • ****
  • Posts: 250
Re: mir toolset not working
« Reply #8 on: March 11, 2021, 08:51:59 pm »
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

  • Hero Member
  • *****
  • Posts: 1739
Re: mir toolset not working
« Reply #9 on: March 11, 2021, 09:08:02 pm »
Disable line-info in debug options or disable debug as a whole.

petex

  • Jr. Member
  • **
  • Posts: 69
Re: mir toolset not working
« Reply #10 on: March 12, 2021, 05:33:50 pm »
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

  • Sr. Member
  • ****
  • Posts: 250
Re: mir toolset not working
« Reply #11 on: March 12, 2021, 05:41:31 pm »
https://datasheets.raspberrypi.org/pico/getting-started-with-pico.pdf

has you covered. Google would also been able to tell you so.

petex

  • Jr. Member
  • **
  • Posts: 69
Re: mir toolset not working
« Reply #12 on: March 12, 2021, 10:21:41 pm »
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.



Quote
pen 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

  • Sr. Member
  • ****
  • Posts: 250
Re: mir toolset not working
« Reply #13 on: March 12, 2021, 10:44:45 pm »
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

  • Jr. Member
  • **
  • Posts: 69
Re: mir toolset not working
« Reply #14 on: March 13, 2021, 10:52:00 am »
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

Quote
sudo make install

That doesn't take long. I am not enough of a unix wizard to simplify the job.

 

TinyPortal © 2005-2018