Commit Graph

4231 Commits

Author SHA1 Message Date
Voinea Dragos
d8a14842c5 Remove unused skip_debug_msg flag 2022-01-30 11:22:43 +00:00
Alex Voinea
c09b732522 Reserve xflash space for the mmu update files 2022-01-17 12:03:12 +01:00
Alex Voinea
b72c027924 XFLASH layout explained 2022-01-17 11:46:14 +01:00
Guðni Már Gilbert
63c6373f8d Remove TEMP_STAT_LEDS from firmware
This isn't used by MK3 printers.
It seems to be leftover code from Marlin
2021-12-25 09:41:50 +00:00
DRracer
0be90dc5d1
Merge pull request #3320 from prusa3d/MK3_3.10.1
Merge MK3_3.10.1 into MK3 after release
2021-12-17 14:02:13 +01:00
D.R.racer
caca7bb9b8 Version changed (3.10.1 build 4697) 2021-12-16 12:14:02 +01:00
3d-gussner
1c1e69e555 Update FW crash message 2021-12-16 11:23:44 +01:00
3d-gussner
785d94ab3a Add links to RepRap Gcode wiki for new Dcodes D20-D23 2021-12-16 09:32:38 +01:00
Yuri D'Elia
3849f9785a Make cancel_heatup also abort cooldown in M190
This matches the expected behavior, as already implemented in
wait_for_heater().
2021-12-10 01:51:43 +01:00
Yuri D'Elia
320835a1b7 Do not cancel wait-for-temperature loops in disable_heaters()
Partially revert previous change: cancelling a single loop would often
advance the gcode stream to the next wait-for loop if executed at the
beginning of an SD print, implicitly turning off the flag again.

Cancel the loop directly in UnconditionalStop() which stops the command
queue as well in an atomic way, handling this correctly.
2021-12-10 01:46:20 +01:00
Yuri D'Elia
32d8d892f5 Actually call UnconditionalStop() in Stop()->lcd_print_stop()
Remove incorrect check introduced during development.
2021-12-10 01:43:59 +01:00
Yuri D'Elia
83693bf4cc Remove useless assignment in lcd_cooldown
The current filament action will be aborted by lcd_return_to_status()
2021-12-07 19:27:18 +01:00
Yuri D'Elia
78f856c8d6 Do not unconditionally overwrite the status message in check_file()
No function should touch the status message directly without checking
the message severity level first. Replace the strcpy_P with
lcd_setstatuspgm().
2021-12-07 19:27:18 +01:00
Yuri D'Elia
7ff117d0c4 temp_runaway_stop: remove spourious space in error message 2021-12-07 19:27:18 +01:00
Yuri D'Elia
36a7b5ca56 Avoid redundant checks in lcd_setalertstatus* 2021-12-07 19:27:18 +01:00
Yuri D'Elia
a3915b57b9 Improve temp_runaway_stop robustness
Remove most of the duplicated code inside temp_runaway_stop(),
making it identical to the other temperature handlers.

Move the lower-level functions required to stop the entirety of the
machine into UnconditionalStop(). Reuse this function inside
lcd_print_stop().

Set the LCD alert message before calling Stop(), as done in other safety
handlers, so that the error is visible while the printer is stopping.

This also avoids other temporary status messages to appear before
the real issue is shown and/or STEALING the first CRITICAL alert
level before we do.
2021-12-07 19:25:34 +01:00
Yuri D'Elia
57abffda1b Update temperature-related error message to use LCD_STATUS_CRITICAL 2021-12-07 11:09:58 +01:00
Yuri D'Elia
fb025bba05 Introduce severity levels for alert messages
Use the internal lcd_status_message_level for multiple severity levels
of alert messages.

This is needed to distinguish between non-critical alerts (such as FAN
ERROR) from critical ones (any heater issue). During a failure
scenario, a critical error MUST NOT be overridden by a lower-level one.

As such LCD_STATUS_CRITICAL is currently used for all heater-related
errors that result in a safety full-stop.
2021-12-07 11:06:08 +01:00
DRracer
a7dfe4b523
Merge pull request #3305 from gudnimg/sd-card-lcdtimer-fix-gudni-v2
Fix issue when the SD card is inserted and the file menu may sometimes close immediately due to a timeout
2021-11-19 07:23:21 +01:00
Guðni Már Gilbert
be79e3791f Fixes #3262
Make sure to call lcd_timeoutToStatus.start() when the SD card is inserted
into the printer after it was removed beforehand.

(cherry picked from commit 6795843f153aa064f087f80990419a946cdfe857)
2021-11-18 19:23:21 +00:00
Guðni Már Gilbert
13732f162b Fix build error when TMC2130_SERVICE_CODES_M910_M918 is enabled
(cherry picked from commit 6ed4b79cc6685f31b6914881008e036424dab2eb)
2021-11-18 19:19:56 +00:00
Guðni Már Gilbert
6887f844d3
Merge branch 'prusa3d:MK3' into fix-pinda-thermistor-build-fail 2021-11-18 19:15:15 +00:00
Panayiotis-git
f8410d8f3c Print temperatures only if filament loading is still active 2021-11-18 11:46:36 +02:00
Guðni Már Gilbert
05e0c1e1d3 Fix build error if PINDA_THERMISTOR is not defined
temp_cal_active variable is not defined in this scope
2021-10-12 21:52:19 +00:00
EV3R4
eff9cd9f21 Typo: M84 docs 2021-09-27 19:34:53 +02:00
Guðni Már Gilbert
cf8a16baa1 Remove one call to lcd_timeoutToStatus.start
Saves 8 bytes of Flash memory

This call is redundant and when moving between menus
it gets called multiple times which results in waste
of clock cycles.

lcd_timeoutToStatus.start() is called from menu_lcd_lcdupdate_func()
which is enough.
2021-08-21 14:34:02 +00:00
Guðni Már Gilbert
e6a7abf2c1 Change temp_runaway_timer from float to uint32_t
Saves 32 bytes of flash

Also change temp_runaway_error_counter from int to
uint16_t to be specific
2021-08-06 15:08:46 +00:00
Guðni Már Gilbert
db1e5a203b Change temp_runaway_status from float to uint8_t and its enum
Saves 90 bytes of flash, and 12 bytes of SRAM
2021-08-06 15:03:35 +00:00
Guðni Már Gilbert
b716c208d7 Various optimisation to change int to uint8_t
This commit saves 174 bytes of flash memory
2021-08-03 22:42:01 +00:00
Guðni Már Gilbert
8d7d1698ee Remove unused global variable 'chunkHead'
No change in memory on my end, but it is one less 'int' :)
2021-08-03 21:48:26 +00:00
Guðni Már Gilbert
1946c58d21 1. Remove redundant variable 'inters'
2. 'gh' variable can be 1 byte instead of 2

This saves 26 bytes of flash memory
2021-08-03 21:46:11 +00:00
Guðni Már Gilbert
05ed5b9668 Improve lcd_selftest_screen_step() parameter types
Saves 62 bytes of flash memory
2021-08-03 21:35:28 +00:00
Guðni Már Gilbert
a54a133968 Use memset instead of nested for-loop to zero a 2d array
Saves 26 bytes of flash memory and removes two 'int' types
2021-08-02 19:20:51 +00:00
Guðni Már Gilbert
2554d21925 Use uint8_t when using axis enum
Saves 76 bytes of flash memory
2021-08-02 12:20:10 +00:00
DRracer
fd6dbba06f
Merge branch 'MK3_3.10.1' into PFW-1271_PF-buildv20 2021-08-02 08:51:51 +02:00
Guðni Már Gilbert
158877e736 Remove one space from Support -> Temperatures menu
Saves 2 bytes of flash memory
2021-08-01 11:20:29 +00:00
Guðni Már Gilbert
da2c802440 Add two defines and use LCD_STR_DEGREE with consistency
This saves 12 bytes of flash and 2 bytes of SRAM
2021-08-01 11:10:03 +00:00
Guðni Már Gilbert
6afc87d3c8 Reduce unnecessary LCD CGRAM writes 2021-07-30 23:53:57 +00:00
Guðni Már Gilbert
b1972fdcee Fixes https://github.com/prusa3d/Prusa-Firmware/issues/3252 2021-07-28 16:47:47 +00:00
Guðni Már Gilbert
8af9f78822 Optimize farm_mode init in setup()
This saves 28 bytes of flash memory
2021-07-26 16:37:09 +00:00
Guðni Már Gilbert
21226214a7 Remove MAX_SILENT_FEEDRATE
It was last used on MK2 in 3rd July 2017.
I suspect this code was simply forgotten.
2021-07-21 14:06:23 +00:00
Guðni Már Gilbert
25408d14da Remove unused #ifdef MK1BP
MK1BP is never defined anywhere
2021-07-21 06:27:44 +00:00
Guðni Már Gilbert
13477c65c6 Remove two functions EEPROM_read_B() and EEPROM_save_B()
This resolves #3218
2021-07-20 17:04:17 +00:00
Guðni Már Gilbert
400f673fe0 Remove redundant extern variable lcd_encoder from menu.cpp
This extern variable is included from lcd.h
2021-07-20 09:12:14 +02:00
Guðni Már Gilbert
d087973e00 Remove redundant extern variable is_usb_printing from tmc2130.cpp
This extern variable is included from Marlin.h
2021-07-20 09:12:14 +02:00
Guðni Már Gilbert
6aee17b4ca lcd_change_fil_state has two extern's in Marlin.h, only one needed. 2021-07-20 09:12:14 +02:00
Guðni Már Gilbert
3cfd706fff Remove useless extern in cmdqueue.cpp 2021-07-20 09:12:14 +02:00
Guðni Már Gilbert
31c8e4bc4c * Remove redundant externs already included with temperature.h
* Add ifdefs in Dcodes.cpp when using extern variables
2021-07-20 09:12:14 +02:00
Guðni Már Gilbert
eb9c8c8c20 Improve mc_arc() parameters
- Make the mc_arc() function declaration consistent with the definition
- isclockwise is supposed to be bool type, given how it is used.
2021-07-20 09:03:50 +02:00
Guðni Már Gilbert
538ce06bf0 Remove unused function lcd_choose_color() 2021-07-20 08:55:49 +02:00
Guðni Már Gilbert
bbe62b136a Remove unused Sound_Save() function declaration 2021-07-20 08:51:57 +02:00
Yuri D'Elia
d04ea859fb Consolidate "Unknown X-Code" to save 16 bytes 2021-07-20 08:19:19 +02:00
Yuri D'Elia
47b1e6ccef Remove spourious trailing whitespace in errors 2021-07-20 08:19:19 +02:00
Yuri D'Elia
1888c783cb Print an error on unknown D-codes
This follows the same convention of M/G codes, so that the user knowns
that the D-code has been either handled or ignored.
2021-07-20 08:19:19 +02:00
Guðni Már Gilbert
d853c19a21 Use fabs() instead of abs() when using floats
This saves 514 bytes of flash memory
2021-07-20 08:16:18 +02:00
Yuri D'Elia
31b913cddb Correct the C implementation for MultiU16X8toH16
The comment behind the ASM MultiU16X8toH16 was misleading.
It actually computes ((a<<8)*b)>>16, or (a*b)>>8.

