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] Marlin 2.0, BOARD_MKS_SGEN creates an error while compiling #16493

Closed
GerhardSchroeder opened this issue Jan 7, 2020 · 10 comments
Closed

Comments

@GerhardSchroeder
Copy link

Bug Description

Have a MKS SGEN 1.0 and try to create a bin file.
When i use the Board "BOARD_MKS_SGEN", i got the error:
"Marlin\src\HAL\HAL_LPC1768../../inc/../pins/lpc1769/../lpc1768/pins_MKS_SBASE.h:29:4: error: #error "Oops! Make sure you have the LPC1768 environment selected in your
IDE.""

When i disable the checking in the "pins_MKS_SBASE.h file. Which is included in the pins_MKS_SGEN.h file.

#ifndef MCU_LPC1768
// #error "Oops! Make sure you have the LPC1768 environment selected in your IDE."
#endif

It compiles without any errors. But after uploading to the Board, the Board is not accessible via USB, COM port anymore.
When i write back the Smoothie firmware, the Board is working again.

My Configurations

https://www.dropbox.com/sh/k4trz437e9x80uw/AACL9D_LHvTkixpH1_Q2Vi3ha?dl=0

Steps to Reproduce

  1. [First Step]
  2. [Second Step]
  3. [and so on...]

Expected behavior: [What you expect to happen]

Actual behavior: [What actually happens]

Additional Information

  • Provide pictures or links to videos that clearly demonstrate the issue.
  • See How Can I Contribute for additional guidelines.
@tatusah
Copy link

tatusah commented Jan 7, 2020

The error notice tries to guide you to check the platformio.ini file setting for the default environment. You likely have something other than LPC1768 set for the default_envs if you haven't made any changes to that file.

@GerhardSchroeder
Copy link
Author

Hi, platform settings is default. But i compile with the env:LPC1769 in PlatformIO
BOARD_MKS_SGEN is using a LPC1769 processor.

So far i can see, the problem is in the included pins_MKS_SBASE.h file which has a LPC1768 processor.
Here is an error check
#ifndef MCU_LPC1768
#error "Oops! Make sure you have the LPC1768 environment selected in your IDE."
#endif
But i need to use LPC1769 for the MKS SGEN

Here is the part from pins_MKS_SGEN.h. In the last line is the include of the pins_MKS_SBASE.h.

/**

  • MKS SGen pin assignments
    */

#ifndef MCU_LPC1769
#error "Oops! Make sure you have the LPC1769 environment selected in your IDE."
#endif

#define BOARD_INFO_NAME "MKS SGen"
#define BOARD_WEBSITE_URL "github.com/makerbase-mks/MKS-SGEN"

#include "../lpc1768/pins_MKS_SBASE.h"

@boelle
Copy link
Contributor

boelle commented Jan 7, 2020

what ide do you use?

@tatusah
Copy link

tatusah commented Jan 7, 2020

Ah, sorry mixed up SGEN and SGENL.

@tatusah
Copy link

tatusah commented Jan 7, 2020

It's a bit similar situation as with SKR v1.4 and the Turbo variant. Those don't use definition check for the MCU in the pins files as it would lead to similar kind of situation if it wasn't done with extra conditions taking into account the LPC1768 and LPC1769 processors. But that ifndef check aside have you tried setting the #define SERIAL_PORT -1 it seems to be what is set in the Makerbase github example although it's last updated May 2019. Your example config seemed to have this set to 0.

@GerhardSchroeder
Copy link
Author

@boelle IDE is VS Code
Just comment out the env. checking in the SBASE.h and set the serial port to -1
It compiles without errors, but still no access to the board. Also the board Led's are not blinking like it should be.

@tatusah
Copy link

tatusah commented Jan 7, 2020

What firmware did the board come with Marlin or Smoothieware? Do you update the firmware with SD card or through Platformio? I'm wondering if there are some remnants of the other firmware on the board preventing good flash.

@ellensp
Copy link
Contributor

ellensp commented Jan 8, 2020

Yes this is a bug.. pins_MKS_SGEN.h correctly checks for a LPC1769 but then includes ../lpc1768/pins_MKS_SBASE.h which checks for a LPC1768. generating a PR to fix this

@ellensp
Copy link
Contributor

ellensp commented Jan 8, 2020

This has been fixed in marlin bugfix-2.0.x

@boelle boelle closed this as completed Jan 8, 2020
@github-actions
Copy link

github-actions bot commented Jul 3, 2020

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 Jul 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants