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

Build Help Thread #1

Open
xC0000005 opened this issue May 29, 2019 · 45 comments
Open

Build Help Thread #1

xC0000005 opened this issue May 29, 2019 · 45 comments

Comments

@xC0000005
Copy link
Owner

xC0000005 commented May 29, 2019

Steps:

  1. Download and install the Arduino IDE from https://www.arduino.cc/en/Main/Software
    In the Arduino IDE, under preferences (Mac, no idea for Windows), add the following additional boards manager url: https://github.com/stm32duino/BoardManagerFiles/raw/dev/STM32/package_stm_index.json

  2. From Tools->Board->Choose “Board Manager.”

  3. Install the STM Microsystems Core. You know it’s the right one because it even says it supports the M200 V1 and V2.

  4. Download Marlin 2.x + a few M200 fixes. This won’t always be necessary but I have a few fixes not in main yet. From https://github.com/xC0000005/Marlin/tree/M200Fixes, choose “Clone or download” and download it somewhere.

  5. Open the Marlin project in the Arduino IDE by choosing File->Open and browsing to wherever you downloaded Marlin.

  6. Make sure you have the right external library and USB settings selected. If your printer works but the LCD won’t show temperatures, you didn’t. Your board should be the appropriate one for your printer (early run V2s use the V1 board setting). USART->Enabled (generic Serial), USB support -> “CDC (no generic Serial)”, USB speed->”Low/Full Speed”, C Runtime Library must be a version that includes Float Printf for now.
    Screen Shot 2019-04-25 at 9 38 17 PM

  7. Customize your configuration.h. In this particular branch, it’s already set up for an early run V2 but if you have a V1 you’ll need to make changes to the steps per unit.

  8. From the Sketch Menu, choose Export Compiled Binary. It will take a while.

  9. When it’s done, look near the end for a line like this:

  10. arm-none-eabi-objcopy -O binary /var/folders/2w/45wss0310nbfs7dbvg2mv01c0000gn/T/arduino_build_780815/Marlin.ino.elf /var/folders/2w/45wss0310nbfs7dbvg2mv01c0000gn/T/arduino_build_780815/Marlin.ino.bin - that’s your firmware, “Marlin.ino.bin”

  11. Make sure the X and Y limit switches are not closed by moving the bed slightly forward and the x carriage to the right a bit. If you do not do this, the bootloader will wait, attempting to update the LCD.

  12. For a V1, this file needs to be copied to your SD card as “update.bin.” If you choose to build for a V2 to test it, it would be “firmware.bin”. Otherwise, it’s identical to any other reflash (put a file called fcupdate.flg on the root of the sd card, restart, etc).

  13. Your first sign it’s working will be when you see a version number of 99 on restart.

If you have Windows, you can use the Arduino Portable installation here: https://1drv.ms/u/s!AjuNQlXUvQuaq-45AF_Nwk7l9XIhag

@atomgomba
Copy link

I just compiled and flashed (previously was stock V41) from e03432b and I did not get the message on the LCD with version number "V99". Even though I see this response in OctoPrint:

Recv: FIRMWARE_NAME:Marlin bugfix-2.0.x (Github) SOURCE_CODE_URL:https://github.com/MarlinFirmware/Marlin PROTOCOL_VERSION:1.0 MACHINE_TYPE:Malyan M200 EXTRUDER_COUNT:1 UUID:cede2a2f-41a2-4748-9b12-c55c62f367ff

And this seems to be success regardless.

@xC0000005
Copy link
Owner Author

xC0000005 commented Jun 17, 2019 via email

@atomgomba
Copy link

I have a clean working tree, same state as remote.

@xC0000005
Copy link
Owner Author

xC0000005 commented Jun 17, 2019 via email

@xC0000005
Copy link
Owner Author

Another possibility is that you have the X and Y limit switches closed, so the bootloader is trying to update the UI firmware. Remove the SD card, move X and Y so they're not closed, and restart, see if it works.

@tthfry
Copy link

