makerbase-mks / MKS-Robin-E3-E3D

MKS Robin E3 E3D 32Bit Control Board 3D Printer parts with tmc2209 Uart mode driver For Creality Ender 3 CR-10
https://www.aliexpress.com/item/4000781744682.html
GNU General Public License v3.0
118 stars 97 forks source link

Trouble configuring ONBOARD function to use the SD Card directly without a LCD #70

Closed HarpoDog closed 3 years ago

HarpoDog commented 3 years ago

I am trying to configure Marlin 2.0 Bugfix downloaded 1.30.21 to use the autostart feature directly from the SD card reader. I completed the configuration for a MKS Robin E3 with the Creality Ender 3 configuration files and it complied fine.

Next, I went to the configuration_adv.h file and uncommented #define SDCARD_CONNECTION ONBOARD on line 1403 and tried to build Marlin and got the following error message three places: Marlin\src\HAL\STM32F1\onboard_sd.cpp:42:25: error: 'ONBOARD_SD_CS_PIN' was not declared in this scope

Could you please tell provide me the proper files that I could copy into Marlin to remove this error or tell me which files I would need to modify, where within the files they would need to be modified, and the exact code I would need to use.

I am ok if the LCD gets disable as I will not have it attached.

Attached below are my configuration.h and configuratin_adv.h files.

Here is the complete error message: In file included from Marlin\src\HAL\STM32F1../../inc/../HAL/./STM32F1/HAL.h:36:0, from Marlin\src\HAL\STM32F1../../inc/../HAL/HAL.h:30, from Marlin\src\HAL\STM32F1../../inc/MarlinConfig.h:31, from Marlin\src\HAL\STM32F1\onboard_sd.cpp:16: Marlin\src\HAL\STM32F1\onboard_sd.cpp: In function 'void deselect()': Marlin\src\HAL\STM32F1\onboard_sd.cpp:42:25: error: 'ONBOARD_SD_CS_PIN' was not declared in this scope

define CS_HIGH() WRITE(ONBOARD_SD_CS_PIN, HIGH) / Set OnboardSPI cs high /

                     ^

Marlin\src\HAL\STM32F1../../inc/../HAL/./STM32F1/fastio.h:33:42: note: in definition of macro 'WRITE'

define WRITE(IO,V) (PIN_MAP[IO].gpio_device->regs->BSRR = _BV32(PIN_MAP[IO].gpio_bit) << ((V) ? 0 : 16))

                                      ^~

Marlin\src\HAL\STM32F1\onboard_sd.cpp:134:3: note: in expansion of macro 'CS_HIGH' CS_HIGH(); / CS = H / ^~~ Marlin\src\HAL\STM32F1\onboard_sd.cpp:42:25: note: suggested alternative: 'ONBOARD_SD_SPI'

define CS_HIGH() WRITE(ONBOARD_SD_CS_PIN, HIGH) / Set OnboardSPI cs high /

                     ^

Marlin\src\HAL\STM32F1../../inc/../HAL/./STM32F1/fastio.h:33:42: note: in definition of macro 'WRITE'

define WRITE(IO,V) (PIN_MAP[IO].gpio_device->regs->BSRR = _BV32(PIN_MAP[IO].gpio_bit) << ((V) ? 0 : 16))

                                      ^~

Marlin\src\HAL\STM32F1\onboard_sd.cpp:134:3: note: in expansion of macro 'CS_HIGH' CS_HIGH(); / CS = H / ^~~ Marlin\src\HAL\STM32F1\onboard_sd.cpp: In function 'int select()': Marlin\src\HAL\STM32F1\onboard_sd.cpp:41:25: error: 'ONBOARD_SD_CS_PIN' was not declared in this scope

define CS_LOW() WRITE(ONBOARD_SD_CS_PIN, LOW) / Set OnboardSPI cs low /

                     ^

Marlin\src\HAL\STM32F1../../inc/../HAL/./STM32F1/fastio.h:33:42: note: in definition of macro 'WRITE'

define WRITE(IO,V) (PIN_MAP[IO].gpio_device->regs->BSRR = _BV32(PIN_MAP[IO].gpio_bit) << ((V) ? 0 : 16))

                                      ^~

Marlin\src\HAL\STM32F1\onboard_sd.cpp:143:3: note: in expansion of macro 'CS_LOW' CS_LOW(); / CS = L / ^~ Marlin\src\HAL\STM32F1\onboard_sd.cpp:41:25: note: suggested alternative: 'ONBOARD_SD_SPI'

define CS_LOW() WRITE(ONBOARD_SD_CS_PIN, LOW) / Set OnboardSPI cs low /

                     ^

Marlin\src\HAL\STM32F1../../inc/../HAL/./STM32F1/fastio.h:33:42: note: in definition of macro 'WRITE'

define WRITE(IO,V) (PIN_MAP[IO].gpio_device->regs->BSRR = _BV32(PIN_MAP[IO].gpio_bit) << ((V) ? 0 : 16))

                                      ^~

