Skip to content
This repository was archived by the owner on Jul 9, 2020. It is now read-only.

Commit 6f0841a

Browse files
committed
Merge remote-tracking branch 'dc42/dev' into v2-dev-lpc
1 parent 14e91f8 commit 6f0841a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1294
-1334
lines changed

.cproject

Lines changed: 248 additions & 827 deletions
Large diffs are not rendered by default.

BuildInstructions.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ RepRapFirmware is built from several Github projects. You need to use compatible
4949

5050
14. Build CoreNG first, also build FreeRTOS and RRFLibraries if needed. Then clean and build RepRapFirmware (the clean step is needed to make Eclipse notice that the output library files in the other projects have been built). The Duet WiFi and Duet Ethernet builds of RRF use the SAM4E_RTOS builds of CoreNG and RRFLibraries and the SAM4E build of FreeRTOS. The Duet Maestro uses the SAM4S_RTOS build of CoreNG and RRFLibraries, and the SAM4S build of FreeRTOS. The Duet085 build of RRF (which also runs on the Duet06) uses the SAM3X build of CoreNG and RRFLibraries. The RADDS build of RRF uses the RADDS_RTOS build of CoreNG and the SAM3X_RTOS build of RRFLibraries.
5151

52+
Note: you do not need to build the DuetWiFiSocketServer project, but it does need to be in the workspace because the RepRapFirmware project uses one of its include fies.
53+
5254
**Instructions for building under macOS**
5355

5456
Using Homebrew-Cask makes it very easy to install new software on macOS: https://caskroom.github.io/
@@ -64,3 +66,8 @@ Using Homebrew-Cask makes it very easy to install new software on macOS: https:/
6466
6. The build depends on the Eclipse workspace variable 'ArmGccPath" being set to the directory where your arm-none-eabi-g++ compiler resides. To set it, go to Windows -> Preferences -> C/C++ -> Build -> Build Variables and click "Add..."
6567

6668
7. Build CoreNG, FreeRTOS and RRFLibraries first, then RepRapFirmware. See the instructions for Windows (above) for the configurations needed.
69+
70+
**Building under Debian Linux**
71+
72+
See this forum post https://forum.duet3d.com/topic/11703/building-reprap-firmware-on-debian-buster
73+

WHATS_NEW.md

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,48 @@
11
Summary of important changes in recent versions
22
===============================================
33

4-
Version 2.04RC1
5-
============
4+
Version 2.04
5+
===============
66
Compatible files:
77
- DuetWiFiServer 1.23
8-
- DuetWebControl 1.22.6 or 2.0.0-RC6 or 2.0.0-RC7
8+
- DuetWebControl 2.0.4 (recommended) or 1.22.6
99

1010
Upgrade notes:
11+
- If using this release to control a laser cutter/engraver, see the notes below on changed handling of the G1 S parameter
12+
- If you are using a simple microswitch as a filament monitor, you may need to add a pullup resistor (see below)
1113
- The P parameter of the G29 S0 (or plain G29) command has been withdrawn. See below under "changed behaviour".
1214