tthfry commented Aug 18, 2019

I've started messing with marlin again and used your portable package for building. Worked like a charm, but every second time you launch the IDE, the STM32 boards are gone. If you download them from the repository, select "3D Printer Boards" and "Malyan M200" (in my case v1), upon building it says that it can't open printer boards because they're not found.

It appears that opening the board manager alone is enough to let it "forget" the old STM library.

@xC0000005
Copy link
Owner Author

xC0000005 commented Aug 19, 2019 via email

@tthfry
Copy link

tthfry commented Aug 24, 2019

Okay, tried some more. I can build with STM 1.6.1 and latest marlin bugfix branch when using the 1.8.9 IDE. I can't build using the beta 1.9 IDE from the portable package and the included STM (I guess it's 1.6.0-dev?) once I opened the board manager or closed and reopened the IDE. In the latter case I get the "board not found" error. So it seems to be just the portable version.

@xC0000005
Copy link
Owner Author

xC0000005 commented Aug 24, 2019 via email

@Injineers
Copy link

anyupdate on this? I tried a few diff version of the SMT32 core, but all give the same board 3dprinter is unknown in IDE 1.90

@fritztoch
Copy link

I am stuck at Step 4. I have downloaded Marlin 2.x, and I have downloaded M200Fixes. Am I supposed to merge the two folders? The instructions don't say what to do with M200Fixes.

@theodonkulus
Copy link

Hi has this been fully tested on Marlin 2.0 or does this only work on the bugfix 2.0 branch? Ive got a M200 V2 and when I upgrade the firmware with the example config the system keeps resetting and I'm unable to control the motors from the LCD screen.

@xC0000005
Copy link
Owner Author

It fails on 2.0 due to a stepper issue I haven't had time to debug (but oddly, the M300 appears to work??).

@fritztoch
Copy link

Got a successful build with STM32 1.6.1 and Arduino 1.8.10 (and remembering to set the C Runtime Library to Printf). Web interface won't move any axis but can preheat. Front panel controls work for preheat, move E and Z. Home X & Y works too but is slow. This is a V2.

@theodonkulus
Copy link

So I should just build the M300 binary then for the V2? Would that be okay?

@xC0000005
Copy link
Owner Author