Marlin\src\HAL\STM32F1\onboard_sd.cpp:143:3: note: in expansion of macro 'CS_LOW' CS_LOW(); / CS = L / ^~ Marlin\src\HAL\STM32F1\onboard_sd.cpp: In function 'void power_on()': Marlin\src\HAL\STM32F1\onboard_sd.cpp:161:13: error: 'ONBOARD_SD_CS_PIN' was not declared in this scope OUT_WRITE(ONBOARD_SD_CS_PIN, HIGH); / Set CS# high / ^ Marlin\src\HAL\STM32F1../../inc/../HAL/./STM32F1/fastio.h:37:55: note: in definition of macro '_SET_MODE'

define _SET_MODE(IO,M) gpio_set_mode(PIN_MAP[IO].gpio_device, PIN_MAP[IO].gpio_bit, M)

                                                   ^~

Marlin\src\HAL\STM32F1../../inc/../HAL/./STM32F1/fastio.h:41:37: note: in expansion of macro '_SET_OUTPUT'

define OUT_WRITE(IO,V) do{ _SET_OUTPUT(IO); WRITE(IO,V); }while(0)

                                 ^~~~~~~~~~~

Marlin\src\HAL\STM32F1\onboard_sd.cpp:161:3: note: in expansion of macro 'OUT_WRITE' OUT_WRITE(ONBOARD_SD_CS_PIN, HIGH); / Set CS# high / ^~~~~ Marlin\src\HAL\STM32F1\onboard_sd.cpp:161:13: note: suggested alternative: 'ONBOARD_SD_SPI' OUT_WRITE(ONBOARD_SD_CS_PIN, HIGH); / Set CS# high / ^ Marlin\src\HAL\STM32F1../../inc/../HAL/./STM32F1/fastio.h:37:55: note: in definition of macro '_SET_MODE'

define _SET_MODE(IO,M) gpio_set_mode(PIN_MAP[IO].gpio_device, PIN_MAP[IO].gpio_bit, M)

                                                   ^~

Marlin\src\HAL\STM32F1../../inc/../HAL/./STM32F1/fastio.h:41:37: note: in expansion of macro '_SET_OUTPUT'

define OUT_WRITE(IO,V) do{ _SET_OUTPUT(IO); WRITE(IO,V); }while(0)

                                 ^~~~~~~~~~~

Marlin\src\HAL\STM32F1\onboard_sd.cpp:161:3: note: in expansion of macro 'OUT_WRITE' OUT_WRITE(ONBOARD_SD_CS_PIN, HIGH); / Set CS# high / ^~~~~ Config.h.zip Config_Adv.h.zip

Thank you for your support!

mks-viva commented 3 years ago

Hi! Do you want to print directly without selecting via LCD?

HarpoDog commented 3 years ago

I want to print directly from the SD Card on the motherboard. I will not have an LCD installed.Sent from Samsung Galaxy smartphone. -------- Original message --------From: mks-viva notifications@github.com Date: 1/31/21 5:59 PM (GMT-08:00) To: makerbase-mks/MKS-Robin-E3-E3D MKS-Robin-E3-E3D@noreply.github.com Cc: HarpoDog SWEIDNER@PROGRAMNAVIGATORS.COM, Author author@noreply.github.com Subject: Re: [makerbase-mks/MKS-Robin-E3-E3D] Trouble configuring ONBOARD function to use the SD Card directly without a LCD (#70) Hi! Do you want to print directly without selecting via LCD?

—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or unsubscribe.

mks-viva commented 3 years ago

Have use MKS TFT and MKS TFT WIIF?

HarpoDog commented 3 years ago

I do not have or plan to use  a MKS TFT or MKS TFT wifi. I need to and want to print directly from the Micro SD in the Micro SD Card slot onboard the MKS Robin  E3's motherboard by executing the g-code file to print using the Marlin Autostart feature.Are you familiar with the Marlin Autostart feature? It works very well.Sent from Samsung Galaxy smartphone. -------- Original message --------From: mks-viva notifications@github.com Date: 1/31/21 7:54 PM (GMT-08:00) To: makerbase-mks/MKS-Robin-E3-E3D MKS-Robin-E3-E3D@noreply.github.com Cc: HarpoDog SWEIDNER@PROGRAMNAVIGATORS.COM, Author author@noreply.github.com Subject: Re: [makerbase-mks/MKS-Robin-E3-E3D] Trouble configuring ONBOARD function to use the SD Card directly without a LCD (#70)

Have use MKS TFT and MKS TFT WIIF?

—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or unsubscribe.

mks-viva commented 3 years ago

You can rename gcode file name to auto.g, and it is will auto printing when you power on.

HarpoDog commented 3 years ago

Yes. I have always used auto0.g. IT is a really nice feature when you don't have or don't want to use a LCD.Thank you for your help so far. I look forward to your solution that will modify the Marlin firmware, allow it to complie, and enable the Autostart feature.Sent from Samsung Galaxy smartphone. -------- Original message --------From: mks-viva notifications@github.com Date: 1/31/21 9:06 PM (GMT-08:00) To: makerbase-mks/MKS-Robin-E3-E3D MKS-Robin-E3-E3D@noreply.github.com Cc: HarpoDog SWEIDNER@PROGRAMNAVIGATORS.COM, Author author@noreply.github.com Subject: Re: [makerbase-mks/MKS-Robin-E3-E3D] Trouble configuring ONBOARD function to use the SD Card directly without a LCD (#70) You can rename gcode file name to auto.g, and it is will auto printing when you power on.

—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or unsubscribe.

HarpoDog commented 3 years ago

Any thoughts on how to set up Marlin firmware to print directly from the Micro SD card on the MKS Robin E3 V1.0 when one doesn't have an LCD or TFT connected.Sent from Samsung Galaxy smartphone. -------- Original message --------From: mks-viva notifications@github.com Date: 1/31/21 9:06 PM (GMT-08:00) To: makerbase-mks/MKS-Robin-E3-E3D MKS-Robin-E3-E3D@noreply.github.com Cc: HarpoDog SWEIDNER@PROGRAMNAVIGATORS.COM, Author author@noreply.github.com Subject: Re: [makerbase-mks/MKS-Robin-E3-E3D] Trouble configuring ONBOARD function to use the SD Card directly without a LCD (#70) You can rename gcode file name to auto.g, and it is will auto printing when you power on.

—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or unsubscribe.

mks-viva commented 3 years ago

At present, auto0.g is the best choice

HarpoDog commented 3 years ago

Ok, so how do I resolve my issue above as noted in the error message above so The MKS robin E3 with Marlin 2.0 will recognize the the Micro SD card onboard the MSK motherboard and I can print directly from the Micro SD card without an LCD or TFT? . How do I declare the ONBOARD_SD_CS_PIN within the scope noted and resolve the error above. Thank you your support.

HarpoDog commented 3 years ago

As a reminder, the errors occur when I am trying to compile the latest version of Marlin 2.0.

mks-viva commented 3 years ago

MKS Robin E3/E3D's TF card is onboard default.

HarpoDog commented 3 years ago

Is what you are saying is that he TF Card on the LCD or TFT is the default? in the Marlin configuration_adv.h file - the following are the three options

endif // SDSUPPORT

When you uncomment the //#define SDCARD_CONNECTION ONBOARD so it reads #define SDCARD_CONNECTION ONBOARD, then compile, you get the error message above.

This is the problem I am trying to resolve and would appreciate your help to resolve the issue.

mks-viva commented 3 years ago

ONBOARD_SD_SS_PIN = SD_SS_PIN

HarpoDog commented 3 years ago

Is ONBOARD_SD_SS_PIN = SD_SS_PIN what I add to Marline and if so, where do I add this within Marlin - to which files, where within the files?

I am not sure what you are telling me below. I am not an experienced coder so will need a little more explanation please.

Thanks

From: mks-viva [mailto:notifications@github.com] Sent: Wednesday, February 3, 2021 6:08 PM To: makerbase-mks/MKS-Robin-E3-E3D MKS-Robin-E3-E3D@noreply.github.com Cc: HarpoDog SWEIDNER@PROGRAMNAVIGATORS.COM; Author author@noreply.github.com Subject: Re: [makerbase-mks/MKS-Robin-E3-E3D] Trouble configuring ONBOARD function to use the SD Card directly without a LCD (#70)

ONBOARD_SD_SS_PIN = SD_SS_PIN

- You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/makerbase-mks/MKS-Robin-E3-E3D/issues/70#issuecomment-77 2969648 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ASVG3TEWF22RKYZ33WNUJLLS5 H6PLANCNFSM4W2UUVOQ . https://github.com/notifications/beacon/ASVG3TEG2XZWULPSHX7S44TS5H6PLA5CNFS M4W2UUVO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFYJJJMA .gif


https://home.mcafee.com/utm_medium=email&utm_source=link&utm_campaign=sig-e mail&utm_content=emailclient?utm_medium=email&utm_source=link&utm_campaign=s ig-email&utm_content=emailclient

Scanned by McAfee https://home.mcafee.com/utm_medium=email&utm_source=link&utm_campaign=sig-e mail&utm_content=emailclient?utm_medium=email&utm_source=link&utm_campaign=s ig-email&utm_content=emailclient and confirmed virus-free.

mks-viva commented 3 years ago

You need add "#define ONBOARD_SD_SS_PIN SD_SS_PIN" in pins_MKS_ROBIN_E3.h file

mks-viva commented 3 years ago

If have not response, I will close this issues temporaril.

HarpoDog commented 3 years ago

Sorry for the slow response. I work on a ship and can be days without being connected.

I believe what I need to know is how to is how to define “ONBOARD_SD_CS_PIN” in three different scopes within the exact locations of the “Marlin\src\HAL\STM32F1\onboard_sd.cpp" file.

Your suggestion of "You need add "#define ONBOARD_SD_SS_PIN SD_SS_PIN" in pins_MKS_ROBIN_E3.h file" did not change the three error messages when compiling.

Attached is the Marlin folder I am testing. It would be appreciated if you could test this folder,make the corrections as need to get it to compile, and send me the corrected files.

Marlin-bugfix-2.0.x onboard test.zip

Thank you for your support!