Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] MKS Robin E3 hangs after PR #19614 #19677

Closed
ldursw opened this issue Oct 10, 2020 · 13 comments
Closed

[BUG] MKS Robin E3 hangs after PR #19614 #19677

ldursw opened this issue Oct 10, 2020 · 13 comments

Comments

@ldursw
Copy link
Contributor

ldursw commented Oct 10, 2020

Bug Description

After applying the PR #19614 the printer gets stuck on the bootloader screen, Marlin does not start up.

I have updated the branch 2.0.x from 2.0.7 to the latest commit and noticed Marlin didn't boot. I've done a bisect to find the commit and found 25cf9c6 to be causing the regression.

My Configurations

Marlin.zip
Printer: Ender-3 Pro
Board: MKS Robin E3

Steps to Reproduce

  1. Build Marlin with the commit applied
  2. Flash the firmware using a Micro SD card

Expected behavior: Marlin boots up and works normally

Actual behavior: Board gets stuck at bootloader

Additional Information

bootloader

@oscar6502
Copy link

Same problem witch skrpro and reprap full graphic smart controller

@rhapsodyv
Copy link
Member

can you try commenting out this like:

#define LCD_USE_I2C_BUZZER // Enable buzzer on LCD, used for both I2C and SPI buses (LiquidTWI2 not required)

@thisiskeithb
Copy link
Member

thisiskeithb commented Oct 10, 2020

I can confirm that I'm seeing the same issues after #19614 was merged on an SKR Pro 1.1 and MKS Robin E3. I tried the latest bugfix on a BTT002 and it booted, but acted like you were holding down the encoder.

can you try commenting out this like:

That didn't work for my SKR Pro/Full Graphic Smart Controller build I have on the bench.

@rhapsodyv
Copy link
Member

One more test: change all those 0x1F to 0xF 👍

if (V) FastIOPortMap[STM_PORT(digitalPin[IO])]->BSRR = _BV32(digitalPinToPinName(IO) & 0x1F) ; \

else FastIOPortMap[STM_PORT(digitalPin[IO])]->BRR = _BV32(digitalPinToPinName(IO) & 0x1F) ; \

#define _READ(IO) bool(READ_BIT(FastIOPortMap[STM_PORT(digitalPin[IO])]->IDR, _BV32(digitalPinToPinName(IO) & 0x1F)))

#define _TOGGLE(IO) (FastIOPortMap[STM_PORT(digitalPin[IO])]->ODR ^= _BV32(digitalPinToPinName(IO) & 0x1F))

@oscar6502
Copy link

I can confirm that I'm seeing the same issues after #19614 was merged.

can you try commenting out this like:

That didn't work for my SKR Pro/Full Graphic Smart Controller build I have on the bench.

I'm sorry, I don't speak English, I use a translator

@thisiskeithb
Copy link
Member

I'm sorry, I don't speak English, I use a translator

I'm working with @rhapsodyv on Discord, so a fix should be incoming shortly.

@oscar6502
Copy link

I'm sorry, I don't speak English, I use a translator

I'm working with @rhapsodyv on Discord, so a fix should be incoming shortly.

Thank you, I appreciate your work and that of the community!

@thisiskeithb
Copy link
Member

See #19678 for the fix.

@ldursw
Copy link
Contributor Author

ldursw commented Oct 10, 2020

Confirmed #19678 fixed the issue for me.

@sjasonsmith
Copy link
Contributor

I am very confused how fixing HAL/STM32 fixed E3 boards that use HAL/STM32F1. Two people have said it fixes it though, so I am at a loss...

@thisiskeithb
Copy link
Member

I am very confused how fixing HAL/STM32 fixed E3 boards that use HAL/STM32F1. Two people have said it fixes it though, so I am at a loss...

After we talked, I wanted to figure it out as well.

The Robin E3 board can be...particular about SD cards sometimes and won't boot (It will after ~30 seconds, but appears to be stuck on the "boot" text screen).

I re-flashed 6fdaaf3 and the Robin E3 booted. 🤷‍♂️

I think we just happened to stumble into the bug & fix thanks to @oscar6502's comment.

@Serhiy-K
Copy link
Contributor

I tested fastio.h for STM32 on my STM32F411 board with next changes:

#if defined(STM32F0xx) || defined(STM32F1xx) || defined(STM32F3xx) || defined(STM32L0xx) || defined(STM32L4xx)
#define** _WRITE(IO, V) do { \
if (V) FastIOPortMap[STM_PORT(digitalPin[IO])]->BSRR = _BV32(STM_PIN(digitalPin[IO])) ; \
else FastIOPortMap[STM_PORT(digitalPin[IO])]->BRR = _BV32(STM_PIN(digitalPin[IO])) ; \
}while(0)
#define _READ(IO) bool(READ_BIT(FastIOPortMap[STM_PORT(digitalPin[IO])]->IDR, _BV32(STM_PIN(digitalPin[IO]))))
#define _TOGGLE(IO) (FastIOPortMap[STM_PORT(digitalPin[IO])]->ODR ^= _BV32(STM_PIN(digitalPin[IO])))
#else
#define _WRITE(IO, V) (FastIOPortMap[STM_PORT(digitalPinToPinName(IO))]->BSRR = _BV32((digitalPinToPinName(IO) & 0xF) + ((V) ? 0 : 16)))
#define _READ(IO) bool(READ_BIT(FastIOPortMap[STM_PORT(digitalPinToPinName(IO))]->IDR, _BV32(digitalPinToPinName(IO) & 0xF)))
#define _TOGGLE(IO) (FastIOPortMap[STM_PORT(digitalPinToPinName(IO))]->ODR ^= _BV32(digitalPinToPinName(IO) & 0xF))
#endif

For MCUs listed in the first line used digitalPin[IO] and for other - digitalPinToPinName(IO). For bit selection used digitalPinToPinName(IO) & 0xF. digitalPinToPinName (IO) is required because in some variant.h files A0-An pins are defined as analog.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants