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

The Marlin 2.0 32-bit thread #7076

Closed
thinkyhead opened this issue Jun 16, 2017 · 1,715 comments
Closed

The Marlin 2.0 32-bit thread #7076

thinkyhead opened this issue Jun 16, 2017 · 1,715 comments
Assignees
Labels
C: Build / Toolchain T: Development Makefiles, PlatformIO, Python scripts, etc.

Comments

@thinkyhead
Copy link
Member

thinkyhead commented Jun 16, 2017

Board MCU State To-Do
8-Bit AVR boards, RAMPS, etc. Arduino AVR 💚good
Due, RAMPS FD (v2.A!), etc. SAM3X8E 💚good
Duet Wifi + X5 SAM3X8E ❓unknown E3D Toolchanger on hand
Duet 2 Maestro SAM3X8E ⚠️beta
Archim 1.0 SAM3X8E ❓unknown Only US$170!
Archim 2.0 SAM3X8E 💚beta needs confirmation
Grand Central ATSAMD51 🛑tbd (RAMPS_FD shield should work)
Re-ARM LPC1768 💚beta
MKS-SBASE LPC1768 💚beta
Smoothieboard LPC1769 💚beta
Azteeg X5 GT LPC1769 💚beta
Cohesion3D Remix LPC1769 💚beta
Selena Compact LPC1768 💚beta
Malyan M200 STM32F103C8 💚beta EMERGENCY_PARSER,NEOPIXEL_LED, etc.
Borg STM32F765ZGT6 ⚠️beta EMERGENCY_PARSER,NEOPIXEL_LED, etc.
Chitu3D V3.9 STM32F103ZET6 🛑alpha EMERGENCY_PARSER,NEOPIXEL_LED, LCD, SDCard, MAX6675, etc.
Teensy 3.5 MK64FX ⚠️beta (need shields)
Teensy 3.6 MK66FX ⚠️beta (need shields)
Espressif 32 Wifi ESP32 ⚠️beta (mostly working?)
STEVAL-3DP001V1 STM32F401VE 🛑alpha (need boards)
  • Good: All features working.
  • Beta: All features implemented, mostly working.
  • Alpha: Some features unimplemented/broken.

This thread is for discussion of 32-bit issues needing work and coordination of the 2.0 release.

@thinkyhead thinkyhead added T: Development Makefiles, PlatformIO, Python scripts, etc. C: Build / Toolchain labels Jun 16, 2017
@Roxy-3D
Copy link
Member

Roxy-3D commented Jun 16, 2017

It's not easy to stop the flow of issues, and we want to keep fixing any bugs that exist in 1.1, of course. So I propose that we take care of the current crop of obvious bugs —and only bugs— do a 1.1.4 release very soon, and one more release —1.1.5— just before we release 1.2.x, the new hierarchical + HAL version of Marlin.

@Tannoo and I have some clean up work going for the LCD header files. As it turns out... The .h files can only be included by one .cpp file because the .h files generate code. While this is not a 'bug fix' it is an important item from a 'code cleanliness' perspective.

We have the Graphical LCD Display code clean up done. The 20x4 LCD Display clean up should progress quickly. https://github.com/Tannoo/Marlin/tree/ultralcd_impl_DOGM.cpp

@Tannoo
Copy link
Contributor

Tannoo commented Jun 16, 2017

@teemuatlut
Copy link
Member

Release 1.2 (or Marlin 2.0?) with the hierarchical layout, support for some 32-bit boards.

Go with v2.0.
Support for 32bit platforms will indicate a new era for Marlin and for sure will warrant a tick in the major version count.

@Roxy-3D
Copy link
Member

Roxy-3D commented Jun 16, 2017

We have the Graphical LCD Display code clean up done. The 20x4 LCD Display clean up should progress quickly. https://github.com/Tannoo/Marlin/tree/ultralcd_impl_DOGM.cpp

Both the Graphical LCD Panel and the 20x4 LCD Panel .h files are cleaned up in this branch...

Tannoo is going to get the indentation and white space cleaned up....

@thinkyhead
Copy link
Member Author

thinkyhead commented Jun 17, 2017

The .h files can only be included by one .cpp file because the .h files generate code.

