[victor_pv – Mon Jul 03, 2017 6:11 am] –
Hey Chriss, I’m the same one that posted in github about porting to STM32 and you shared your repo. I opened this thread here to keep track of my progress.
Ah, I thought so but wasn’t sure! I’m glad to see the progress you’ve been making, I think it’s good that people are working on this – I’m looking forward to printers running on an STM32 becoming more commonplace.
[victor_pv – Mon Jul 03, 2017 6:11 am] –
I don’t know if that’s all your code or borrowed, but if it’s yours it would be great if you give it a free license and can be used by everyone, and possibly make it compatible with as many MCUs as possible, and add compatibility with the F1 bootloader so a single set of tools work for uploading, but that’s a whole other subject.
The bootloader I put together is 90% from one of ST’s example projects on how to implement a DFU interface, with the other 10% of stuff just being basic housekeeping code I wrote. I’m not sure what ST’s license is like, but as far as I’m concerned anyone is free to do whatever they want with it. I’d love to see it become a more generic bootloader for STM32 chips that currently aren’t covered by the old Maple bootloader. The main thing it’s missing at the moment is the board needs to be manually reset for the DFU-upload to take place, I had some intent to add an automatic-reset into the USB-CDC stuff in the STM32Generic core, but haven’t played with that yet.
[victor_pv – Mon Jul 03, 2017 6:11 am] –
What board are you using in those pictures, is that a custom one?
Yeah, it’s a custom board. I’ve been developing an STM32 printer control board since late last year (in stops and starts), and I’m using the current prototypes to test my Marlin work. I plan to offer them for sale at some point, once we have STM32 stuff nicely integrated with mainline Marlin.
I keep going back-and-forth on what should and shouldn’t be included in the board design, so at the moment I’d say while it’s well tested it’s still an early prototype in that everything is still subject to change. Back when I first did the current batch of prototype boards I made the below pinout image, for my own reference and for some practice – this gives some details on the board I’m using:
Image
[victor_pv – Mon Jul 03, 2017 6:11 am] –
About the LCD, I was planning to not even test text screens, and go directly for nice color TFT since we have plenty of display drivers working with the F1, and take advantage of the cpu resources…
I agree, it would be good to see proper TFT displays in use now that we have the processing power. Generally, one of my goals is to have the best possible ‘backwards-compatibility’ with the existing hardware people are used to, so I really want to get common character and graphic displays that people already have working. One common complaint people have with 8-bit boards is that they can’t run a delta and a graphic (as in, monochrome LCD) display at the same time with good performance – I think it would be a good practical demo to show such a setup is now easily handled.
On the topic of TFT graphical interfaces, I’m in two minds as to the best way forward there. We do have the power onboard to handle that side of things with these 32-bit chips, but I kind of like the approach taken with the PanelDue where the display and interface is handled by a separate microcontroller, that then communicates with the control board via UART and standard G-Code.
An advantage there is that the UART + power connection can be any distance people might want on a printer, whereas an SPI or parallel interface to a TFT from the control board would have to be fairly short – so people would have to mount their display wherever the control board is.
Another advantage is that it means there’s no extra code in the printer firmware to handle the display, just G-Code parsing – so eventually you could have a display compatible with a range of control boards and firmwares.
Lastly, you can probably squeeze better performance out of a microcontroller dedicated to display/interface activities – I’d rather have an 80MHz MPU dedicated to the display than try juggling responsive display and real-time step generation on a 180MHz. Of course it’s definitely possible, I’m just speaking as to what I think would be easier – and with microcontrollers as cheap as they are, often it’s easier to share the work around.
That said, as you’ve pointed out with existing libraries and examples it would be relatively easy to get a graphical display up and running, and there are a lot of advantages to that approach too.
[victor_pv – Mon Jul 03, 2017 6:11 am] –
Are you using software SPI? I dont see the HAL SPI functions, neither the arduino standar ones.
Some of the code in the HAL_STM32 folder is unmodified from the Due HAL (where it was copied from), and I think that includes the SPI stuff. AFAIK those files include methods for a bit-banged SPI and the Due’s hardware SPI. That’s currently unused, the STM32Generic core is handling the SPI side of things on the F4 – so far I’m only using hardware SPI to talk to the stepper drivers, but that seems to be working well. I could probably delete those SPI files from the HAL folder, but I haven’t done so yet.
That’s part of why I like using the Arduino core approach, it removes the need to setup SPI, I2C, UART etc within the Marlin HAL. Though I’ve only tested with the one STM32Generic ‘board’ so far, that being for the F446VE, it’s very likely that the Marlin HAL would work with other ‘boards’ with minimal changes – so it may be possible eventually to get any STM32 supported by the STM32Generic core running Marlin.