Correct the comment and C reference implementation accordingly.
2021-07-20 08:10:36 +02:00
Guðni Már Gilbert
710852a1f2 Change nrFiles from int16_t to uint16_t 2021-07-20 08:10:07 +02:00
Guðni Már Gilbert
16602f4003 change boolean to bool 2021-07-20 08:03:17 +02:00
3d-gussner
3d871a3aa6 Merge remote-tracking branch 'upstream/MK3' into PFW-1271_PF-buildv20 2021-07-17 19:10:51 +02:00
D.R.racer
4580b8a78c Version changed (3.10.1 build 4587) 2021-07-16 07:37:11 +02:00
Guðni Már Gilbert
153de8e1db Remove redundant lines 2021-07-10 17:01:13 +00:00
Guðni Már Gilbert
47b8462c38 Remove two functions EEPROM_read() and EEPROM_save() 2021-07-02 20:10:47 +00:00
Yuri D'Elia
1279a6cf4b Correctly read FW_VERSION_NR array from progmem
In PR #3093 the progmem array FW_VERSION_NR was introduced to store the
version components, however the code didn't read it properly using the
pgm_read_* functions, making version comparisons fail.

Fix the existing/unused is_provided_version_newer() and reuse it in
show_upgrade_dialog_if_version_newer().

Similarly also read/update correctly the version in the eeprom.
2021-06-28 06:36:26 +02:00
Yuri D'Elia
56e531d40a Improve/fix D23 for M2.5/S printers
- Move D23 into it's own function inside Dcodes
- Correctly include a break in the switch statement
- Show the dumper status (enabled/disabled) after toggling
- Allow to generate an immediate dump via g-code using D23 E for
  symmetry with D20 E
2021-06-25 08:46:55 +02:00
Yuri D'Elia
380e34d481 Include "Dcodes.h" after "Marlin.h" for configuration
This is needed in order to get the function prototypes right according
to the actual enabled configuration.
2021-06-25 08:46:55 +02:00
Voinea Dragos
ecce6f865f write_command() no line number handling 2021-06-25 08:12:30 +02:00
Yuri D'Elia
53fcd6fc8f Work-around GCC LTO codegen bug in process_commands()
When building with GCC 4.9.2 (bundled with PF-build-env-1.0.6.*), -Os
and LTO enabled, PID_autotune gets automatically inlined into
process_commands().

Sadly, due to the massive size of process_commands(), it results in
codegen bug doing a partial stack overwrite in process_commands()
itself, manifesting as random behavior depending on the timing of
interrupts and the codepath taken inside the merged function.

Mark the function as noinline and add a note about the affected compiler
version in order to be checked again in the future.
2021-06-24 07:39:28 +02:00
3d-gussner
36f2b5375f Merge remote-tracking branch 'upstream/MK3' into PFW-1271_PF-buildv20
merge latest changes and fix isses
2021-06-24 05:53:43 +02:00
Yuri D'Elia
66ee9a295f Remove useless function EEPROM_read_st 2021-06-22 19:08:20 +02:00
Yuri D'Elia
8d11ad9d2d xfdump: correctly erase all sectors in xfdump_erase 2021-06-22 19:07:49 +02:00
D.R.racer
88074ac6c8 Remove FW version parsing
as it can be done at compile time. Code size dropped by >800 bytes.
2021-06-22 08:49:52 +02:00
DRracer
6188870c2e
Merge pull request #3157 from wavexx/improve_d2
Add extra debugging functions & crash analysis
2021-06-22 07:37:30 +02:00
DRracer
f36b9173da
Merge pull request #3191 from wavexx/fix_longpress_isr
Handle Long-Press in the main loop
2021-06-22 07:09:01 +02:00
Yuri D'Elia
79287ffb3d Use uint8_t consistently for the block buffer's index
Instead of using a mixture of int8_t, unsigned char and (incorrectly)
int, use uint8_t consistently for indexing the current block.

This improves the performance of the wait loop in plan_buffer_line,
which currently expands all comparisons to a word for no reason.