That is correct. The LCD-oriented header files may only be included once, and only in ultralcd.cpp. They are essentially just .cpp files, but given .h extensions so that they don't compile outside of ultralcd.cpp.

We could make them into proper .cpp files and fix the unorthodox usage, without any negative affect on performance, but let's wait till @Tannoo's changes are ready.

@ImplementOfWar
Copy link

Is the new file structure going to allow Marlin to use a single file for Configuration? Much like Smoothieware? Is that one of the immediate benefits of doing this, apart from 32 bit and HAL
?

@thinkyhead
Copy link
Member Author

thinkyhead commented Jun 17, 2017

@ImplementOfWar That has not been discussed yet. Smoothieware is able to do certain things by limiting itself to 32-bit boards which have far greater resources. When and if someone implements a configuration system in emulation of Smoothieware, it will have to be for 32-bit boards only.

@Roxy-3D
Copy link
Member

Roxy-3D commented Jun 17, 2017

@thinkyhead What are you thinking for a time table to lock down the code?

I thought I could get the ultralcd_impl_HD44780.h separated into declarations and code generation... But it is turning out to be worse than I expected. We have the DOGM stuff separated, so that is a start. But the 20x4 LCD code is especially bad. It is very very ugly...

So, we could just go with what we have... Or... You can take a look at where we are at: https://github.com/Tannoo/Marlin/tree/ultralcd_impl_DOGM.cpp and see if you can figure out the issues?

@Tannoo
Copy link
Contributor

Tannoo commented Jun 17, 2017

@Tannoo
Copy link
Contributor

Tannoo commented Jun 17, 2017

I should delete the ultralcd_impl_DOGM.cpp branch. It was created as a test bed for the splitting of the DOGM.h file.

@petrzjunior
Copy link
Contributor

We should probably ping the whole @MarlinFirmware/language-team to complete translations.

@fixoid
Copy link
Contributor

fixoid commented Jun 18, 2017

Do I understand correctly that the new features will not be added before the release of version 2.0 (1.2)?
If so, when can we expect 2.0?
What about PRs that were created before the decision was made?

@Roxy-3D
Copy link
Member

Roxy-3D commented Jun 18, 2017

What about the PRs that were created before the decision was made?

In general... The Pull Requests generate for the current organization that do not make it into the new file layout should not be that difficult to regenerate. The bulk of the files are not going to change. What may change are things like paths to header files or stuff like that. If your Pull Request doesn't make it to the new layout automatically... It will be very straight forward to regenerate it.

@thinkyhead
Copy link
Member Author

thinkyhead commented Jun 19, 2017

thought I could get the ultralcd_impl_HD44780.h separated into declarations and code generation... But it is turning out to be worse than I expected.

The ultralcd_impl_* files were never designed to be standalone, but are really just split out parts of ultralcd.cpp. It would be best to wait till the ultralcd code is converted to a singleton class, and rearrange anything needing rearranging at that time. It will make more sense once it's examined in terms of a class — and ultralcd_impl_* may end up as two instances of a helper class. Or there may be other separation of functionality into more classes. It's something I want to work on more comprehensively, immediately after rearranging the code and getting the HAL working. And I'm pretty sure the LCD menu code can be simplified somewhat also.

@thinkyhead
Copy link
Member Author

thinkyhead commented Jun 19, 2017

Do I understand correctly that the new features will not be added before the release of version 2.0 (1.2)?

Halt means halt. If a larger number of contributors would like to help get the existing PRs merged, that would be an excellent change of pace. There's a lot of backlog to take care of.

If so, when can we expect 2.0?

As soon as I can get it together.

What about PRs that were created before the decision was made?

There's nothing to be done about it. There will never be some point in time where every PR will be merged, so it's best to stop the flow of new PRs and work on the PRs that we already have in front of us. I have been trying to get as many merged as possible, but more keep coming in. And so, we just have to go for it and it's just unfortunate timing for any PRs that will need to be reworked.

As it is, it will be me who has to re-work all the existing PRs into the new layout, because I have the mojo to make that happen as quickly as possible, and I will have all contingencies freshly in mind.

@thinkyhead
Copy link
Member Author

thinkyhead commented Jun 19, 2017