@theodonkulus, build for whichever board you have. If you're using the most recent (github) STM32 core, you'll note there's a board definition for the M300 now (thanks to @mojocorp). If you're building for the M300 (delta) you should use that (and probably his pins, since I'm sure some of mine were wrong). If you're building for the V2, select V2, V1, V1 and so on. The only oddity are the very early M200 V2s - the first thousand or so have STM32F103 MCUs, BUT have different steps per MM and the V2 display/fan/endstop connectors. For those, you select V1 and set your steps per mm right. The early V2s are also distinctly louder than most V1/V2s.

@theodonkulus
Copy link

How would I know which one I have in terms of the new or old V2s I didn't think there was a Gcode command that would let me view the chips P/N? I couldnt seem to get anything to work and had the LCD constantly resetting on me when I used the above steps for the V2 system

@xC0000005
Copy link
Owner Author

xC0000005 commented Feb 1, 2020 via email

@mojocorp
Copy link

mojocorp commented Feb 3, 2020

@theodonkulus, build for whichever board you have. If you're using the most recent (github) STM32 core, you'll note there's a board definition for the M300 now (thanks to @mojocorp). If you're building for the M300 (delta) you should use that (and probably his pins, since I'm sure some of mine were wrong). If you're building for the V2, select V2, V1, V1 and so on. The only oddity are the very early M200 V2s - the first thousand or so have STM32F103 MCUs, BUT have different steps per MM and the V2 display/fan/endstop connectors. For those, you select V1 and set your steps per mm right. The early V2s are also distinctly louder than most V1/V2s.

The M300 is not ready for prime time: while it's working fine with STM32duino 1.7.0, it's crashing with 1.8.0.....
Moreover, the stock M300 power supply is too weak to power the bed and nozzle at the same time. The stock firmware trick is to alternate the heaters to workaround this problem.
To resume: wait for a fix in Marlin or STM32duino for the crash, and in the mean time search for a 12V 10A power supply. (I use an xbox 360 power supply and replaced the cable)

@xC0000005
Copy link
Owner Author

xC0000005 commented Feb 3, 2020 via email

@theodonkulus
Copy link

Ill have to poke around tonight with those changes. It looks like I have a V2 as its white with the fan so its STM32F070. I was hoping it was mostly a config issue on my side but okay. Good thing I program for a living. :D. Guessing the code is stubbing out hardware timers to do PWM?

@xC0000005
Copy link
Owner Author

xC0000005 commented Feb 3, 2020 via email

@theodonkulus
Copy link

Makes sense. That would explain why steppers werent moving at all.

Ah EXTUI is the LCD panel?

I do plan on using octoprint with these. My goal is to add some touch sensors for the bed using 3 point method on a glass plate + filament a runout + linear advance. I saw what you did on hackaday and figured I could rig these all up once Marlin was running using the GPIO.

@xC0000005
Copy link
Owner Author

xC0000005 commented Feb 3, 2020 via email

@theodonkulus
Copy link

theodonkulus commented Feb 3, 2020

Well ive got five v2s i can test this on if that M200 branch has the fix. I can try the timer change too after. I did see my LCD behave eratically and switch screens with our button presses when I last ran the firmware along with no stepper movement. I was using these for a small scale printfarm once I modded hotend, and lead screws.

@mcheah
Copy link

mcheah commented Feb 3, 2020

FYI, how malyan does it and how i do it is to send sys:build on M109 and M190 with the logic being that every print will start with that.

@xC0000005
Copy link
Owner Author

xC0000005 commented Feb 3, 2020 via email

@theodonkulus
Copy link

I guess its worth adding that Gcode to Cura then for my mini v2s

@xC0000005
Copy link
Owner Author

xC0000005 commented Feb 3, 2020 via email

@theodonkulus
Copy link

theodonkulus commented Feb 7, 2020

@xC0000005 What sha-1's should I be grabbing from M200Fixes? Tried a straight rebase off the marlin v2.0.1 tag where I was originally trying these changes. Should I be building off earlier versions of marlin with your fixes? Getting a lot of conflicts between those two points.

@theodonkulus
Copy link

theodonkulus commented Apr 12, 2020

Hi @xC0000005 @mojocorp Just aheads up, I finally got this to work after playing around with some settings and then reading something on reddit about the STM32 cores library. The 1.8.0 has a watchdog timer bug in it and after reverting to 1.7.0 I was able to successfully compile then upload code via SD card upgrade. I also cherry picked your M200fixes2 branch ontop of the most recent Marlin off 2.0.5.3 and built just fine as well.

I'll be tinkering away to figure out if there's any more features I can cram into this little printer.

Thanks for your support and hope you're safe during this time.

If you want a stable point/see where I'm at the branch I pushed up the merged changes is here

https://github.com/theodonkulus/Marlin/tree/miniV2_M200Fixes2_cherrypick

@Gunner087
Copy link

Is it possible to flash the V2 F070 board using the ST-LINK V2? I've tried flashing using the sd card slot but I cannot get it to flash, I've tried multiple sd cards and multiple file formats.

@xC0000005
Copy link
Owner Author

xC0000005 commented May 22, 2020 via email

@Gunner087
Copy link

Gunner087 commented May 22, 2020

I'm up for it, which pads is it? From my own investigating it looks like the pad for SWCLK is beside capacitor C9 and the pad for SWDIO is the one closest to the STM32 next to R17.

@Gunner087
Copy link

Gunner087 commented May 22, 2020

So I got wires soldered for SWCLK, SWDIO, and GND. Then I tried using the "STM32CubeProgrammer (SWD)" upload method in the Arduino IDE to flash the STM32 with Marlin. This successfully uploaded Marlin but also overwrote the MonoPrice factory bootloader that I didn't realize is stored at the beginning of the STM32's flash memory. Thanks to the work done by Arko here I was able to fix that by flashing my board with his version of the MonoPrice Delta firmware, which includes his custom bootloader. I then flashed the Marlin binary to the STM32 manually with the starting address set to 0x08002000 using the actual STM32CubeProgrammer application. This worked and the printer now seems to run Marlin successfully. Thought I would post this so others will know to use 0x08002000 as the starting address to avoid overwriting the factory bootloader if they choose to go the ST-LINK V2 route.

@xC0000005
Copy link
Owner Author

xC0000005 commented May 22, 2020 via email

xC0000005 pushed a commit that referenced this issue Jul 1, 2020
Add driver definition for LERDGE init sequence.
@KillerXtreme-
Copy link

So I'm trying to compile Marlin for my MPSM(MalyanM200) early v2 that has the v1 Mainboard. When following these directions all I get is "Error compiling for board 3D printer boards." Along with a lot of stimer_t errors. This is directly downloading your branch and trying to compile in Arduino 1.8.13. Any ideas? I'm having a hard time getting marlin working for my printer.

@Gunner087
Copy link

Gunner087 commented Jun 6, 2021

Not sure if this could be your problem, but I had to use version 1.7.0 of the "STM32 Cores" package or it wouldn't compile for the V2 mainboard. I can't remember what the specific error was I got.

@Gunner087
Copy link

Nevermind, just compiled using stm core version 1.9.0 and it worked. @KillerXtreme- is the branch you downloaded the "M200Fixes" branch? If so, that branch does not compile for me either. I would suggest downloading Marlin here and configuring it yourself since the MPSM V2 is now supported in Marlin 2.0.x releases. That's what I did and I didn't have any issues. Just make sure you don't get carried away enabling too many features you don't absolutely need since the STM32 used in the MPSM V2 doesn't have much program storage space and it took me a while to fit the configuration I made for a friend, which included automatic mesh bed leveling with a z-axis probe. You should be able to refer to the branch you downloaded if you are unsure of anything when configuring, not sure how familiar you are with Marlin configuration. If you need any help, let me know. I might have some time available to make a configuration that would be almost complete.

@xC0000005
Copy link
Owner Author

xC0000005 commented Jun 7, 2021 via email

@SharkWipf
Copy link

SharkWipf commented Mar 6, 2023

Figured I'd contribute back what I've learned trying to get Marlin 2.1 on my brother's M100 M200, since most documentation is a little fragmented and outdated atm. I created a messy-but-hopefully-complete gist of everything I figured out with both this printer and getting Marlin 2.1 working on it.

The tl;dr is however, use upstream Marlin, the work from this repo has been merged into it. A few changes are necessary to get it to build, but nothing too complex.

I'm putting this message here because this was the first resource I found and the resource I kept coming back to most, so I imagine others would as well.

https://gist.github.com/SharkWipf/a9268e78bae29e262421200e64ad4d02

@xC0000005
Copy link
Owner Author

xC0000005 commented Mar 6, 2023 via email

@SharkWipf
Copy link

SharkWipf commented Mar 6, 2023

Whoops, my bad, I meant the M200. Been seeing so many different numbers and names that I've started mixing them up. Updating my gist now.
Will add a picture of the fan situation once my brother has put it back together.

@xC0000005
Copy link
Owner Author

xC0000005 commented Mar 6, 2023 via email

@SharkWipf
Copy link

(it’s possible it’s still too large)

It actually ran out of the full 122880 bytes on Arduino IDE with STM32 2.4, and even the default config on 1.9 (with float printf) uses up 113612 bytes/92%, so it actually just really too big on 2.4.
I don't know if there's anything in 2.4 that I'd miss over 1.9 anyway, so I'm not too worried about it, as long as 1.9 remains available, though the deprecation warnings all over the library names do look a bit silly.

I've attached 2 pictures of the printer to the gist as well now, as reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests