Welcome! Log In Create A New Profile

Advanced

RepRapFirmware CMake Build

Posted by likha3d 
RepRapFirmware CMake Build
June 30, 2020 08:59AM
Hi folks, just posting about some stuff some might find interesting!

I'm doing some work to port RepRapFirmware to another chip (non-ARM). I've found using Eclipse thing to be somewhat cumbersome, and have done some work to add support so that it can be built with CMake.
The repo is here: [github.com] (branch name is v3-cmake-build), which also contains the instructions. I am hoping to be able to upstream the changes, so feedback is welcome (especially pain points on the instructions and ease of build).

Hopefully, this makes RepRapFirmware more accessible to other developers: those who don't want to use an IDE, and those who want to use another IDE (CLion supports CMake natively; theoretically can generate project files for Visual Studio). Since this allows building in the command-line, this should also facilitate
builds in CI.
Re: RepRapFirmware CMake Build
July 01, 2020 12:52AM
Yeah I'm not a fan of the eclipse setup either which is one reason why I didn't use it when I did the LPC port of RRF.

I notice that every source file is individually listed in the sources in the cmake version. So every time a new file is added, renamed or moved the makefiles will need updating - personally I think this would get a bit frustrating to update them every time that occurs.

What chip/board are you porting to?
Re: RepRapFirmware CMake Build
July 01, 2020 03:25AM
I'm trying to port it to ESP32. The build system is the least of my problems though - there are some pain points on `include`s, for example which makes it hard to do the port piecewise.

Regarding listing source files manually, it's a CMake best practice kinda thing. From [cmake.org]:

Quote

Note We do not recommend using GLOB to collect a list of source files from your source tree. If no CMakeLists.txt file changes when a source is added or removed then the generated build system cannot know when to ask CMake to regenerate.

It's also generally written about by other people: [gist.github.com], [github.com].
Re: RepRapFirmware CMake Build
July 01, 2020 06:22AM
Ah right. I haven't used cmake much before, I looked at it briefly for the LPC port couple of years ago but didn't like it so stuck with makefiles (which fortunately didn't need much maintenance over the years).

I did an initial partial port of RRF v2.01 for the ESP32 quite a while ago. Just enough to get it the main part running, loading configs from sd, connecting to WIFI with dwc and IO extenders etc, but didn't get around to finishing the stepping etc. It would be good to see a RRF V3 running on the esp - good luck with the port.
Re: RepRapFirmware CMake Build
July 02, 2020 05:32AM
@sdavi Yeah, the ESP has a lot to offer. I'm actually not planning to have the final target to be ESP32, but ESP32-S2 (or a speculated successor). It has more pins and native USB.


Update: The branch now builds for Duet Maestro and Duet 3!
PCR
Re: RepRapFirmware CMake Build
July 02, 2020 03:50PM
@likha3d

A STM32 Port would.be great winking smiley


Best
Re: RepRapFirmware CMake Build
July 02, 2020 08:13PM
From the entry on RepRap wiki, it mentions an ongojng effort to port RRF to STM. There was also some guy porting it to his STM32 based board [3dtoday.ru] . Don't know the status of these though.
PCR
Re: RepRapFirmware CMake Build
July 04, 2020 01:06AM
Yep. This is the Guy. But no new Information yet ;(
Re: RepRapFirmware CMake Build
July 06, 2020 11:11AM
are you going to do the same for the 3.1 branch (the current release) and the 3.2 branch (the next release)?


Based in Darlington, North East
Re: RepRapFirmware CMake Build
July 08, 2020 02:36AM
The plan is to periodically merge v3-dev into the cmake branch. I couldn't build 3.1.1 (might be versions mismatch between required libraries), so Im going to wait a little while. I could not find resources on what commits of each library goes into the releases build.

Edited 1 time(s). Last edit at 07/08/2020 02:37AM by likha3d.
Re: RepRapFirmware CMake Build
July 09, 2020 02:19AM
Use the library commits tagged 3.1.0 for the RRF 3.1.1 build.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: RepRapFirmware CMake Build
August 02, 2021 07:28AM
Update: This builds both half of RepRapFirmware for Luna: [reprap.org].

Edited 1 time(s). Last edit at 08/02/2021 07:30AM by likha3d.
Sorry, only registered users may post in this forum.

Click here to login