What are you thinking for a time table to lock down the code?

Let's keep fixing bugs all the live long day. Simply don't merge new stuff, and put off new features. If any new features come in while we're working on the transition, we'll simply put them off. Most contributions will be straightforward enough that it will be easy to re-make them for the new layout. Some we may have to work on within the old layout first, then when ready also bring them to the new layout.

We should continue to fix bugs in the 1.1.x branch and I will make sure they are brought into the new layout as well.

As for a timetable, I think we need to go in two stages. First, since we have so much work being done to make the 32-bit code ready, perhaps we should get that into minimal working shape first. Then I can include a genuine HAL as part of the initial 2.0.x branch.

The layout conversion itself isn't hard. The first conversion will take me less than a day to complete, and then we can go over it and see where it needs tweaking.

I'd like to focus on going over the open issues for the next day or two, patch up as many obvious bugs as possible, and merge as many of the lingering PRs as possible. One of PRs contains the 32-bit HAL rebased on the latest bugfix-1.1.x and that will also need to be brought up to date — though not merged with any Marlin 1.1.x.

Once the HAL is working and we're happy with it, then I'll rebase it onto the latest code and use that as the starting-point for Marlin 2.0 with the new file layout.

I think it's a good idea to take the next few days and close as many issues as we can so we have a fresh start.

Yes, it's possible that we could have a 2.0 layout and initial release by the end of the week… but let's loosen up the schedule so we can clear as many issues as possible and just aim to have it ready by July 1. How does that sound?

@Roxy-3D
Copy link
Member

Roxy-3D commented Jun 19, 2017

Yes, it's possible that we could have a 2.0 layout and initial release by the end of the week… but let's loosen up the schedule so we can clear as many issues as possible and just aim to have it ready by July 1. How does that sound?

July 1st sounds fine... Especially if there is a sample 32-Bit HAL limping along and able to move the nozzle around!!!

@p3p
Copy link
Member

p3p commented Jun 19, 2017

@Roxy-3D I'm pretty sure all the platforms currently in the HAL can do that, if the board supports the Arduino framework it's fairly trivial to implement basic features, the main stumbling block for non Arduino framework devices is the extra features needing Arduino libraries or Classes. I should be able to print tonight on my Re-ARM but the HAL needs further extended to strip all Arduino based features out of the main code and behind an API this will need to be done incrementally once we get the HAL merged.

@Roxy-3D
Copy link
Member

Roxy-3D commented Jun 19, 2017

I should be able to print tonight on my Re-ARM but the HAL needs further extended to strip all Arduino based features out of the main code and behind an API this will need to be done incrementally once we get the HAL merged.

What classes and functions are you missing? Would it be possible to just pull in the Arduino libraries so we don't have duplicated code complicating things?

@p3p
Copy link
Member

p3p commented Jun 19, 2017

Things like Print and Wire (as two random examples), just generally anything that is from the Arduino framework will need to be abstracted, this won't lead to code duplication and should lead to much cleaner and more understandable code, anything that can use the Arduino framework still can, although sometimes it may turn out it wasn't even necessary just convenient when it was implemented.

In some cases it may be difficult without introducing some indirection overhead, but anything performance critical already avoids the Arduino framework. It may be a good idea to have folders in the HAL (arduino_framework, mbed_framework) devoted to anything that can be reused among platforms that use that framework, but that's probably discussion for another day.

@Roxy-3D
Copy link
Member

Roxy-3D commented Jun 19, 2017

It may be a good idea to have folders in the HAL (arduino_framework, mbed_framework) devoted to anything that can be reused among platforms that use that framework, but that's probably discussion for another day.

@thinkyhead @p3p Well... Right now is a good time to express opinions and recommendations. It may not be too hard to get the HAL folders setup logically from the very start. But any subsequent, improved layout and organization for the HAL's will be welcomed also.

@p3p
Copy link
Member

p3p commented Jun 19, 2017

Would it be possible to just pull in the Arduino libraries so we don't have duplicated code complicating things

In the case of Wire all Arduino based platforms could still use it, but the calls would be through a standard API such as i2c_begin(channel, address), i2c_send_byte(channel, data), that other platforms would implement themselves or through another framework.

