makerbase-mks / MKS-SGEN_L-V2

MKS SGEN_L V2.0 is powerful 32-bit 3D printer control board. The CPU is LPC1769 120MHZ, SGEN_L V2 hardware Integrated 4KB EEPROM, 5AXIS and dual Z interface, has 2 way FANs and Dc12/24V out interface, support TMC UART and SPI mode...
https://www.aliexpress.com/item/4001283346331.html?spm=a2g0o.store_home.slider_165457030.0
GNU General Public License v3.0
71 stars 28 forks source link

[SOLVED] On-board SD card not recognized: unable to install/update firmware #19

Closed NeoMod closed 3 years ago

NeoMod commented 3 years ago

I've bought a brand new SGEN-L v2 last week and today I've finally found some time to mount it on my printer, except I've found out that I can't install/update the firmware because the on-board microSD isn't recognized.

I've tried both under Windows and Linux: the board is recognized but not the microSD. Under Windows It sometimes appears as a dummy drive: the enumerator assigns a letter to the drive but I'm unable to access it. Almost as If I had connected a card reader with no card inside.

I tried resetting the board using the on-board reset button but apparently, this switch only causes a soft reset.

One strange thing I noticed: this board had already a firmware installed (Marlin), with some customizations, while with the previous (two SGEN-L boards) I didn't find any pre-installed firmware.

(and yes, I'm sure the Marlin installed on the board is not my compiled version: my customizations are missing and there are some which I've never used.)

I also tried with the M997 command with no luck: the board enters a sort of halt state (power LED "red" always-on, other LEDs off) and I still can't access the microSD. I've also tried renaming the microSD to "REARM" and creating a dummy "firmware.cur" file on it, hoping to trigger the recognition but to no avail.

I hope there is any possible solution to this issue aside buying a new board.

NeoMod commented 3 years ago

Update: suspected the previous configuration (probably the one the board was tested with) had a different LCD connected with a different setting for SD usage.

I've been able to release the on-board microSD from Marlin access with the "M22" command and - at least - I can confirm the microSD is working. I can access it via USB just as expected.

The issue is still the same, however: I can't update the firmware to correct this situation. In order to upgrade the firmware I need to power-cycle the board, but as soon as I do that the microSD is locked again and the board won't acknowledge the firmware.bin file on it. Feels like an endless circle.

NeoMod commented 3 years ago

Ok, so after pulling an all-nighter on this I finally found a way to solve the issue.

There are two possible roads to follow:

  1. Re-Flash the LPC1769 Bootloader (FTDI Cable or Arduino) and start fresh with the firmware.

  2. Follow a specific sequence of actions (don't know if specific only to this board or configuration) to "force" the FW Update.

Before continuing, let me point out a couple of things I've learned.

I'm not going to describe how to flash the bootloader, there are plenty of guides available and the LPC176x community has some nice tutorials.

As for the second method, here is what tricked the successful firmware update:

Hopefully, in the end, the board will start updating the firmware upon reboot (you can notice the BLUE LED pattern changing) and it will reboot; once the LCD shows the Marlin Bootscreen the procedure is successful. Wait about 1 minute for the start-up to finish and confirm EEPROM INIT via LCD.

Good luck with your board, I hope this could help you not wasting an entire night on a trivial issue such as this one.

michalfrnoch commented 3 years ago

please, link to bootloader.bin