1315
Feature improvements/changed behaviour:
16+
- File uploads are now done to temporary files that are renamed when the upload succeeds; so that if an upload fails, an original file with the same name is not lost (thanks wilriker)
17+
- HTTP reply buffers now time out 8 seconds after they are allocated. This may resolve the out-of-buffer issues that some users experience.
18+
- In the resurrect.g file, the current tool is now selected (without running tool change files) before resurrect-prologue is called, so that resurrect-prologue can do extrusion commands after first doing M116 to wait for temperatures. After running resurrect-prologue.g, the tool is deselected (without running tfree#.g), then reselected this time running tpre#.g and tpost#.g.
19+
- Pullup resistors are no longer enabled on endstop inputs used to connect filament monitors when they are configured using M591. This is to increase noise immunity when running Duet3D or other active filament monitors. If you are using a simple microswitch connected between STP and GND of an endstop input, you might need to add an external pullup resistor between STP and +3.3V, especially when using the endstop inputs on the CONN_LCD connector.
20+
- The new status information provided by Duet3D magnetic filament monitors with version 3 firmware is now supported
21+
- Estimated print time and filament usage comments written by KISSLicer 2 alpha are recognised
22+
- mDNS is now supported on the Duet Ethernet and Duet Maestro
23+
- In Laser mode, if sticky laser power mode is selected, the power set by the S parameter in a G1 command is remembered across G0 moves to the next G1 move
24+
- CRC checking of uploaded file data is now supported (requires DWC 2.0.4)
25+
- When an error occurs reading or writing SD card data, the number of retries is increased to 5 and the delay between retries increases with each retry
26+
- Increased minimum motor current for open load warnings from 300 to 500mA
27+
- When writing the resurrect.g file, the active tool is selected before calling resurrect-prologue.g. This is to allow extrusion to be done in resurrect-prologue.g.
1428
- The P parameter of the G29 S0 (or plain G29) command has been withdrawn, because it didn't work when deployprobe.g and retractprobe.g files were used and wasn't easy to fix without wasting memory. A new subfunction G29 S3 P"name.csv" has been added to facilitate saving the height map file under a different name. It behaves the same as M374 P"name.csv".
1529
- M118 now appends '\n' to the message text except when the destination is http
1630
- G31 with no parameters now reports the G31 parameters of the current Z probe as well as the current reading
1731
- Support for pulse-generating filament sensors has been improved for the case that the sensor produces a high number of pulses per mm of filament movement
32+
- The M115 P parameter is now only supported in firmware builds that support more than one board variant, and only from within config.g during startup
33+
- If the SD card annote be mounted because no FAT filesystem was found, an explicit error messsge to this effect is provided instead of an error code
1834

1935
Bug fixes:
36+
- Fixed G30 commands when the M208 minimum Z position is much less than zero
37+
- Attempts to use file paths that are too long to store internally are now handled better
38+
- M675 did not take workplace coordinate offsets into account
39+
- Duet WiFi/Ethernet + DueX configurations did not start up if noise was present on the DueX endstop or GPIO inputs
40+
- The SHA1 hash reported by M38 sometimes had one or more zero digits missing
2041
- When auto delta calibration adjusted the delta radius and/or the diagonal rod length, it made an incorrect adjustment to the homed height
21-
- On a delta printer, if multiple rod lengths are specified in the M665 command and the first 3 rod lengths were not equal to each other, this resulted in incorrect motion
42+
- On a delta printer, if multiple rod lengths were specified in the M665 command and the first 3 rod lengths were not equal to each other, this resulted in incorrect motion
2243
- M557 with a P parameter but no XY or R parameters now reports an error
2344
- Attempts to jog axes 0.05mm beyond the limits set by M208 alternately succeeded/returned the axis to the limit
2445

25-
Internal changes:
26-
- Changes for compatibility with latest versions of CoreNG and RRFLibraries projects
27-
2846
Version 2.03
2947
============
3048
Compatible files:

src/Configuration.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ constexpr float DefaultMinFeedrate = 0.5; // The minimum movement speed (extr
5252
constexpr float DefaultAxisMinimum = 0.0;
5353
constexpr float DefaultAxisMaximum = 200.0;
5454

55-
constexpr float MinimumOpenLoadMotorCurrent = 300; // minimum current in mA for the open load status to be taken seriously
56-
5755
// Timeouts
5856
constexpr uint32_t FanCheckInterval = 500; // Milliseconds
5957
constexpr uint32_t OpenLoadTimeout = 500; // Milliseconds
@@ -84,15 +82,13 @@ constexpr float HOT_ENOUGH_TO_RETRACT = 90.0; // Celsius
8482

8583
constexpr unsigned int MaxBadTemperatureCount = 2000/HeatSampleIntervalMillis; // Number of bad temperature samples permitted before a heater fault is reported (2 seconds)
8684
constexpr float BadLowTemperature = -10.0; // Celsius
87-
constexpr float DefaultExtruderTemperatureLimit = 290.0; // Celsius - E3D say to tighten the hot end at 285C
85+
constexpr float DefaultHotEndTemperatureLimit = 290.0; // Celsius - E3D say to tighten the hot end at 285C
8886
constexpr float DefaultBedTemperatureLimit = 125.0; // Celsius
89-
constexpr float HotEndFanTemperature = 45.0; // Temperature at which a thermostatic hot end fan comes on
87+
constexpr float DefaultHotEndFanTemperature = 45.0; // Temperature at which a thermostatic hot end fan comes on
9088
constexpr float ThermostatHysteresis = 1.0; // How much hysteresis we use to prevent noise turning fans on/off too often
9189
constexpr float BadErrorTemperature = 2000.0; // Must exceed any reasonable temperature limit including DEFAULT_TEMPERATURE_LIMIT
9290
constexpr uint32_t DefaultHeaterFaultTimeout = 10 * 60 * 1000; // How long we wait (in milliseconds) for user intervention after a heater fault before shutting down
9391

94-
constexpr PwmFrequency MaxHeaterPwmFrequency = 1000; // maximum supported heater PWM frequency, to avoid overheating the mosfets
95-
9692
// Heating model default parameters. For the chamber heater, we use the same values as for the bed heater.
9793
// These parameters are about right for an E3Dv6 hot end with 30W heater.
9894
constexpr float DefaultHotEndHeaterGain = 340.0;
@@ -162,10 +158,13 @@ constexpr unsigned int FirstTmcDriversSenseChannel = 1001; // Sensors 1001..1002
162158
constexpr unsigned int NumTmcDriversSenseChannels = 2; // Sensors 1001..1002 are the TMC2660 driver temperature sense
163159

164160
// PWM frequencies
165-
constexpr unsigned int SlowHeaterPwmFreq = 10; // slow PWM frequency for bed and chamber heaters, compatible with DC/AC SSRs
166-
constexpr unsigned int NormalHeaterPwmFreq = 250; // normal PWM frequency used for hot ends
161+
constexpr PwmFrequency SlowHeaterPwmFreq = 10; // slow PWM frequency for bed and chamber heaters, compatible with DC/AC SSRs
162+
constexpr PwmFrequency NormalHeaterPwmFreq = 250; // normal PWM frequency used for hot ends
163+
constexpr PwmFrequency MaxHeaterPwmFrequency = 1000; // maximum supported heater PWM frequency, to avoid overheating the mosfets
164+
167165
constexpr PwmFrequency DefaultFanPwmFreq = 250; // increase to 25kHz using M106 command to meet Intel 4-wire PWM fan specification
168-
constexpr unsigned int DefaultPinWritePwmFreq = 500; // default PWM frequency for M42 pin writes and extrusion ancillary PWM
166+
constexpr PwmFrequency DefaultPinWritePwmFreq = 500; // default PWM frequency for M42 pin writes and extrusion ancillary PWM
167+
constexpr PwmFrequency ServoRefreshFrequency = 50;
169168

170169
// Default Z probe values
171170

@@ -207,8 +206,8 @@ static_assert(MaxCalibrationPoints <= MaxProbePoints, "MaxCalibrationPoints must
207206

208207
// SD card
209208
constexpr uint32_t SdCardDetectDebounceMillis = 200; // How long we give the SD card to settle in the socket
210-
constexpr unsigned int MaxSdCardTries = 3; // Number of read or write attempts before giving up
211-
constexpr uint32_t SdCardRetryDelay = 30; // Number of milliseconds delay between SD transfer retries. Looks like 10ms may be too low.
209+
constexpr unsigned int MaxSdCardTries = 5; // Number of read or write attempts before giving up
210+
constexpr uint32_t SdCardRetryDelay = 20; // Number of milliseconds delay between SD transfer retries. We now double for each retry.
212211

213212
// Z probing
214213
constexpr float DefaultZDive = 5.0; // Millimetres
@@ -357,6 +356,7 @@ constexpr size_t FILE_BUFFER_SIZE = 128;
357356
#define SCANS_DIRECTORY "0:/scans/" // Directory for uploaded 3D scans
358357
#define FILAMENTS_DIRECTORY "0:/filaments/" // Directory for filament configurations
359358
#define MENU_DIR "0:/menu/" // Directory for menu files
359+
#define UPLOAD_EXTENSION ".part" // Extension to a filename for a file being uploaded
360360

361361
#define CONFIG_FILE "config.g"
362362
#define CONFIG_BACKUP_FILE "config.g.bak"

src/Duet3_V03/Pins_Duet3_V03.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ const size_t NumFirmwareUpdateModules = 4; // 3 modules, plus one for manual up
3232
#define SUPPORT_OBJECT_MODEL 1
3333
#define SUPPORT_FTP 1
3434
#define SUPPORT_TELNET 1
35-
#define SUPPORT_ASYNC_MOVES 1
3635

3736
#define USE_CACHE 0 // Cache controller disabled for now
3837

src/Duet3_V05/Pins_Duet3_V05.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ const size_t NumFirmwareUpdateModules = 1;
3131
#define SUPPORT_OBJECT_MODEL 1
3232
#define SUPPORT_FTP 1
3333
#define SUPPORT_TELNET 1
34-
#define SUPPORT_ASYNC_MOVES 1
3534

3635
#define USE_CACHE 0 // Cache controller disabled for now
3736

src/DuetNG/DueXn.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,20 @@ namespace DuetExpansion
131131
dueXnExpander.pinModeMultiple(AllFanBits, OUTPUT_PWM_LOW); // Initialise the PWM pins
132132
const uint16_t stopBits = (dueXnBoardType == ExpansionBoardType::DueX5) ? AllStopBitsX5 : AllStopBitsX2; // I am assuming that the X0 has 2 endstop inputs
133133
dueXnExpander.pinModeMultiple(stopBits | AllGpioBits, INPUT); // Initialise the endstop inputs and GPIO pins (no pullups because 5V-tolerant)
134-
135-
// Set up the interrupt on any input change
136134
dueXnInputMask = stopBits | AllGpioBits;
137135
dueXnExpander.enableInterruptMultiple(dueXnInputMask, INTERRUPT_MODE_CHANGE);
136+
}
137+
138+
return dueXnBoardType;
139+
}
140+
141+
// Create the DueXn task and enable the associated interrupt from the DueXn.
142+
// This must be called after interrupt priorities have been configured, to comply with FreeRTOS constraints.
143+
void DueXnTaskInit()
144+
{
145+
if (dueXnBoardType != ExpansionBoardType::none)
146+
{
147+
// Set up the interrupt on any input change
138148
attachInterrupt(DueX_INT, DueXIrq, InterruptMode::INTERRUPT_MODE_FALLING, nullptr);
139149

140150
// Clear any initial interrupts
@@ -143,8 +153,6 @@ namespace DuetExpansion
143153
dueXTask = new Task<DueXTaskStackWords>();
144154
dueXTask->Create(DueXTask, "DUEX", nullptr, TaskPriority::DueXPriority);
145155
}
146-
147-
return dueXnBoardType;
148156
}
149157