@tcm0116
Copy link
Contributor

tcm0116 commented Jun 20, 2017

What can I do to help with this effort? I've got a bit of free time in the evenings this week, so I'm happy to help out if I can.

@Roxy-3D
Copy link
Member

Roxy-3D commented Jun 20, 2017

I think it is a little too early to do anything. We need the new organization to happen and be in place. But as soon as that happens... Several important items are on the list:

  • Simple, step by step directions for getting the firmware onto a Re-ARM board. (Using Cygwin in a Windows environment would be preferable, but if we have to bring up a Linux machine, that would be tolerable.)
    -- Any extra configuration required.
    -- Steps to compile and build image outside of Arduino
    -- Steps to flash including notes on using the 2nd USB port
    -- Etc.
  • Simple, step by step directions for getting the firmware onto other 32-Bit boards.
  • It maybe good to have a thread showing how far the boot process is working for each 32-bit board type. And what sub-systems of Marlin still need attention for the board.
  • It will also be good to have the 32-Bit developers look at the new layout and suggest changes (and submit Pull Requests) to organize things better for themselves.

I believe there is a lot of pent up demand for an official 32-Bit version of Marlin. If we can just get one board up and working with the new release, and clear instructions so anybody can duplicate the success... We should see a lot of activity. And my guess is a number of different 32-Bit boards will start to have people using them.

@Tannoo
Copy link
Contributor

Tannoo commented Feb 24, 2019

All threads other than this one are mainly 8-bit.

@RainesX
Copy link

RainesX commented Mar 5, 2019

I cant for the life of me get my sbase to load marlin. Im using the example configfiles and change platformio.ini to LPC1768. Nothing more is changed. Compiling says success and the board flash the bin (changes to .cur).
When i restart the board wont load. D7 lights up and D1 keeps flashing, nothig more lights up. USB wont communicate so to reflash i have to take sdcard out.
Again, nothing other than the ini have been changed, the configfiles being used are the example ones for the mks sbase. Downloaded yesterday and reinstalled atom and platformio at the same time. Anyone have an idea on what im doing wrong?

@psavva
Copy link
Contributor

psavva commented Mar 5, 2019

The fact that the firmware is renamed to .cur means that it's successfully flashed...

It means you have some other issue in your config files...

Maybe wrong ports/buadrate etc ...

It helps if you have an LCD to see what's going on

@p3p
Copy link
Member

p3p commented Mar 5, 2019

More importantly the Status LED flashing indicates Marlin is running properly, waiting for commands.

This thread is for 32bit platform development discussion not user support, As issues are also generally for bug report submissions not user support I would suggest asking for assistance on Discord or one of the other channels.


After seeking help from the community, if the consensus points to to a bug in Marlin, then you should post a bug report.


@msticninja
Copy link

I cant for the life of me get my sbase to load marlin. Im using the example configfiles and change platformio.ini to LPC1768. Nothing more is changed. Compiling says success and the board flash the bin (changes to .cur).
When i restart the board wont load. D7 lights up and D1 keeps flashing, nothig more lights up. USB wont communicate so to reflash i have to take sdcard out.
Again, nothing other than the ini have been changed, the configfiles being used are the example ones for the mks sbase. Downloaded yesterday and reinstalled atom and platformio at the same time. Anyone have an idea on what im doing wrong?

What is #define SERIAL_PORT set to? My LPC1768 uses "-1", the USB emulated port. Also, make sure SERIAL_PORT_2 is commented out for now, I had a weird issue on Re-arm LPC1768 when I had both ports enabled. I couldn't communicate with either, and the MicroSD did not load as a USB drive, even though the LEDs on the board showed it was fully booted.

@reloxx13
Copy link
Contributor

reloxx13 commented Mar 6, 2019

can we add a bigger note in the first entry of this issue and in the readme like

marlin 2.0.x still supports 8 bit boards

?

i have read (on facebook) serveral times now that users think its 32bit only.

grafik

@Roxy-3D
Copy link
Member

Roxy-3D commented Mar 6, 2019

can we add a bigger note in the first entry of this issue and in the readme like

