Welcome! Log In Create A New Profile

Advanced

MKS monster 8, no USB serial appears

Posted by transistor 
MKS monster 8, no USB serial appears
February 12, 2023 05:15AM
Hi, I have a problem. I have bought MKS monster 8 board which I want to use for my CNC, but I can't get it to create a USB serial port. The SERIAL_PORT is set to -1. The hardware itself seems to work fine, because when i reset it with BOOT button pressed down, it creates a STM32 device, visible in my Device Manager. No serial ports appear in device manager when I reset it without BOOT button pressed and no unknown devices. Nothing.

I've tried to upload some .bin files for MKS Monster 8, that I found over the internet - none of them worked. I've tried uploading them using STMCubeProgrammer, I've tried uploading them using DFU-Upload which I found at MKS monster 8 wiki. I've tried uploading using SD-card, but that will no longer work, because I've rewritten it all by STMCubeProgrammer. I've tried building Marlin with configuration for this board, which I found on the internet. I've even tried to modify some things there (remove LCD menus, because I do not have an LCD) etc. Nothing helps. As it's such a basic functionality that I can't seem to get working (and again, hardware seems to be ok) I'm probably not aware of some basic stuff going on inside Marlin or the correct way to upload the firmware. Should the firmware uploaded to the 0x08000000 address even work, or maybe Marlin requires some other bootloader stuff to be present before the actual Marlin code?

The Marlin firmware is so huge and complex, that I don't know even where to start debugging or what to think. Please help.
Re: MKS monster 8, no USB serial appears
February 12, 2023 10:24AM
Did you save the original bootloader/image before uploading the new BIN via the STMCubeProgrammer?

If not you'll need to get a new bootloader.

Easiest way is to buy a new MKS monster 8 and copy the bootloader over.

You can also try building your own bootloader. OpenBLT is one place to get info on this.

The problem with building your own bootloader is trying to match the operation of the new to the old in areas like application load address, checksum and expected file name.

Marlin's monster8 build script uses 0x0800C000 as the start of the application area. I didn't see anything about a checksum.
Re: MKS monster 8, no USB serial appears
February 12, 2023 03:02PM
Great, thank you for the answer.

1) I was stupid enough not to save it
2) regarding readout from new PCB, I've contacted the seller asking to send me the readout.
3) The DFU-Upload, that I mentioned has 2 scripts - DFU-Upload-bootloader and DFU-Upload-firmware and 2 .bin image files. When I run them both, DFU-upload-firmware writes the .bin file to the 0x0800C000 address. In such case actually the serial port appears in the Device manager, but I could not get anything out of it. I tred sending "G0\n", "G0 X0\n" and "M501" g codes. Nothing..

I even tried adding
MYSERIAL1.print("hlo\n");
line inside the loop() funtion of the MarlinCore.cpp file, hoping that it would start spamming at least something over this port - still nothing. But at least now I get serial port in the Device Manager.

Just like if it's stuck inside the booltoader and it's a serial port of the bootloader, not of Marlin. (Not even sure if the bootloder creates it's port... )

What should I do next?
Re: MKS monster 8, no USB serial appears
February 12, 2023 04:31PM
Can you point me at those scripts and BIN files?

I suspect they are aimed at an STM32F1xx MCU while the Octopus is a STM32F4xx.
Re: MKS monster 8, no USB serial appears
February 12, 2023 04:54PM
Re: MKS monster 8, no USB serial appears
February 12, 2023 05:02PM
Try installing the BOOT0 jumper (near the CPU) and pressing the reset button. That should enable the DFU bootloader which then makes the USB port functional.
Re: MKS monster 8, no USB serial appears
February 12, 2023 06:09PM
Hi, thank you again for your responce. First of all the BOOT0 jumper (it's a button in case of MKS Monster 8 board) works perfectly. This is how I've determined before my first post, that the hardware is working. Basically when I reset with boot button pressed, the STM32's built in bootloader kicks in and I get "STM32 BOOTLOADER" device in the Device Manager. So I'm not really sure what is the point of separate OpenBLT bootloader in program memory, but let it be for now, because with it at least some port gets created...

But so far I've been testing on, and if I comment out most of loop() function in the MarlinCore file, the MCU seems to get reset every few seconds. I make this conclusion, because serial port disappears and appears again constantly. This would imply, that I'm not stuck in the booloader, and the serial port is actually one of the Marlin firmware itself. Which is a good sign already. But I still do not understand why I can't send anything there.

As you probably understood from my babble I've been building Marlin with the configuration I got somewhere in the internet (don't even remember where exaclty). Figured out that it would be a good idea to check the pinout. It seems that the pinout is described in the variant.h file, and that the variant used is MARLIN_F4x7Vx. And the pinout there does not actually seem to describe the board I have... The board schematic can be found here:
[raw.githubusercontent.com]
e.g. in this variant.h file there is a row #define PIN_SERIAL_RX PA3, while on the schematic the PA3 is allocated to HE2

Something dodgy. But even if my build is broken, it still is strange that the .bin files downloaded with the DFU-Upload are not working... And still I do not understand about this variant.h file. Is my config using the incorrect variant? Shouldn't there be a variant specialized for MKS Monster 8?
Re: MKS monster 8, no USB serial appears
February 12, 2023 07:04PM
"comment out most of loop() function in the MarlinCore file" - that isn't going to buy you anything. Don't bother.

Marlin already has a variant specialized for MKS Monster 8. It's being used sucessfully by lots of other users.

PA3 has multiple configuration options. Plain jane I/O, USART2_RX, TIM5_CH4, TIM9_CH2, TIM2_CH4, OTG_HS_ULPI_D0, ETH_MII_COL and EVENTOUT are what I found. If you don't want to use it to drive the HE2 FET then set SERIAL_PORTx to 2 and Marlin will set it up as a serial port.

The Marlin build process assumes the Marlin image is loaded at 0x0800 C000.
  • If the DFU bootloader puts the image at 0x800 C000 then on reset the MCU will try to execute at 0x0800 0000 so the MCU will get lost.
  • If the DFU loads it at 0x800 0000 then the jump/reset vetor table will be pointing at where the image SHOULD be located so it'll get lost.

You need something that expects to load at 0x0800 0000. Long shot - try modifying ini\stm32f4.ini lines 555 & 556 to have a zero offset.
Re: MKS monster 8, no USB serial appears
February 12, 2023 07:28PM
You've definitely got more knowledge about programming than I expected. Maybe you should consider rolling your own bootloader.

I didn't find any SD card bootloaders that can be used as is for your card. Here's some links that you might use as a basis:
[embetronicx.com]
[github.com]
[www.stm32duino.com]
[www.feaser.com]
[forum.chibios.org]

The Octopus has the 4 data line SDIO port connected to the SD card. Best to use that mode. It can also be setup in SPI mode but it's not as fast and robust.
Sorry, only registered users may post in this forum.

Click here to login