Welcome! Log In Create A New Profile

Advanced

LPC port of RepRapFirmware

Posted by sdavi 
Re: LPC port of RepRapFirmware
August 01, 2018 10:16PM
Quote
AlexY
What's the current state of the v2 branch? If it's able to run a full print I'll try it otherwise I'll clone 1.21 first.

How is board selection done in RRF? In Marlin it's done by defining the motherboard in the config but I don't see something similar here. Also, does RRF use the onboard SD reader or the reader on the LCD controller?

Start with 1.21, i've attached the makefile i used (it is bit of a mess cause i just kept adding to it over time). The board selection is defined in the makefile (just passed as compiler flags), the only 2 options you really need to change in the makefile are BOARD and NETWORKING. The BOARD value you set will be used as the ifdef in the pins_lpc to select the variant. If your using eclipse or something else look at the makefile flags to see the other defines you also need to set.

The onboard SDCard is expected to be present at boot to read the config files etc. The last lpc 1.21 version checked in didnt support the external card - this is added in V2 (although it still expects the internal card to be present).
Attachments:
open | download - makefile (7.7 KB)
Re: LPC port of RepRapFirmware
August 02, 2018 10:04PM
Getting the projects set up now. What build configuration should I use to build CoreLPC?
Re: LPC port of RepRapFirmware
August 02, 2018 11:02PM
The makefile is configured to build both CoreLPC and RepRapFirmware. If you just want to build the core run make coreLPC which will build core.a. I've only used the makefile on macOS so it may need some changes on other OSes.
Re: LPC port of RepRapFirmware
August 03, 2018 07:04AM
Thanks for the update, @sdavi. The Re-Arm port has been working well with the exception of disconnecting when viewing the gcode file directory via DWC. Hoping 2.0 is able to fix that.

While I'm typing, I'd just like to reiterate how much I love RRF and DWC! I had to use manual probing for delta auto calibration and it was SO easy to do within DWC. This was on a real Duet Wifi.

Edited 1 time(s). Last edit at 08/03/2018 07:04AM by digi2life.
Re: LPC port of RepRapFirmware
August 04, 2018 03:43PM
@sdavi Is it ok to comment out the SharedSpi lines in the makefile? I'm not using an SPI thermocouple and the build is failing because it can't find the SharedSpi folder.
Re: LPC port of RepRapFirmware
August 04, 2018 08:18PM
Quote
AlexY
@sdavi Is it ok to comment out the SharedSpi lines in the makefile? I'm not using an SPI thermocouple and the build is failing because it can't find the SharedSpi folder.

Ah yeah, sorry I forgot I changed the makefile when i started the sharedSPI in V1 branch before moving over to V2 - it's failing cause it's bringing in the LCD and SPI heat sensor sources which need sharedspi. I dug up the makefile from my backups near the date of the last commit so this one should compile. See attached.
Attachments:
open | download - makefile (7.7 KB)
Re: LPC port of RepRapFirmware
August 04, 2018 11:41PM
Getting an error on line 242 about 'cc' being an unrecognized debug level. Commented out the -gcc option and it seems to work. What effect does that option have?
Re: LPC port of RepRapFirmware
August 05, 2018 01:37AM
Quote
AlexY
Getting an error on line 242 about 'cc' being an unrecognized debug level. Commented out the -gcc option and it seems to work. What effect does that option have?

Yeah that's ok, i had to do the same thing just recently when upgrading to the latest arm compiler as well.
Re: LPC port of RepRapFirmware
August 06, 2018 04:15PM
Unfortunately it looks like the board hangs on startup with the hotend fan on full. Might be a pin config error but not sure how to debug.
Re: LPC port of RepRapFirmware
August 07, 2018 01:06AM
Quote
AlexY
Unfortunately it looks like the board hangs on startup with the hotend fan on full. Might be a pin config error but not sure how to debug.

Few things to check. Make sure networking is disabled if there is none - the manual says the cpu can get locked if the reference clocks are not present on the pins when configuring ethernet. Using the Non networking version (set NETWORKING to false in the makefile) is a good place to start anyway as there is a lot more RAM free to make sure its not a out of memory issue.

Use a simple terminal program to connect rather than one of the printer host programs as some will wait for certain responses etc. And connect to the board as soon as possible to see any output which can help to see where it is getting up to (and adding in any extra print statements can help too).

If you attach the new pin config header file I can have a look over it.
Re: LPC port of RepRapFirmware
August 07, 2018 10:34AM
Here is the LPC folder. Networking should be disabled in the makefile, but I'll double check. I noticed that some of the pins in the special pin map overlap with some of the used pins. Could this cause the issue?

Edited 1 time(s). Last edit at 08/07/2018 10:39AM by AlexY.
Re: LPC port of RepRapFirmware
August 08, 2018 12:15AM
Quote
AlexY
Here is the LPC folder. Networking should be disabled in the makefile, but I'll double check. I noticed that some of the pins in the special pin map overlap with some of the used pins. Could this cause the issue?

I had a quick look over the config and changed a few things (see attached) based on the smoothie config i found online for the board. The enable pin for X i think should be P0_4 and not P2_4 (which is also defined as the hotend heater pin). I also fixed the variable pin_port2_pos to match the stepper positions (its used when creating the bitmask for stepping).

If the board has a LED, the default in the CoreLPC is to flash the PLAY led (which is default P4_28 on most boards) from systick. It should change state every 0.5 seconds when everything is working.

I also compiled the AZSMZ and ran it on my AzteegX5 which seems to run just fine (using the attached updated header) - I can connect to it, run M122 etc etc.

It is also worth checking the config.g files, the fan may be turning on cause its configured to by M106 but you can change that to start off by setting S0 (the online configurator has first fan starting at 30% if you accept the defaults).

I've also attached the firmware.bin using the updated pins config to test if there are some other issues when your compiling.
Attachments:
open | download - firmware.bin (279.6 KB)
open | download - AZSMZ.h (6 KB)
Re: LPC port of RepRapFirmware
August 08, 2018 06:52PM
Looks like the fixes helped! I had to run make distclean first since simply trying to make didn't change anything. I can talk to the board now
Re: LPC port of RepRapFirmware
August 08, 2018 08:29PM
I'm having a weird issue with fan PWM. The fan only turns on at 50% and runs at full speed from 50-100%. Looks like it's not trying to PWM at all. However, when the fan turns off, the fan LED slowly fades out instead of abruptly turning off. The hotend seems to PWM just fine, so I'm not really sure what could be causing the issue.
Re: LPC port of RepRapFirmware
August 09, 2018 12:18AM
Quote
AlexY
I'm having a weird issue with fan PWM. The fan only turns on at 50% and runs at full speed from 50-100%. Looks like it's not trying to PWM at all. However, when the fan turns off, the fan LED slowly fades out instead of abruptly turning off. The hotend seems to PWM just fine, so I'm not really sure what could be causing the issue.

It seems RRF expects the fan to be on a Hardware PWM, and P2_7 is not a H/W PWM capable pin, so it will resort to a digital out (as you are currently experiencing).

There are still some hardware timers free which you could use to generate the PWM signals using interrupts. Each timer has 4 match registers so you just set one to the PWM period which triggers interrupt + timer reset and set pins high, and you'd have 3 match registers left to generate interrupts for 3 outputs (with the same PWM frequency) and setting the corresponding pin low. Have a look at the Step and Network timer code in platform.cpp on how to setup the timers. This is something I might look at adding to the v2 code later.
Re: LPC port of RepRapFirmware
August 12, 2018 02:15PM
@sdavi, if you need to free up more memory here is another possibility. Currently each DDA has a table of pointers to possible DriveMovement objects. There is also a pointer to a linked list of these DriveMovement objects, in step-time order, which is filled in by Prepare(). I had it in mind to do away with the table of pointers and use just the linked list. To this end, most accesses to DMs by drive are done by calling FindDM(drive). Currently this uses the table; but it could search the linked list instead.

So you could:

- Do away with the table 'dmp' in the DDA, saving (4 * DRIVES * number_of_DDAs) bytes.
- Change FindDM to search the linked list for the DM for the specified drive instead of using the table
- When allocating DMs in DDA::Init(), link them into the linked list instead of entering them in the table
- Change DDA:: Step() so that when a DM has completed its steps, it is re-inserted into the link list after all still-active DMs
- Change DDA:: Step so that it considers the move is complete when the first DM in the linked list is complete, instead of when the linked list is empty
- Change Move:: Spin() to free up DMs from the linked list of completed DDAs instead of from the table

I may implement this in a future release myself.

btw my latest commits to branch v2-dev include an experimental feature called Dynamic Acceleration Adjustment. This increases the size of both the DDAs and the DMs; so you may wish to avoid taking this change at least until the feature is proven to be useful.

HTH David

Edited 2 time(s). Last edit at 08/12/2018 02:16PM by dc42.


Delta printer calibration calculator, mini IR Z probe, and colour touch screen control panel: [escher3d.com]

Large delta printer, and other 3D printer blog postings: [miscsolutions.wordpress.com]

Disclosure: I have a financial interest in sales of the Panel Due, Mini IR height sensor, and Duet WiFi/Duet Ethernet.
Sorry, only registered users may post in this forum.

Click here to login