Yes. I edited the first line to be a little bit more clear. Backward compatibility was always a primary requirement. There will come a time when the 32-bit and 8-bit code bases fork. But we are going to resist that event as long as we can and not sacrifice 32-bit functionality.

@thinkyhead
Copy link
Member Author

thinkyhead commented Mar 6, 2019

Maybe we could organize a fund raising drive to purchase boards for devs?

I did receive an E3D Toolchanger (beta30) unit last month and have been painstakingly setting it up under RepRap Firmware. It's a meticulous process to align 4 different toolheads (all with slop), coordinate and design movements to grab and drop tools, get standby temperatures tuned well, build and test the priming, purging bucket, and cleaning brush setup, and on and on…

We do have tool-changing support in Marlin, but it is very spare compared to the available options in RepRapFirmware, due especially to its use of onboard g-code scripts and macros. As I work with this unit, I am taking it all in, and the things I'm learning will be used to extend the existing tool-changing support, including —for 32-bit boards, at least— adding a folder with scripts that can be edited and will be used for these actions. The G-codes that we lack (e.g., G60, G1 R, G10 XYZ, etc.) will be added as part of this process, using RRF-compatible g-code dialect as much as possible so we're not reinventing the wheel.

@Roxy-3D
Copy link
Member

Roxy-3D commented Mar 6, 2019

and in the readme like

I didn't address the readme file. But as soon as a Pull Request shows up... It will get merged ASAP.

@RainesX
Copy link

RainesX commented Mar 6, 2019

The fact that the firmware is renamed to .cur means that it's successfully flashed...

It means you have some other issue in your config files...

Maybe wrong ports/buadrate etc ...

It helps if you have an LCD to see what's going on

I only have the mks tft but that shows nothing other than the normal when it gets power. Baudrates that i have tried is 115200 and 250000

More importantly the Status LED flashing indicates Marlin is running properly, waiting for commands.
So it doesnt show the same status as smoothie and klipper?

What is #define SERIAL_PORT set to? My LPC1768 uses "-1", the USB emulated port. Also, make sure SERIAL_PORT_2 is commented out for now, I had a weird issue on Re-arm LPC1768 when I had both ports enabled. I couldn't communicate with either, and the MicroSD did not load as a USB drive, even though the LEDs on the board showed it was fully booted.

Serial_port set to -1 and serial_port_2 is commented out.
I have tried different configs for two weeks now. I have managed to flash klipper so i might give that another go for now.

@tcm0116
Copy link
Contributor

tcm0116 commented Mar 7, 2019

Serial_port set to -1 and serial_port_2 is commented out.

Uncomment serial_port_2 and set it to 0. I'm assuming your MKS TFT has a serial connection to the board. With your current configuration of serial_port_1 set to -1, Marlin will only communicate over the USB port.

@Nach0z
Copy link

Nach0z commented Mar 13, 2019

hey so I've got myself one o' these fancy new Grand Central boards sitting here. Don't have a shield for it, can't find the RAMPS_FD v2 for sale anywhere. Does the RADDS fit the Mega form factor? Also, how can I help with dev/testing here? not sure where y'all are focusing dev efforts on new 32-bit boards.

@bruce356
Copy link

Arduino due ramps_fd v2.1 expansion board ramps1.4 upgrade

https://item.taobao.com/item.htm?spm=a1z09.2.0.0.3eab2e8dJxxBxR&id=544866465374&_u=p3qea196e529

@Nach0z
Copy link

Nach0z commented Mar 14, 2019

Not "why", mate, "where". I just want to know how best to help.

@AxelVoitier
Copy link

Hello,

I wanted to explore the territory or manufacturer dev boards as a base for a sort of RAMPS stack.
At the beginning what sparked my interest is the availability of some of those boards with large (touch) screen, beafy core, multiple ports and for quite decent prices.

Another advantage is that these sort of boards are neither from cloners (with their safety and compatibility issues).
Nor from small companies at expensive prices and with limited availability.
At least, manufacturer dev boards can be sourced from reputable worldwide distributors at the right price tag. And their lineup are also kept up to date.

So I pieced together a list of available boards and their characteristics:
https://docs.google.com/spreadsheets/d/1YUJlDjYPEG64dbiBOcp1GqlAnOjEMhiyxi84PCw-QHI/edit?usp=sharing

I share that list with you if it can help someone. For my part, I am actually a bit deceived by it :(.

In brief, pretty much all boards with nice screens and ports/peripherials (microSD, ethernet, wifi in some case, CAN) have very few IOs (~30).
Considering a basic RAMPS takes ~70 IOs, that's a far fetch even for port expanders.

I highlighted some I find more suitable than others though. But they don't tick all my boxes.
The ones with enought IOs are not really "future-proof".

However, the list shows an interesting take away. There is a wide prevalence of the Uno R3 port.
It is unfortuntely very limited (22 IOs). But I see a potential for working out a sort of standard RAMPS adapter based on port expander(s) for it.
I wonder what would be the limits of such setup. But at least a very large base of cheap yet well supported MCUs and boards would be at our grasp.

I also note some new boards with ARM Cortext A7+M4, which is an interesting direction.
If that take-off, we would no longer have to rely on either industrial modules or on strange and almost confidential chinese boards for this sort of architecture.

PS.: Sorry for the large bias toward ST (and a bit NXP) in the list :D. It's just I found both have the nicest policy and availability of affordable dev-boards.
And while the ST part is quite complete, I got tired doing the same for all NXP ones.

Cheers,
Axel

@ManuelMcLure
Copy link
Contributor

ManuelMcLure commented Apr 9, 2019

What is the philosophy for defining pins in for optional stuff? I'm looking at pins_RAMPS_RE_ARM.h and seeing that it defines [X|Y|Z|E0|E1]_CS_PIN unconditionally, even if we are not using steppers (TMC2130 only?) that require a CS pin. This unnecessarily marks these pins as protected and unusable for GPIO purposes.

Does it make sense to change the PINS fine to only define the [X|Y|Z|E0|E1]_CS_PIN if there's a TMC2130 stepper on that axis, or are we expecting the end-user to manually set those to -1 if they want to use the pins for GPIO?

If not, I'll try to make up a PR to fix this up for at least the pins_RAMPS_RE_ARM.h file (I'm not familiar enough with other boards to know what makes sense for them, unfortunately).

@ManuelMcLure
Copy link
Contributor

Hmmm... to simplify this it might make sense to move the AXIS_HAS_SPI macro from Conditionals_post.h to drivers.h so it's accessible in the pins file.

@xC0000005
Copy link
Contributor

I have Marlin 2.x working again on the Malyan M200 v1 and v2 (STM32F103 and STM32F070) building using the Arduino IDE, but there's a few loose ends. Malyan implemented some GCODE commands that were specific to their LCD. Operations like setting the Wifi SSID/Password via a command sequence to the ESP8266 using M550 and M551. What's the normal policy on what would effectively be one-off gcode commands? Non Malyan LCDs don't need these command sequences sent, so there wouldn't be a great deal of value to other printers to adding this.

@Hedda
Copy link

Hedda commented Jun 18, 2019

FYI; both the FYSETC Cheetah board and BIQU BIGTREETECH SKR MINI-E3 boards are now on Aliexpress

https://www.reddit.com/r/3Dprinting/comments/c1lttc/fysetc_cheetah_board_chinaclone_of_th3d_ezboard/

Both these boards feature integrated TMC2209 drivers and STM32F103 32-bit based MCU

https://www.reddit.com/r/BIGTREETECH/comments/c0hdht/bigtreetech_skr_mini_e3_done/

Looking forward to community support for those and TH3D EZBoard Lite (unknown 32-bit ARM chip)

https://www.reddit.com/r/3Dprinting/comments/bvsd1q/ezboard_lite_formerly_tough_controller_for/

@MarlinFirmware MarlinFirmware deleted a comment from DilHem Jun 21, 2019
@MarlinFirmware MarlinFirmware deleted a comment from msticninja Jun 21, 2019
@thinkyhead
Copy link
Member Author

Superseded by #14345

@thinkyhead thinkyhead unpinned this issue Jun 21, 2019
@github-actions
Copy link

github-actions bot commented Jul 5, 2020

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.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C: Build / Toolchain T: Development Makefiles, PlatformIO, Python scripts, etc.
Projects
None yet
Development

No branches or pull requests