This also extends the theoretical limit to 128 entries.
Add some static assertions to ensure BLOCK_BUFFER_SIZE is correct.
2021-06-22 06:59:57 +02:00
Yuri D'Elia
f4fcdae630 Fixup the DUMP_MAGIC constant 2021-06-22 00:04:39 +02:00
Yuri D'Elia
934b567e5a Remove "bonus" exclamation points from the crash message 2021-06-21 22:37:28 +02:00
Yuri D'Elia
edde002cdc Merge remote-tracking branch 'upstream/MK3' into fix_longpress_isr 2021-06-21 11:51:45 +02:00
3d-gussner
3c649a89d3 Merge remote-tracking branch 'upstream/MK3' into PFW-1271_PF-buildv20 2021-06-21 08:01:24 +02:00
Alex Voinea
30d9faef9d
Minor fixes to SD presence handling (#3139)
* Remove forgotten function protorypes

* Fix code indentation

* Fix double sorting if SD card is inserted during setup()

* Correctly handle SD removal during sorting
2021-06-21 07:30:47 +02:00
Voinea Dragos
0cbc759d8b Second attempt at retrieving the SN from the 32u2 IC 2021-06-21 07:24:41 +02:00
Alex Voinea
6d25345fc4 optiboot_xflash comment about w25x20cl messages
Mention supported ICs
2021-06-21 07:21:40 +02:00
Yuri D'Elia
a92c0278fe Use LCD_WIDTH instead of hardcoding 20 2021-06-21 07:21:10 +02:00
metacollin
8a7dd08116 Fixed C++ bug 2021-06-21 07:05:17 +02:00
Yuri D'Elia
09e935d27b Fix two new explicit case fallthru warnings 2021-06-21 06:52:52 +02:00
Yuri D'Elia
d727a949dd Silence explicit case-fallthru 2021-06-21 06:52:52 +02:00
Yuri D'Elia
c096462aab Clarify statement by adding extra braces 2021-06-21 06:52:52 +02:00
Yuri D'Elia
051f03119b Fix misleading indentation warnings by expanding tabs 2021-06-21 06:52:52 +02:00
Yuri D'Elia
f2fe57bfc0 Fix unused static declaration warnings
Guard declarations using the appropriate defines
2021-06-21 06:52:52 +02:00
Jonas Meyer
7bd43b77d7 Remove unnecessary assignment 2021-06-21 06:47:59 +02:00
Yuri D'Elia
eafdf6c216 Also move host_keepalive to manage_inactivity()
This avoids the "busy" output interleaving with regular output in very
rare scenarios.

We should focus in finding which calls are not using manage_inactivity()
properly instead of working it around.
2021-06-21 06:46:24 +02:00
Yuri D'Elia
29322d4bf3 Move host_autoreport() to manage_inactivity()
This makes autoreport work more consistently.
2021-06-21 06:46:24 +02:00
Yuri D'Elia
5c8a231ed6 Move autoreporting out of the temperature ISR
Code running in the temperature ISR needs to be fully reentrant, which
is hard to track down.

Move autoreporting to the main processing loop. This can make the
autoreporting slower or pause at times, but removes the reentrant
restriction, which allows us to use printf_P.
2021-06-21 06:46:24 +02:00
Yuri D'Elia
97f66a6a13 Remove ignored/incorrect PROGMEM
This PROGMEM is currently ignored by gcc, but even if it wasn't it
wouldn't be correct since the following code is expecting to read "item"
without fetching the array itself from PROGMEM.
2021-06-21 06:44:19 +02:00
DRracer
5bb8bb2ccb
Merge pull request #3134 from wavexx/fix_partial_redraw2
Redraw "Preheating to load" in full when modified by other actions
2021-06-21 06:42:13 +02:00
Yuri D'Elia
700825ff76 serial_dump: include hex prefix 2021-06-19 13:57:40 +02:00
Yuri D'Elia
bff79d290a GETPC: Do not manipulate the 32bit return address
We can do that offline, saving over 30 bytes of instructions.
2021-06-19 13:56:40 +02:00
Yuri D'Elia
72b8f0d1e6 Add some warnings in lcd_buttons_update 2021-06-19 13:46:10 +02:00
Yuri D'Elia
06d91ddcee Handle Long-Press in the main loop
The longpress function is currently called within the temperature ISR,
which is bogus. Calling the longpress function at the wrong moment
can corrupt the menu buffers.

Move the call to the main loop by changing the logic slightly:

- still sample the lcd buttons inside the temperature ISR, which keeps
  scrollong/pressing responsive, but...
- set a flag to indicate that longpress has been triggered instead of
  calling the function directly
- call the function on the next manage_inactivity run

Combined with #3180 this removes _most_ unsafe operations out of the ISR
which can happen during a normal run (max/mintemp warnings are still an
exception).
2021-06-17 20:07:01 +02:00
3d-gussner
56889bae13 Update PF-build.sh to work after @DRracer Remove FW version parsing PR 2021-06-17 19:08:55 +02:00
Yuri D'Elia
dd8c6c064c xfdump: simplify stack debugging (sample pc+sp)
Instead of having to guess the PC where the SP was sampled, always take
both. This allows "seamless" stack decoding for both serial and xflash
dumps, since we don't have to guess which function generated the dump.

Make the core functions (doing the sampling) be ``noinline`` as well,
so that they always have valid frame.
2021-06-17 01:29:25 +02:00
Yuri D'Elia
97535ec0c1 Fix last commit 2021-06-15 22:10:08 +02:00
Yuri D'Elia
e6d520cf6e Add test code for the stack overflow handler 2021-06-15 18:49:20 +02:00
Yuri D'Elia
a614268c94 serial_dump_and_reset: do not call manage_heater with interrupts disabled
Do not call manage_heater() in print_mem() if interrupts are already
disabled. This means we're running inside the crash handler.
2021-06-15 18:44:44 +02:00
Yuri D'Elia
d193d0f7ac serial_dump: manipulate WDT just once 2021-06-15 16:21:56 +02:00
Yuri D'Elia
928c7211ad emergency handlers: always save SP _at_ the crash location
Save SP which is closest to the crash location, which simplifies
debugging. For serial_dump, write SP just before the dump.
For xfdump, save SP in the dump header.

This makes xfdump_dump and xfdump_full_dump_and_reset() equivalent for
stack debugging.
2021-06-15 11:47:27 +02:00
Yuri D'Elia
96aad0a475 Remove duplication in crash handlers
It's kind of nice that all handlers eventually came to become the same.
2021-06-14 12:38:23 +02:00
Yuri D'Elia
fa0f58d5bc serial_dump: add description about bad_isr 2021-06-14 12:30:24 +02:00
Voinea Dragos
8e667a8acd bad ISR catch 2021-06-14 11:30:38 +03:00
Yuri D'Elia
d2041ee2fe Enable debugging features on all variants
- XFlash crash dumper on MK3+ series
- Online crash dumper on MK2.5+ series
- D2/D6 on MK3+ series
- D2 on MK2.5+ series
2021-06-13 22:35:43 +02:00
Yuri D'Elia
7db667ca86 serial_dump_and_reset: turn on print fan while dumping
To avoid scorching the sheet while dumping close to the bed.
2021-06-13 22:28:28 +02:00
Yuri D'Elia
ea51d65137 serial_dump_and_reset: do not completely disable WDT
Set it to 8s which is long enough to complete the dump.
2021-06-12 15:39:37 +02:00
Yuri D'Elia
6de98f7b0d Move inclusion closer to the usage point 2021-06-12 15:33:18 +02:00
Yuri D'Elia
050cf72e98 Move stack checking to the temperature ISR
Now that the stack_error function is truly minimal,
we can check for stack errors much more frequently.

Also move away stack_error from ultralcd to Marlin_main.
2021-06-12 15:23:33 +02:00
Yuri D'Elia
01934b89e9 xflash_dump is now always required in all variants 2021-06-12 15:13:32 +02:00
Yuri D'Elia
449510392d Untangle a bit some recursive include mess 2021-06-12 15:09:03 +02:00
Yuri D'Elia
e28301f391 Report crash also in MK2.5, fix stack_error abuse
Rename EEPROM_CRASH_ACKNOWLEDGED to EEPROM_FW_CRASH_FLAG.

Use EEPROM_FW_CRASH_FLAG to always set the last crash reason, which
simplifies handling between the online/offline variants.

Make stack_error safe, by setting the flag and restarting immediately,
so that the error can be shown after restart.
2021-06-12 14:41:54 +02:00
Yuri D'Elia
bd57e00448 Implement an online crash dumper for MK2.5 boards
When XFLASH is not available, allow users to request _online_ crash
dumps by using D23 (since these require active user cooperation).

Once enabled, instead of just rebooting, dump memory directly to
the serial.

As similarly done with EMERGENCY_DUMP, we have two features that can be
enabled:

EMERGENCY_SERIAL_DUMP: enables dumping on crash after being requested
MENU_SERIAL_DUMP: allow triggering the same manually through the support
menu.
2021-06-12 13:37:20 +02:00
Yuri D'Elia
f7dc8dcaef Fix usage of RAMEND
RAMEND is the last valid address, not one-past as I expected it to be...
2021-06-12 13:16:12 +02:00
Yuri D'Elia
f18d4757c6 Introduce STACK_GUARD_MARGIN in all variants
Create a gap between the BSS and the stack guard.
Set this gap (STACK_GUARD_MARGIN) to 32 bytes in all variants.

The gap serves two purposes:

- Detect a stack overflow earlier (falsely triggering in overtight
  situations is OK!), so that we can hopefully avoid smashing
  the heap and have a clean view during the dump.

- Reserve spack space itself for the stack dumping machinery,
  which is going to grow the stack even further.

Remove get_stack_guard_test_value() which was unused.
2021-06-12 12:08:53 +02:00
Yuri D'Elia
9663653671 xfdump_erase: remove redundant XFLASH_SPI_ENTER() 2021-06-12 12:05:02 +02:00
Yuri D'Elia
3187b96ca4 xfdump: report to the host that a dump is available
As suggested by @3d-gussner, announce to the host that a dump is
available for retrieval using an action "dump_available".

Any kind of dump is announced (even if manually triggered).

To avoid reading from xflash twice, remove some duplication and return
the crash reason directly in xfdump_check_state().
2021-06-11 19:21:51 +02:00
Yuri D'Elia
31f416fd5e Rename dump_crash_source to dump_crash_reason 2021-06-10 17:35:49 +02:00
Yuri D'Elia
c375610668 Move "WDR dump" inside EMERGENGENCY_DUMP 2021-06-10 17:02:41 +02:00
Yuri D'Elia
63f870c089 Enable the "WDR reset" menu item in DEBUG_BUILD only 2021-06-10 16:30:59 +02:00
Yuri D'Elia
0362b6484f xfdump_full_dump_and_reset: set a guaranteed minimum WDT
Just prior to dumping, reset the WDT to a known-safe (and not too long)
interval that guarantees a complete dump.
2021-06-10 16:30:39 +02:00
Voinea Dragos
0a77f2c02d Dump header as well 2021-06-10 11:58:46 +03:00
Voinea Dragos
094c577e9d Fix XFLASH_DUMP print_mem 2021-06-09 14:10:20 +03:00
Voinea Dragos
1e786c7f55 WDR crash initial 2021-06-09 13:59:26 +03:00
Voinea Dragos
8c3d76f85f Fix millis reference 2021-06-09 12:44:28 +03:00
Yuri D'Elia
fab04dbc6c D6: remove option for unsupported models 2021-06-08 19:53:37 +02:00
Yuri D'Elia
318ee695c2 xfdump_layout: add some comments 2021-06-08 19:50:43 +02:00
Yuri D'Elia
c2e64c8c6e xfdump: fix another off-by-one static size check 2021-06-08 19:08:03 +02:00
Yuri D'Elia
378f239ff0 dcode_code: fix inverted define to print larger types 2021-06-08 18:57:16 +02:00
Yuri D'Elia
56d0848ea9 xfdump: fix size check 2021-06-08 18:43:32 +02:00
Yuri D'Elia
9d3b19b637 xfdump: defensive static checks to ensure dump location always fits 2021-06-08 18:29:55 +02:00
Yuri D'Elia
dcfdce87c7 Document new applicable build options in the variant files
Document, but don't enable them.
Leave exiting functionality unchanged for now.
2021-06-08 18:17:56 +02:00
Yuri D'Elia
c072fbbf02 Dcodes: fix daddr_t type when only XFLASH_DUMP is enabled 2021-06-08 18:14:49 +02:00
Yuri D'Elia
c331c07b16 xfdump: reuse standard definitions for SRAM size/offset 2021-06-08 17:53:06 +02:00
Yuri D'Elia
520f7a2e26 config: add sanity checks for XFLASH_DUMP options 2021-06-08 17:32:14 +02:00
Yuri D'Elia
1a88e339bf xfdump: fix build with XFLASH_DUMP disabled 2021-06-08 17:17:18 +02:00
Yuri D'Elia
a6e372e696 Typo 2021-06-08 17:14:22 +02:00
Yuri D'Elia
c31109c750 Implement MENU_DUMP: offline memory dump from "Support"
If MENU_DUMP is enabled, a new entry at the end of the "Support" menu is
added that allows to dump memory for offline use.

This allows to trigger a memory dump at any moment during regular usage
(either idling or printing) and to recover the dump later even after a
hardware reset.
2021-06-08 16:56:58 +02:00
Yuri D'Elia
c089ac5341 Implement EMERGENCY_DUMP for offline analysis
If EMERGENCY_DUMP is defined, crash and dump using the new xflash dump
functionality instead of just continuing with an error message.

When an emergency crash is stored, the first restart after a crash
displays a message that debug data is available and to contact support
to submit the crash for analysis.
2021-06-08 16:42:43 +02:00
Yuri D'Elia
e7f78125d3 Merge remote-tracking branch 'panayiotis/FixEepromAddressDocumentation' into improve_d2 2021-06-08 16:18:09 +02:00
Yuri D'Elia
30402e0404 Dcodes: add D20/D21/D22 to generate/read/clear dumps 2021-06-08 15:34:39 +02:00
Yuri D'Elia
6dfef76346 xfdump: implement dump-to-xflash functionality
Update xflash_layout to include information about the dump, which sits
at the end of xflash.
2021-06-08 15:28:02 +02:00
Yuri D'Elia
b398a09a4f xflash: add xflash_multipage_program and documentation
Add a new high-level command to perform multipage writes quickly.
2021-06-08 15:25:16 +02:00
Yuri D'Elia
86e753fe37 xflash: remove some duplication 2021-06-08 15:24:46 +02:00
Yuri D'Elia
5ae8bad0ba Introduce "xflash_layout" to organize XFLASH's content
Update the language code to use the new LANG_OFFSET definition
and remove hard-coded flash sizes.
2021-06-08 15:22:37 +02:00
Yuri D'Elia
af636c7f2a Move "xflash" include inside the conditional 2021-06-08 15:18:33 +02:00
Yuri D'Elia
0fcdada579 D6: add documentation 2021-06-07 19:58:18 +02:00
Yuri D'Elia
ed9f52dd85 D6: also hide declaration behind conditional 2021-06-07 18:50:45 +02:00
Yuri D'Elia
db096557d4 D[236]: remove "busy" messages while dumping, avoid WDT 2021-06-07 16:41:25 +02:00
Yuri D'Elia
12e124324f Remove PROGMEM handling from print_mem until D5 uses dcode_core
Handling PROGMEM also requires a 32bit address type.
2021-06-07 16:41:25 +02:00
Yuri D'Elia
f9371146d0 Implement reading XFLASH with D6
This requires expanding the dcode_core address type to 32bit type,
thus enlarges the D2/D3 implementation as a result.

Still allow to save all the original space if D6 is disabled, for now.
2021-06-07 16:41:25 +02:00
Yuri D'Elia
915f5a7692 Unify D2 and D3 handling
Handle reading/writing memory using the same base functions
in order to save space.
2021-06-07 16:41:25 +02:00
Yuri D'Elia
2d25a5705f Fix D2 to read the entire SRAM content
Allow to read up to 0x21ff, which is the last byte of SRAM.  Set default
starting address to 0x200, which is the first true byte.

0x0-200 is mapped to register/io space and could cause issues when read
from bi-directional registers.
2021-06-07 16:37:34 +02:00
Yuri D'Elia
62f496e1d6 Allow D2 to be enabled selectively 2021-06-07 16:37:34 +02:00
D.R.racer
6bb7c0e3d3 Farm workaround M1 message
Farmers want to abuse a bug from the previous firmware releases
- they need to see the filename on the status screen instead of "Wait for user..."
So we won't update the message in farm mode...
2021-05-25 09:45:42 +02:00
Panayiotis-git
3c63ddaafd Fix the eeprom address documentation 2021-05-22 17:09:55 +03:00
D.R.racer
04de9c0c8a Version changed (3.10.0 build 4481) 2021-05-06 13:46:05 +02:00
Yuri D'Elia
1a92f2e19f Merge remote-tracking branch 'upstream/MK3_3.10.0' into fix_partial_redraw2 2021-05-04 10:49:24 +02:00
DRracer
eaa6801849
Merge pull request #3136 from leptun/PFW-1225_fix_open_file_from_sd_wrong_file
Fix menu_action_sdfile() check_file(filename) call
2021-04-29 16:34:01 +02:00
DRracer
80e248662c
Merge pull request #3079 from 3d-gussner/PFW-1189
PFW-1189 Pre-release tasks
2021-04-29 16:33:18 +02:00
DRracer
89386036e6
Merge pull request #3137 from leptun/PFW-1239_fix_M23_subroutine_issue
Do not allow M23 to run subroutines
2021-04-29 15:06:33 +02:00
DRracer
a3b392d96c
Merge pull request #3130 from DRracer/move-alldata-2-end
Move All Data into last position in Factory Reset menu
2021-04-29 10:08:32 +02:00
Voinea Dragos
8610d0a850 Do not allow M23 to run subroutines 2021-04-29 10:59:21 +03:00
DRracer
7c914ec2d1
Merge pull request #3125 from leptun/PFW-1238_fix_M105_from_SD
Fix M105 from SD
2021-04-29 09:12:05 +02:00
Voinea Dragos
1a70f3369d fix comment 2021-04-29 09:48:25 +03:00
Voinea Dragos
d9976ca69c Fix menu_action_sdfile() check_file(filename) call 2021-04-29 09:47:16 +03:00
3d-gussner
a9ae8ea731 Remove SpoolJoin from translations 2021-04-29 08:15:24 +02:00
3d-gussner
488d9d4b38 Remove "Firmware" from translations
deleted another unused "Firmware" define in language.h
2021-04-28 18:02:36 +02:00
3d-gussner
d251f3980a Remove FlashAir from translations 2021-04-28 17:57:39 +02:00
3d-gussner
b5ba4041d3 Remove FINDA from translations 2021-04-28 17:36:17 +02:00
3d-gussner
08566d4121 Remove PINDA from translations 2021-04-28 17:33:52 +02:00
3d-gussner
30b383195d Remove copy/paste error 2021-04-28 17:29:32 +02:00
Yuri D'Elia
aee04a43e2 Redraw "Preheating to load" in full when modified by other actions
Check for lcd_draw_update to see if the lcd has been altered outside the
function and redraw the screen if full.

This fixes scenarios such as #3129 where the "Card removed" message or
the SD menu is entered from outside the function's control.

This requires checking/resetting bFilamentWaitingFlag carefully to avoid
re-entering this function _twice_ (raise_z_above will run the main
loop until complete).
2021-04-28 17:13:46 +02:00
D.R.racer
5089b2cddb Move All Data into last position in Factory Reset menu 2021-04-28 06:43:54 +02:00
3d-gussner
7a54c3638c Remove web links and Prusa i3 MKxy OK. from translations
as these never have been translated or doesn't make sense
to translate web links
2021-04-27 20:36:22 +02:00
3d-gussner
686054b95e Changed x of 4 and y of 9 to x/4 and y/4
Added `Iteration` translation
2021-04-27 20:22:28 +02:00
3d-gussner
738a24178a Update #MSG_FIND_BED_OFFSET_AND_SKEW_LINE1 c=20 r=3 2021-04-27 07:45:36 +02:00
3d-gussner
b8ae08fd3d Update x of 4 and x of 9 messages so longer text can be used. 2021-04-27 07:18:52 +02:00
3d-gussner
1145b231a9 Define MSG_SELFTEST_FS_LEVEL 2021-04-26 14:30:20 +02:00
3d-gussner
af519626aa Define MSG_FS_V_04_OR_NEWER and MSG_FS_V_03_OR_OLDER c=14 2021-04-26 14:21:33 +02:00
3d-gussner
b522ef4812 Update MSG_SEVER_SKEW and MSG_SLIGHT_SKEW message to c=14
Changed and tested Support-> "XYZ cal. details" LCD output
2021-04-26 12:39:13 +02:00
3d-gussner
536a8f5f87
Revert that has been commited by mistake 2021-04-26 07:28:03 +02:00
3d-gussner
466de83ae0 Remove white spaces in messags which saves ~62bytes 2021-04-26 07:22:22 +02:00
3d-gussner
29ad021b23 Updated French translation of MSG_MMU_LOAD_FAILED c=20 as @awenelo suggested 2021-04-24 20:50:01 +02:00
3d-gussner
9f77ca31b8 Set MSG_SET_TEMPERATURE chars to c=20
Fix Italian warning shown by `lang-check.py`
2021-04-24 08:19:48 +02:00
Marek Bel
aa45091400
Scale extruder motor current linearly with speed. (#2813)
Scale extruder motor current linearly with speed.

49% less heating when running at low speed and standstill, 4% more torque at maximum extrusion rate (15mm^3/s), 15% more torque in high speed movements (un/retractions).

StealthChop mode is used for low speeds (below 900mm/min)
spreadCycle is used above. Transition speed is well above maximum extrusion rate of 15mm^3/s (275mm/min) so mode transition is not expected to be visible on printed surface.

StealthChop is expected to improve printed surface quality (less artifacts).

Warning you can burn extruder motor if it is not the same impedance as original Prusa i3 Extruder stepper motor. There is no current feedback in low speed so lower impedance motor can be burned by over current.

Even there is no direct current feedback, there is no risk for original motor thermal runaway, as motor resistance increases with temperature, current decreases.

Standstill peak phase current is expected to be 500 mA and linearly increase with speed to 970 mA at 900mm/min where spreadCycle constant current regulation takes over and keeps peak current at 805 mA to maximum speed possible.

As motor heating increases with current squared, lowering low speed current from 700mA to 500mA decreases heating 49% in thate mode, where motor spends most of the time.

Enable E-motor cool mode in farm mode only (and experimental menu) - the experimental menu is visible AND the EEPROM_ECOOL variable has a value of the universal answer to all problems of the universe - i.e. two conditions must be met at the start of the FW to enable the E-cool mode. If the user enables the experimental menu, sets the E-cool mode and disables the menu afterwards, on the next start of the FW the E-cool mode will be DISABLED. This is still subject to discussion how much obscure (security through obscurity) we'd like this option to have .

Additional stuff:
* Add serial debug msg to verify if E-cool mode is on
* Avoid access to E-cool mode switch on machines without TMC2130
* Do not allow only M907 E in case of E-cool mode+warn the user on the serial line that the command was skipped

Co-authored-by: D.R.racer <drracer@drracer.eu>
2021-04-23 16:06:28 +02:00
3d-gussner
c2cde83d7e Fix MSG_SELFTEST_WIRINGERROR to c=18 2021-04-23 13:29:45 +02:00
3d-gussner
3f51627c02 Fix MSG_NO being too short, no need to be 2021-04-23 13:23:11 +02:00
3d-gussner
013708479f Fix MSG_UNLOAD_FILAMENT length as in MMU a number is added 2021-04-23 13:12:57 +02:00
3d-gussner
032e8a5957 @leptun strip 1st char hack for duplicate Cancel 2021-04-23 13:03:59 +02:00
3d-gussner
403b340f19 Added EXTENDED_M20 to RepRap Gcode wiki M115 see https://reprap.org/mediawiki/index.php?title=G-code&type=revision&diff=189034&oldid=189033 2021-04-23 11:02:42 +02:00
Voinea Dragos
635bc442d6 Fix M105 from SD 2021-04-23 11:14:16 +03:00
3d-gussner
28aec049a2 Fix Typo in MSG_FIL_FAILED 2021-04-23 09:41:12 +02:00
3d-gussner
ff9185d1bb Readded >Cancel as the > has some meaning. Sadly the previously 10bytes more free space are gone again 2021-04-23 08:50:50 +02:00
3d-gussner
044c0a0a6a Update "\04Refresh" message as two "abcd" "efgh" in one line cause issues in lang-build scripts 2021-04-23 08:49:22 +02:00
3d-gussner
e18d688b64 Fix merge issues 2021-04-22 20:48:26 +02:00