-
-
Notifications
You must be signed in to change notification settings - Fork 19.2k
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
Building Maylan M200 with Marlin 2.0 and PlatformIO #11104
Comments
Ok, so to build Marlin for the M200 you need a few more pieces: From this repo: You get the board .json files (which go in .platformio\platforms\ststm32\boards, and the variant definitions, which go in .platformio\packages\framework-arduinostm32\stm32f1\variants (if you don't see variants under STM32f1, it's probably directly under the arduinostm32 directory). Alternately, you can build with STM32GENERIC by doing the following: Build as a appropriate. If you build from the generic tree above, it should have board definitions and variants included as it drags down the right builder and so on. I haven't done PRs to merge these because: That said, you should be able to build by doing so. If your end goal is to enable auto-bed leveling of some sort, there are some hacks you'll need to use to reduce the rom size - you only get 120k to play with after the bootloader and eeporm emulation eats 8k, so whatever you do needs to fit in 112k. It's doable by using dstring & removing the name demangler, or at least it was. |
Thanks, I will try it tomorrow. After its built, how does it get on the M200? Does the M200 have a bootloader? |
For a V1, you copy firmware.bin to update.bin and put it in the root of an SD card along with a file named “fcupdate.flg” (I often copy firmware.bin to BOTH filenames). Put the SD card in the mini, turn it off and back on. If it shows a version of V99.<something> it’s alive. Note the first flash can take longer than the UI knows to wait, so be patient.
The bootloader is ridiculously picky about what SD card it will flash from - the one that came with it is a good choice, formatted for FAT.
… On Jun 24, 2018, at 9:06 PM, X7JAY7X ***@***.***> wrote:
Thanks, I will try it tomorrow. After its built, how does it get on the M200? Does the M200 have a bootloader?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#11104 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AeppccqaJLIs38DaLTfKyjvPTktP2oIpks5uAGHAgaJpZM4U1K3k>.
|
Hello, It now sees the board but I am getting some build errors:
|
What’s your platformio.ini section for the m200 look like?
… On Jun 25, 2018, at 12:51 PM, X7JAY7X ***@***.***> wrote:
Hello,
It now sees the board but I am getting some build errors:
Compiling .pioenvs\malyanm200\src\src\HAL\HAL_LPC1768\arduino.cpp.o
In file included from Marlin\src\HAL\HAL_LPC1768../../inc/MarlinConfig.h:28:0,
from Marlin\src\HAL\HAL_LPC1768\LPC1768_Servo.cpp:63:
Marlin\src\HAL\HAL_LPC1768../../inc/../HAL/HAL_STM32F1/HAL.h:44:10: fatal error: Arduino.h: No such file or directory
Compiling .pioenvs\malyanm200\src\src\HAL\HAL_LPC1768\include\Wire.cpp.o
In file included from Marlin\src\HAL\HAL_LPC1768../../inc/MarlinConfig.h:28:0,
from Marlin\src\HAL\HAL_LPC1768\SoftwareSPI.cpp:32:
Marlin\src\HAL\HAL_LPC1768../../inc/../HAL/HAL_STM32F1/HAL.h:44:10: fatal error: Arduino.h: No such file or directory
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#11104 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AeppcYfHJbLY9fw_DNPvBVyAqV1ucC1eks5uAT9OgaJpZM4U1K3k>.
|
[env:malyanm200] |
It’s highly likely that PlatformIO has broken variants building once again. I’ll look at the PIO builder tonight, but my guess is that if they’ve done what they usually do, there’s some code that assumes that the variant will have the CPU in the name, and the LD script can be derived from that, and so on (instead of reading from the board’s json file like it used to). I've attached a zip with a couple of files that overwrite their counterparts under .platformio\platforms\ststm32\builder\frameworks\arduino\ (and one that goes in the subfolder maple, overwriting the F1 builder). It's also a hack but I needed the builder running again. Overwrite your builder files with the right versions from this zip and see if it doesn't come closer. |
Alot of warnings but now there is only one error:
|
There’s a PR open to fix this, I believe -
https://github.com/MarlinFirmware/Marlin/pull/11090/files <https://github.com/MarlinFirmware/Marlin/pull/11090/files>
You can apply those changes and I think it will work (I am using STM32GENERIC, so it’s different).
… On Jun 25, 2018, at 6:49 PM, X7JAY7X ***@***.***> wrote:
Alot of warning but not there is only one error:
Compiling .pioenvs\malyanm200\src\src\HAL\HAL_STM32F4\HAL.cpp.o
Marlin\src\HAL\HAL_STM32F1\persistent_store_flash.cpp: In function 'void HAL::PersistentStore::read_data(int&, uint8_t*, uint16_t, uint16_t*, bool)':
Marlin\src\HAL\HAL_STM32F1\persistent_store_flash.cpp:96:6: error: ambiguating new declaration of 'void HAL::PersistentStore::read_data(int&, uint8_t*, uint16_t, uint16_t*, bool)'
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#11104 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/Aeppcc6Qr9q_MAeYqmuIy4mFNXlVyXt7ks5uAZMqgaJpZM4U1K3k>.
|
That took care of that but now another popped up: Marlin\src\module../inc/../HAL/HAL_STM32F1/HAL.h:126:24: error: '__disable_irq' was not declared in this scope |
Those are ones I’m not familiar with, I’ll look at them soon.
… On Jun 25, 2018, at 7:22 PM, X7JAY7X ***@***.***> wrote:
That took care of that but now 3 others popped up:
Marlin\src\module../inc/../HAL/HAL_STM32F1/HAL.h:126:24: error: '__disable_irq' was not declared in this scope
Marlin\src\module../inc/../HAL/HAL_STM32F1/HAL.h:125:24: error: '__enable_irq' was not declared in this scope
Marlin\src\module../inc/../HAL/HAL_STM32F1/HAL.h:125:24: error: '__enable_irq' was not declared in this scope
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#11104 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/Aeppccyk3PtjUXtNIImLKustK_jppsP2ks5uAZrpgaJpZM4U1K3k>.
|
Ok, thanks a ton! |
I suspect whatever this is is related to https://github.com/MarlinFirmware/Marlin/pull/10999/files <https://github.com/MarlinFirmware/Marlin/pull/10999/files> - you could try reverting that and seeing if it changes anything.
… On Jun 25, 2018, at 7:24 PM, X7JAY7X ***@***.***> wrote:
Ok, thanks a ton!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#11104 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AeppcQJhC9d3TQC9D0uF8rbVHfSl-y2Bks5uAZt0gaJpZM4U1K3k>.
|
I didn't realize that I had an old copy of Marlin. I pulled the latest, made the changes to persistent_store_flash.cpp, and it now builds successfully. I will try to load it onto my M200 tonight. Thanks. |
#11120 submitted to add @xC0000005's board defines to the project. Agreed that #10999 appears to have broken the Maylan M200 build:
|
This is more likely to be PIO screwing up variant builds again. There's a rework in progress of the builders and they make some bad assumptions about how to find variant directories, names, include builders, set linker scripts, vector tables, and a few other things. |
Ah, I believe I've figured it out. In the board.json file, it's now required to have a .variant property under the build section which matches the CPU variant: |
Thanks again for all your help. Much appreciated. I loaded the firmware. Everything works but the fan control. Do have to change something somewhere? |
The M200 config has the fan set to auto - does it not turn on when the temp is > 50 degrees celsius?
… On Jun 26, 2018, at 7:53 PM, X7JAY7X ***@***.***> wrote:
Thanks again for all your help. Much appreciated. I loaded the firmware. Everything works but the fan control. Do have to change something somewhere?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#11104 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AeppcX0OIAp7CLkTvAgB0en5gOPvw6SKks5uAvORgaJpZM4U1K3k>.
|
It does not. It was working with the original firmware right before I loaded Marlin. I will check the hardware tomorrow and see if its trying to turn the fan on. Maybe something happened to my board or fan but doubtful. Also, can I disable the auto and have GCode control? I have a hardwired hotend cooling fan to 12v and I also have a layer fan on the mainboard fan plug. I want the layer fan to be controllable through Gcode. |
Absolutely - in advanced configuration.h look for PB8, which is currently assigned to E0_AUTO_FAN somthing. Comment that out and set FAN_PIN in pins.h to PB8 (it’s commented out). The sample configs are from my printer where fan 1 (the default one) is the auto fan) and fan 2 (the unpopulated header on V1) is the layer fan. I’m not sure what would be stopping it, to be honest, but you can check and see if manual control works. Also, if the LCD shows the right temps, the ADC is reading the data correctly, so it must be something about the config.
… On Jun 26, 2018, at 8:33 PM, X7JAY7X ***@***.***> wrote:
GCode
|
So here was the problem. #define E0_AUTO_FAN_PIN -1. I didn't start with your config apparently. |
#ifndef FAN_PIN
#define FAN_PIN PB8 // FAN1 header on board - PRINT FAN
#endif
#define FAN1_PIN PB3 // FAN2 header on board - CONTROLLER FAN
#define FAN2_PIN -1 // FAN3 header on board - EXTRUDER0 FAN |
Enable soft pwm in the configuration.
… On Jun 26, 2018, at 8:50 PM, X7JAY7X ***@***.***> wrote:
So here was the problem. #define E0_AUTO_FAN_PIN -1. I didn't start with your config apparently.
I changed the Maylan pin.h. It turns on and off with GCode now but PWM isnt working. Its either 0 or 100% no matter what speed I try to set it to (ex M106 P0 S125 - 50%).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#11104 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AeppcXhZblPM7pC8BpD5SmiOLcenijRcks5uAwEDgaJpZM4U1K3k>.
|
#define FAN_SOFT_PWM in configuration.h should give you fan speed control
… On Jun 26, 2018, at 8:51 PM, X7JAY7X ***@***.***> wrote:
#ifndef FAN_PIN
#define FAN_PIN PB8 // FAN1 header on board - PRINT FAN
#endif
#define FAN1_PIN PB3 // FAN2 header on board - CONTROLLER FAN
#define FAN2_PIN -1 // FAN3 header on board - EXTRUDER0 FAN
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#11104 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AeppcSJMEAXgAxCXg1JNGmG1lGIsQg40ks5uAwEugaJpZM4U1K3k>.
|
Trying this now. Is your config in the examples folder? If not, can you send it to me? I want to compare settings. Thanks |
Its the one in the examples folder.
… On Jun 26, 2018, at 8:58 PM, X7JAY7X ***@***.***> wrote:
Trying this now. Is your config in the examples folder? If not, can you send it to me? I want to compare settings. Thanks
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#11104 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AeppcQZZFBqIjXiCQshsXrh5KjWX5YKqks5uAwLhgaJpZM4U1K3k>.
|
Thanks, that worked for PWM. I never had to change any of that before. Wondering what config files I started with. |
The M200 doesn’t have hardware PWM, and even if it did the fan isn’t hooked to the right pins for it. Make sure steps per mm is right for your variant of the M200 and the endstops are inverted correctly for your setup.
… On Jun 26, 2018, at 9:01 PM, X7JAY7X ***@***.***> wrote:
Thanks, that worked for PWM. I never had to change any of that before. Wondering what config files I started with.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#11104 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AeppccZZw0m-ATfP7c4WwqvankE--Fq5ks5uAwOEgaJpZM4U1K3k>.
|
@thinkyhead I did modify ststm32 4.4.0 in .platformio as described here. It compiles and links successfully but I'm not convinced it produces working binaries. |
@jannau , if you want to mail your firmware.bin file to me (git hub handle AT gmail dot com) I'll load it on to my printer and test. I have most revisions of the malyan mainboards (except the M100 one). |
@xC0000005 thanks, email sent. sha256sum: 2168e3a87516b65da3b101fe9e9e0bbf73f4325d16dbd6dca1e6d8785048a425 jannau_2018-08-22_malyanm200_firmware.bin |
I'm looking for a solution that doesn't involve modifying the platform files. |
Per platformio/platform-ststm32#127 <platformio/platform-ststm32#127>, It’s expected to do some fixup in the platform builder. Once ST’s official core is supported by PIO, I will create official variants for all three boards in that framework, and we won’t need these fixups (mostly - there’s some oddities in ST’s startup code).
… On Aug 22, 2018, at 3:01 PM, Scott Lahteine ***@***.***> wrote:
I'm looking for a solution that doesn't involve modifying the platform files.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#11104 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AeppcSGTesjNzbi0UGlX_3zWdA7hRFKZks5uTdTSgaJpZM4U1K3k>.
|
Your firmware is working, for some degree of working. It initializes USB, I was able to connect and issue commands, but steps per mm were wrong, axis direction and endstops were wrong, and the malyan LCD wasn’t enabled. So your build does “work” but it looks like the configuration options are wrong.
My best guess is that the configuration.h and configuration_adv.h from the M200 directory weren’t copied to the right place (???).
… On Aug 22, 2018, at 11:46 AM, Janne Grunau ***@***.***> wrote:
@xC0000005 <https://github.com/xC0000005> thanks, email sent. sha256sum: 2168e3a87516b65da3b101fe9e9e0bbf73f4325d16dbd6dca1e6d8785048a425 jannau_2018-08-22_malyanm200_firmware.bin
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#11104 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AeppcaaRDq8CwNHfVch8ipfA4C08due8ks5uTab1gaJpZM4U1K3k>.
|
Thanks for the test. No idea what happened with configuration.h and configuration_adv.h. They should be correct ones. The Marlin configuration should be unrelated the problems I see. So there seems to be a difference between the M100 and M200 which currently prevents the same firmware image from running. |
Just wanted to share one more info about what I had to do in order to build this Marlin 2.0 version, and how to fix this error:
So in When I used this version, I managed to build it for My guess is that maybe most of you who managed to compile this version without additional modifications had this STSTM32 installed earlier, and you didn't update it maybe for some time. |
hmm...... im at a loss, theres alot of threads pointed all around on how to fix this, but I cant seem to get it working I am getting this I tried updating it to the other location 'util/latomic.h but got an error that it did not exist I then DL'd xC0000005 builder.zip & replaced the files & still got fata error on 'util/latomic.h I then swtich the Hal.h back to libmaple/atomic.h but am still getting that it doesnt exists |
Did you made a typo here maybe: |
nah still same issue after removing the l before atomic #Click to see Pio Error
|
If you are on windows, try also to remove this: EDIT |
Still the same. I think I am going to purge everything & start over |
This thread is amazing. An hour ago I had never heard of PlatformIO and I now have an M200 build from the 2.x branch. It's getting late but I am definitely going to try it out tomorrow! |
Apparently my ability to get it to build does not extend to getting it to work on the printer. Something gets flashed (no version is displayed) and then the motion controller is dead afterward. I was able to recover with the v29 Malyan firmware, and tried flashing it again, and got the same result. I used the STM32f1 variant. Any suggestions would be greatly appreciated! |
Did you copy over the config files with the M200 ones?
…Sent from my iPhone
On Sep 29, 2018, at 5:05 PM, Jeff Noxon ***@***.***> wrote:
Apparently my ability to get it to build does not extend to getting it to work on the printer. Apparently something gets flashed (no version is displayed) and then the motion controller is dead afterward. I was able to recover with the v29 Malyan firmware, and tried flashing it again, and got the same result. I used the STM32f1 variant. Any suggestions would be greatly appreciated!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@xC0000005 I have to admit I forgot to do that 🤦♂️, so I tried a clean build with the right configs and looked at the binary through strings and it seems okay, but the machine is not acting any differently. |
Does it appear in usb? It will be called “Maple.”
…Sent from my iPhone
On Sep 29, 2018, at 11:03 PM, Jeff Noxon ***@***.***> wrote:
@xC0000005 I have to admit I forgot to do that 🤦♂️, so I tried a clean build with the right configs and looked at the binary through strings and it seems okay, but the machine is not acting any differently.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
It doesn't appear in USB. With the stock firmware I see this:
It might also be worth mentioning that something is making buzzing noises (steppers?) that completely goes away once the stock firmware boots. |
I’m about as far as someone could be from their 3d printers (literally on a beach in the Bahamas), but do this:
Run pio -v -e malyanm200, and mail the entire output plus the fimrware.bin file to my githubhandle (at) gmail dot com. I’ve got a hex editor handy and can load up the firmware in binary ninja to see if it looks even remotely right.
… On Sep 30, 2018, at 2:53 PM, Jeff Noxon ***@***.***> wrote:
It doesn't appear in USB. With the stock firmware I see this:
Bus 020 Device 020: ID 2974:0503 2974 Malyan 3D Printer Port Serial: 6D8721A9xxxx
It might also be worth mentioning that something is making buzzing noises (steppers?) that completely goes away once the stock firmware boots.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#11104 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AeppcXpYAfoIkVwPRCzdc7DjdHImst2Tks5ugRNBgaJpZM4U1K3k>.
|
I could get it to compile right away selecting the STM32F1 environment, but since the MCU is different (STM32F103RE) the board will do nothing even if it can be flashed with it. If I change the MCU to STM32F103C8, then I get the same errors @fiveangle had and can't get it to compile. |
This is still broken I purged everything, used latest stm from platformio (since not it seems to include the malyanm200) atomic.h error again. I then removed the latest stm & installed 4.5 same issue. I then went back to this thread & grabbed the builder files, variants, etc...still errors. anyone have any idea? or is it possible we can get a updated file structure for those who may be installing atom & platformio new & using the latest |
Try building with stm32duino 1.5 in arduino IDE, if you know how to. I have not tried it myself yet. Tried with early versions and got it to compile, but had some issues with x&y movement, z worked fine but moved wrong direction. Will test again when I get the time.... If any success I'll update... Here is a guide to start with:
|
I’ve only been building in the arduino IDE, though most of my work lately has been on the lerdge boards, I did test both V1 and V2 after the boards were merged into main.
|
@xC0000005 — I want to add a README.md for the M200 giving instructions on the build. Is Arduino IDE still the best option? If so, then I can just itemize the steps for Arduino. But if you have steps that work with the current PlatformIO platforms, I can add those instructions too. And, if the steps are not too complicated, then we may be able to add them to the Python build script to automate the process. |
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. |
When i try to use the maylan board in config.h, it throws an error "cannot find board id "maylanm200"
The text was updated successfully, but these errors were encountered: