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

[2.0.x] Add support for 'Black' STM32F407VET6 board with RAMP-like shield #13524

Merged
merged 3 commits into from
Apr 5, 2019

Conversation

jmz52
Copy link
Contributor

@jmz52 jmz52 commented Mar 29, 2019

Description

Add support for custom STM32 boards' 'variants'
Add support for 'Black' STM32F407VET6 board with RAMP-like shield

Fix compilation HAL_STM32 compilation problem caused by empty #define HAS_TIMER(IO)

Depends on MarlinFirmware/U8glib-HAL#6 for 128x64 displays support

Benefits

HAL_STM32 can be compiled again
Marlin can be compiled for custom STM32 boards' 'variants'
STM32F4 boards with HAL_STM32 can use EEPROM_EMULATED_WITH_SRAM feature

Additional information

Custom build script is used to update PlatformIO environment with 'variant' code from Marlin repository

Tested on STM32F407VET6 and HAL_STM32
https://3dtoday.ru/upload/resize_cache/main/e4e/940_1080_1/e4e655d7ffd8efe6b120aea703a06093.jpg

@thinkyhead thinkyhead force-pushed the Black-STM32F407VET6 branch from 3cbba11 to 8222ea7 Compare April 5, 2019 19:33
@thinkyhead thinkyhead merged commit 3c47e1b into MarlinFirmware:bugfix-2.0.x Apr 5, 2019
@youprint
Copy link

youprint commented Apr 11, 2019

Good job again JMZ52
I launched a small batch of this design to test it (5 boards)
Too bad that you didn't keep the FSMC 16 bits lcd, but the 407VE have not enough pins to keep it. Maybe it could be done with a 144 package like the F407ZGT6.
I'm trying to compile but I have issues with U8GLIB.

.piolibdeps/U8glib-HAL_ID1932/src/clib/u8g_com_io.cpp:293:12: fatal error: libmaple/gpio.h: No such file or directory
#include "libmaple/gpio.h"
^~~~~~~~~~~~~~~~~
compilation terminated.
*** [.pioenvs/black_stm32f407ve/lib70c/U8glib-HAL_ID1932/clib/u8g_com_io.cpp.o] Error 1
Compiling .pioenvs/black_stm32f407ve/lib70c/U8glib-HAL_ID1932/clib/u8g_com_stm32duino_hw_spi.cpp.o
.piolibdeps/U8glib-HAL_ID1932/src/clib/u8g_com_stm32duino_hw_spi.cpp: In function 'uint8_t u8g_com_stm32duino_hw_spi_fn(u8g_t*, uint8_t, uint8_t, void*)':
.piolibdeps/U8glib-HAL_ID1932/src/clib/u8g_com_stm32duino_hw_spi.cpp:58:11: error: 'class SPIClass' has no member named 'send'; did you mean 'end'?
SPI.send(arg_val);
^~~~
end
.piolibdeps/U8glib-HAL_ID1932/src/clib/u8g_com_stm32duino_hw_spi.cpp:64:11: error: 'class SPIClass' has no member named 'send'; did you mean 'end'?
SPI.send((uint8_t *)arg_ptr, arg_val);
^~~~
end
*** [.pioenvs/black_stm32f407ve/lib70c/U8glib-HAL_ID1932/clib/u8g_com_stm32duino_hw_spi.cpp.o] Error 1

@jmz52
Copy link
Contributor Author

jmz52 commented Apr 11, 2019

@youprint
You can use u8glib from https://github.com/jmz52/U8glib-HAL/tree/stm32-maple-and-core-fix
PR for this fix is not merged yet (MarlinFirmware/U8glib-HAL#6)

Also keep in mind the fix from #13550 if you are going to use MKS Mini 12864

@youprint
Copy link

success with your U8Glib library Thanks
I'm going to try to compile this code on a VGT6 or a ZVG6 and try to use a FSMC LCD like your touch POC repo.

@Bob-the-Kuhn
Copy link
Contributor

Nice.

How does one get a RAMP-like shield?

Any plans for additional stepper drivers or a stepper driver expansion board?

Will you be adding the RAMP-like shield to the black RepRap WIKI?

@jmz52
Copy link
Contributor Author

jmz52 commented Apr 11, 2019

@Bob-the-Kuhn
This is purely a DIY hardware.
Sources (CC-BY) and gerber files are available at https://github.com/jmz52/Hardware so anyone can order a PCB for 2$ plus shipping cost. Manual solderings is not too hard as there are only few SMD components used, but hot air gun is recommended for LM2596 and MOSFETs.

407VE base boards does not have many pins left, so no plans for additional drivers on it. There will be some improvement to get GPIO pins connected to LEDs and buttons availabe for reuse, but not much beyond than.

407ZE board have enough pins for 6 stepper drivers and FSMC interface, but it will be more expensive as there is not way to fit all elements on 100x100mm PCB. Also I need to check several concepts before designing a shield be 407ZE.

@youprint
Copy link

8$ for 5 boards that's really cheap.
I made a small test yesterday and it's look promising
https://nsa40.casimages.com/img/2019/04/12/190412105042638683.jpg
And this morning i had a surprise in my mail box :
https://nsa40.casimages.com/img/2019/04/12/19041210505498797.jpg

I think the clue to use less pins is to use spi motors drivers like L6470 or Powerstep01 from ST
with up to 4 drivers for a single spi port in daisy chain configuration. I was looking at the nucleo STM32F767 LQFP144 with up to 6 SPI port and 216Mhz for less than 25$. The HAL already exist for the STM32F765, Hasenbanck made a nice board based on this Hal :
https://github.com/hasenbanck/remram

But unfortunatly nobody designed a board based on spi drivers, maybe i should start the project.

So the progress since last year is huge, we have a working HAL on F1, F4 and F7 ! Now we only need a H7 HAL to have all the STM32 family...

@Bob-the-Kuhn
Copy link
Contributor

The TMC SPI drivers can also be daisy chained. Unfortunately the drivers have not been written yet.

I'm not a fan of the L6470/powerSTEP01 family. I just got my hands on a TMC5160. Definitely a better solution.

@jmz52
Copy link
Contributor Author

jmz52 commented Apr 12, 2019

@youprint
Few comments on this shield:

  • For persistent storage you can either use I2C eeprom on this shield or battery-backup SRAM (4KB) in MCU.
  • SDIO connector on shield should be compatible with MKS Robin's external SDIO card reader. If you have one it worth testing once SDIO support is implemented for HAL_STM32.
  • Diode and few resistors need to be installed on the bottom size of the PCB.

@youprint
Copy link

youprint commented Apr 12, 2019

@ Bob-the-Kuhn

The TMC SPI drivers can also be daisy chained. Unfortunately the drivers have not been written yet.

I'm not a fan of the L6470/powerSTEP01 family. I just got my hands on a TMC5160. Definitely a better solution.

I think that's because nobody already wrote a correct library for L6470, Powerstep01 is very promising for Marlin CNC mode with big motors (Nema 23 or 34 up to 10A@50v)
I can send you a shield board if you are in Europe.

@jmz52
I don't have the regulator and capacitors, i have to wait :-(
I tested many cheap dev board for STM32F4, the best one are from EU DEMO
https://nsa40.casimages.com/img/2019/04/12/19041205314929664.jpg
At the left a STM32F103ZET at the right a STM32F407ZGT6. Only 12$ and 144 package.
I will try to compile your mks robin touch poc repo on it with an illi9341 in 16bits.

@Bob-the-Kuhn
Copy link
Contributor

I've been working with the L6470 and the powerSTEP01 shields since early this year. The code is waiting on Scott having enough time to coordinate the library and Marlin changes. See PR #13498.

Thermally the powerSTEP01 is a much better choice. I was having a terrible time cooling the L6470s when driving my 24V 1.5A/phase NEMA23 steppers. The powerSTEP01 doesn't need any additional cooling.

I've not actually done any printing using these devices. I was trying to tune the system to get better performance than the A4988 when I ran across the TMC5160.

The L6470 and the powerSTEP01 are not a good fit with Marlin. They are meant to be given a "go to here" command sequence and then the main CPU just sits back and waits for the chips to finish. To fit Marlins STEP/DIR interface I had to use the chip's STEP_CLOCK mode which meant I lost some things - most notably the auto current reduction when not stepping. That results in much more current drain than when stepping.

The architecture concern I have has to do with the lack of double buffering. I expect that 3D printing will stutter because there's so much SPI traffic needed to setup a "go to here" move that a three stepper system probably can't be updated before the next move should begin. If the chips were double buffered then the next move could be setup while the current one is executing.

@youprint
Copy link

Look at this discussion on a port of GRBL for STM32F411 :
langwadt/grbl_stm32#13
GRBL and Marlin even Smothie are not designed to fit this kind of drivers.
rene_dev (a linuxcnc dev) is working on a driver for LinuxCNC which is a reference for motion control in real time.
i'm really curious to look at this code. He is creating the hardware on a STM32F7 :
https://github.com/rene-dev/stmbl/tree/master/hw/kicad/bob/ethernet_bob
https://github.com/rene-dev/stmbl/tree/master/hw/kicad/bob/ethernet_bob_base

@Bob-the-Kuhn
Copy link
Contributor

He's into industrial CNC & motion control. There's a mention of 360V & 2KW as limits on the stepper/servo controller. Almost a different universe.

@youprint
Copy link

youprint commented Apr 13, 2019

No that's STMBL project (a servo driver for old analog servo)
He is working on an another project to drive with STMF7 some powerstep01 via realtime ethernet.
https://youtu.be/hVCuPgjcF8g
https://www.youtube.com/watch?v=2zFvhSV5ANc
And Linuxcnc driving a 3dprinter :
https://www.youtube.com/watch?v=DVYs6ya1nTU

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

Successfully merging this pull request may close these issues.

4 participants