Merge pull request #3466 from prusa3d/MK3_3.10.2
PFW-1303: Reset pullups on ADC
This commit is contained in:
commit
e58495ef39
@ -499,6 +499,7 @@ void raise_z_above(float target, bool plan=true);
|
|||||||
|
|
||||||
extern "C" void softReset();
|
extern "C" void softReset();
|
||||||
void stack_error();
|
void stack_error();
|
||||||
|
void pullup_error(bool fromTempISR);
|
||||||
|
|
||||||
extern uint32_t IP_address;
|
extern uint32_t IP_address;
|
||||||
|
|
||||||
|
@ -1758,6 +1758,10 @@ void stack_error() {
|
|||||||
crash_and_burn(dump_crash_reason::stack_error);
|
crash_and_burn(dump_crash_reason::stack_error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void pullup_error(bool fromTempISR) {
|
||||||
|
crash_and_burn(fromTempISR ? dump_crash_reason::bad_pullup_temp_isr : dump_crash_reason::bad_pullup_step_isr);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void trace();
|
void trace();
|
||||||
|
|
||||||
|
@ -327,7 +327,13 @@ static_assert(sizeof(Sheets) == EEPROM_SHEETS_SIZEOF, "Sizeof(Sheets) is not EEP
|
|||||||
| 0x0D05 3333 | uint32_t | EEPROM_JOB_ID | ??? | 00 00 00 00h | Job ID used by host software | D3 only | D3 Ax0d05 C4
|
| 0x0D05 3333 | uint32_t | EEPROM_JOB_ID | ??? | 00 00 00 00h | Job ID used by host software | D3 only | D3 Ax0d05 C4
|
||||||
| 0x0D04 3332 | uint8_t | EEPROM_ECOOL_ENABLE | ffh 255 | ^ | Disable extruder motor scaling for non-farm print | LCD menu | D3 Ax0d04 C1
|
| 0x0D04 3332 | uint8_t | EEPROM_ECOOL_ENABLE | ffh 255 | ^ | Disable extruder motor scaling for non-farm print | LCD menu | D3 Ax0d04 C1
|
||||||
| ^ | ^ | ^ | 2ah 42 | ^ | Enable extruder motor scaling for non-farm print | ^ | D3 Ax0d04 C1
|
| ^ | ^ | ^ | 2ah 42 | ^ | Enable extruder motor scaling for non-farm print | ^ | D3 Ax0d04 C1
|
||||||
| 0x0D03 3321 | uint8_t | EEPROM_FW_CRASH_FLAG | 01h 1 | ff/00 | Last FW crash reason (dump_crash_reason) | D21/D22 | D3 Ax0d03 C1
|
| 0x0D03 3321 | uint8_t | EEPROM_FW_CRASH_FLAG | ffh 255 | ffh 255 | Last FW crash reason (dump_crash_reason) | D21/D22 | D3 Ax0d03 C1
|
||||||
|
| ^ | ^ | ^ | 00h 0 | ^ | manual | ^ | ^
|
||||||
|
| ^ | ^ | ^ | 01h 1 | ^ | stack_error | ^ | ^
|
||||||
|
| ^ | ^ | ^ | 02h 2 | ^ | watchdog | ^ | ^
|
||||||
|
| ^ | ^ | ^ | 03h 3 | ^ | bad_isr | ^ | ^
|
||||||
|
| ^ | ^ | ^ | 04h 4 | ^ | bad_pullup_temp_isr | ^ | ^
|
||||||
|
| ^ | ^ | ^ | 05h 5 | ^ | bad_pullup_step_isr | ^ | ^
|
||||||
|
|
||||||
| Address begin | Bit/Type | Name | Valid values | Default/FactoryReset | Description | Gcode/Function| Debug code
|
| Address begin | Bit/Type | Name | Valid values | Default/FactoryReset | Description | Gcode/Function| Debug code
|
||||||
| :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--:
|
| :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--:
|
||||||
|
@ -299,6 +299,15 @@ ISR(TIMER1_COMPA_vect) {
|
|||||||
if (sp < SP_min) SP_min = sp;
|
if (sp < SP_min) SP_min = sp;
|
||||||
#endif //DEBUG_STACK_MONITOR
|
#endif //DEBUG_STACK_MONITOR
|
||||||
|
|
||||||
|
#ifdef DEBUG_PULLUP_CRASH
|
||||||
|
// check for faulty pull-ups enabled on thermistor inputs
|
||||||
|
if ((PORTF & (uint8_t)(ADC_DIDR_MSK & 0xff)) || (PORTK & (uint8_t)((ADC_DIDR_MSK >> 8) & 0xff)))
|
||||||
|
pullup_error(false);
|
||||||
|
#else
|
||||||
|
PORTF &= ~(uint8_t)(ADC_DIDR_MSK & 0xff);
|
||||||
|
PORTK &= ~(uint8_t)((ADC_DIDR_MSK >> 8) & 0xff);
|
||||||
|
#endif // DEBUG_PULLUP_CRASH
|
||||||
|
|
||||||
#ifdef LIN_ADVANCE
|
#ifdef LIN_ADVANCE
|
||||||
advance_isr_scheduler();
|
advance_isr_scheduler();
|
||||||
#else
|
#else
|
||||||
|
@ -1683,6 +1683,16 @@ void adc_ready(void) //callback from adc when sampling finished
|
|||||||
|
|
||||||
FORCE_INLINE static void temperature_isr()
|
FORCE_INLINE static void temperature_isr()
|
||||||
{
|
{
|
||||||
|
#ifdef DEBUG_PULLUP_CRASH
|
||||||
|
// check for faulty pull-ups enabled on thermistor inputs
|
||||||
|
if ((PORTF & (uint8_t)(ADC_DIDR_MSK & 0xff)) || (PORTK & (uint8_t)((ADC_DIDR_MSK >> 8) & 0xff)))
|
||||||
|
pullup_error(true);
|
||||||
|
#else
|
||||||
|
PORTF &= ~(uint8_t)(ADC_DIDR_MSK & 0xff);
|
||||||
|
PORTK &= ~(uint8_t)((ADC_DIDR_MSK >> 8) & 0xff);
|
||||||
|
#endif // DEBUG_PULLUP_CRASH
|
||||||
|
|
||||||
|
|
||||||
if (!temp_meas_ready) adc_cycle();
|
if (!temp_meas_ready) adc_cycle();
|
||||||
lcd_buttons_update();
|
lcd_buttons_update();
|
||||||
|
|
||||||
|
@ -1848,6 +1848,11 @@ static void lcd_stack_crash()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef DEBUG_PULLUP_CRASH
|
||||||
|
void TestPullupCrash() {
|
||||||
|
PORTF |= 0x01;
|
||||||
|
}
|
||||||
|
#endif // DEBUG_PULLUP_CRASH
|
||||||
|
|
||||||
//! @brief Show Support Menu
|
//! @brief Show Support Menu
|
||||||
//!
|
//!
|
||||||
@ -2058,7 +2063,6 @@ static void lcd_support_menu()
|
|||||||
#endif /* DEBUG_BUILD */
|
#endif /* DEBUG_BUILD */
|
||||||
|
|
||||||
#endif //MK1BP
|
#endif //MK1BP
|
||||||
|
|
||||||
MENU_END();
|
MENU_END();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -8976,6 +8980,10 @@ void lcd_experimental_menu()
|
|||||||
MENU_ITEM_TOGGLE_P(_N("E-cool mode"), UserECoolEnabled()?_T(MSG_ON):_T(MSG_OFF), UserECool_toggle);////MSG_MENU_ECOOL c=18
|
MENU_ITEM_TOGGLE_P(_N("E-cool mode"), UserECoolEnabled()?_T(MSG_ON):_T(MSG_OFF), UserECool_toggle);////MSG_MENU_ECOOL c=18
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef DEBUG_PULLUP_CRASH
|
||||||
|
MENU_ITEM_FUNCTION_P(_N("Test Pullup Crash"), TestPullupCrash);
|
||||||
|
#endif // DEBUG_PULLUP_CRASH
|
||||||
|
|
||||||
#ifdef PRUSA_SN_SUPPORT
|
#ifdef PRUSA_SN_SUPPORT
|
||||||
MENU_ITEM_FUNCTION_P(_N("Fake serial number"), WorkaroundPrusaSN);////MSG_WORKAROUND_PRUSA_SN c=18
|
MENU_ITEM_FUNCTION_P(_N("Fake serial number"), WorkaroundPrusaSN);////MSG_WORKAROUND_PRUSA_SN c=18
|
||||||
#endif //PRUSA_SN_SUPPORT
|
#endif //PRUSA_SN_SUPPORT
|
||||||
|
@ -168,6 +168,8 @@
|
|||||||
#define DEBUG_DCODE3
|
#define DEBUG_DCODE3
|
||||||
#define DEBUG_DCODE6
|
#define DEBUG_DCODE6
|
||||||
|
|
||||||
|
//#define DEBUG_PULLUP_CRASH //Test Pullup crash
|
||||||
|
|
||||||
//#define DEBUG_BUILD
|
//#define DEBUG_BUILD
|
||||||
//#define DEBUG_SEC_LANG //secondary language debug output at startup
|
//#define DEBUG_SEC_LANG //secondary language debug output at startup
|
||||||
//#define DEBUG_XFLASH //debug external spi flash
|
//#define DEBUG_XFLASH //debug external spi flash
|
||||||
|
@ -170,6 +170,8 @@
|
|||||||
#define DEBUG_DCODE3
|
#define DEBUG_DCODE3
|
||||||
#define DEBUG_DCODE6
|
#define DEBUG_DCODE6
|
||||||
|
|
||||||
|
//#define DEBUG_PULLUP_CRASH //Test Pullup crash
|
||||||
|
|
||||||
//#define DEBUG_BUILD
|
//#define DEBUG_BUILD
|
||||||
//#define DEBUG_SEC_LANG //secondary language debug output at startup
|
//#define DEBUG_SEC_LANG //secondary language debug output at startup
|
||||||
//#define DEBUG_XFLASH //debug external spi flash
|
//#define DEBUG_XFLASH //debug external spi flash
|
||||||
|
@ -8,6 +8,8 @@ enum class dump_crash_reason : uint8_t
|
|||||||
stack_error,
|
stack_error,
|
||||||
watchdog,
|
watchdog,
|
||||||
bad_isr,
|
bad_isr,
|
||||||
|
bad_pullup_temp_isr,
|
||||||
|
bad_pullup_step_isr,
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef XFLASH_DUMP
|
#ifdef XFLASH_DUMP
|
||||||
|
Loading…
Reference in New Issue
Block a user