150158
// Look for an additional output pin expander

src/DuetNG/DueXn.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ namespace DuetExpansion
2424
{
2525
ExpansionBoardType DueXnInit(); // Look for a DueXn, initialise it and return which expansion board is attached
2626
void AdditionalOutputInit(); // Look for an additional output pin expander
27-
const char* array null GetExpansionBoardName(); // Return the name of the expansion board, or nullptr if no expansion board
28-
const char* array null GetAdditionalExpansionBoardName(); // Return the name of the additional expansion board, or nullptr if no expansion board
27+
void DueXnTaskInit(); // Create the DueXn task and enable the associated interrupt from the DueXn
28+
const char* _ecv_array null GetExpansionBoardName(); // Return the name of the expansion board, or nullptr if no expansion board
29+
const char* _ecv_array null GetAdditionalExpansionBoardName(); // Return the name of the additional expansion board, or nullptr if no expansion board
2930
void SetPinMode(Pin pin, PinMode mode); // Set the I/O mode of a pin
3031
bool DigitalRead(Pin pin); // Read a pin
3132
void DigitalWrite(Pin pin, bool high); // Write a pin

src/Fans/Fan.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ void Fan::Init(Pin p_pin, LogicalPin lp, bool hwInverted, PwmFrequency p_freq)
2424
hardwareInverted = hwInverted;
2525
inverted = blipping = false;
2626
heatersMonitored = 0;
27-
triggerTemperatures[0] = triggerTemperatures[1] = HotEndFanTemperature;
27+
triggerTemperatures[0] = triggerTemperatures[1] = DefaultHotEndFanTemperature;
2828
lastPwm = -1.0; // force a refresh
2929
Refresh();
3030
}

src/FilamentMonitors/FilamentMonitor.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ bool FilamentMonitor::ConfigurePin(GCodeBuffer& gb, const StringRef& reply, Inte
5858
reply.copy("unsuitable endstop number");
5959
return true;
6060
}
61+
setPullup(pin, false); // disable the pullup resistor to provide greater noise immunity when using a Duet3D laser of magnetic filament monitor
6162
}
6263
else if (seen)
6364
{

0 commit comments

Comments
 (0)