Porting Marlin to STM32.

What are you developing?
youprint
Posts: 12
Joined: Mon Jan 22, 2018 10:57 pm
Location: Lyon France

Re: Porting Marlin to STM32.

Post by youprint » Wed Jan 24, 2018 8:46 pm

Hi everybody
i'm trying to compile the code on a Open103Z (STM32F103ZET) very close of 103RET but i've an issue during compilation :

Code: Select all

sketch\src\HAL\HAL_STM32F1\persistent_store_impl.cpp: In function 'bool HAL::PersistentStore::access_start()':

sketch\src\HAL\HAL_STM32F1\persistent_store_impl.cpp:56:20: error: 'class CardReader' has no member named 'read'

  bytes_read = card.read (HAL_STM32F1_eeprom_content, HAL_STM32F1_EEPROM_SIZE);

                    ^

sketch\src\HAL\HAL_STM32F1\persistent_store_impl.cpp: In function 'bool HAL::PersistentStore::access_finish()':

sketch\src\HAL\HAL_STM32F1\persistent_store_impl.cpp:70:23: error: 'class CardReader' has no member named 'write'

  bytes_written = card.write (HAL_STM32F1_eeprom_content, HAL_STM32F1_EEPROM_SIZE);

                       ^

exit status 1
Erreur de compilation pour la carte Generic STM32F103Z series
Maybe someone have an idea ?

youprint
Posts: 12
Joined: Mon Jan 22, 2018 10:57 pm
Location: Lyon France

Re: Porting Marlin to STM32.

Post by youprint » Tue Feb 06, 2018 11:27 am

I finally successfully compiled Marlin on a f103re and on a f103ze. It seems to work. I had to disable the EEPROM emulation function and I modified a little bit the Hal spi hardware.
Now I can connect to my stm32 via pronterface 8-)
I’m preparing a test board now :
Image
I’m going to try to test with L6470 too
Thanks so much Victor for your HAL, it’s going to have a great success because it’s the most promising platform for Marlin 2.0. A stm32 chip is cheaper and powerful than an AVR. we could expect to use the blue pill for minimal configuration. This is amazing!

victor_pv
Posts: 1868
Joined: Mon Apr 27, 2015 12:12 pm

Re: Porting Marlin to STM32.

Post by victor_pv » Tue Feb 06, 2018 4:27 pm

Youprint the spi was modified by someone else in Marlin and I didn't get a chance to test those changes yet. Since you got it working, please remember to submit the change to Marlin so it gets corrected.

I'm glad that you work it working. I have tested it successfully with VET and ZET mcus.

youprint
Posts: 12
Joined: Mon Jan 22, 2018 10:57 pm
Location: Lyon France

Re: Porting Marlin to STM32.

Post by youprint » Tue Feb 06, 2018 7:38 pm

There is a small pb with spi but I think you will find the solution quickly when you will have time for that. I mixed your repo and the official repo to get it work because on your repo there is a pb with HAL timers. I spend 3 days but it’s compiling now. Tomorrow i’m Going to test motors and limit switches. If everything is ok I will try it on my test printer. I hope to get SPI work because I really like spi drivers like L6470.

victor_pv
Posts: 1868
Joined: Mon Apr 27, 2015 12:12 pm

Re: Porting Marlin to STM32.

Post by victor_pv » Tue Feb 06, 2018 10:21 pm

youprint wrote:
Tue Feb 06, 2018 7:38 pm
There is a small pb with spi but I think you will find the solution quickly when you will have time for that. I mixed your repo and the official repo to get it work because on your repo there is a pb with HAL timers. I spend 3 days but it’s compiling now. Tomorrow i’m Going to test motors and limit switches. If everything is ok I will try it on my test printer. I hope to get SPI work because I really like spi drivers like L6470.
I have used an SPI port with the SDcard without any issue. All SPI ports should work, unless some other part of marlin is broken by those updates.

youprint
Posts: 12
Joined: Mon Jan 22, 2018 10:57 pm
Location: Lyon France

Re: Porting Marlin to STM32.

Post by youprint » Wed Feb 07, 2018 5:08 am

Thanks for the info Victor, I m going to have a try with a Sd reader to test SPI. I was surprised to see someone adding code without testing it (3rd January) but I think it’s only a syntax Pb with STM32duino SPI libs.
https://github.com/MarlinFirmware/Marlin/pull/9019

I have a RepRap Discount LCD and a 12864 too so I think I.m going to try it but it’s coming from Arduino so I have to check if I need to level some signals.
Working on a MKS Robin with an STM32F103ZET6 to install the Arduino Bootloader. Apparently the chip is locked, I can’t unlock it with a Jlink V8 in SWD so I have to try with a Jlink V9 or with a BMP.
Image


I saw a HAL F7 now which it’s working, only a F4 HAL is missing and we will have all the STM32 family of products.

I'm going to start on a project with LinuxCNC, since it can support 3Dprinter. My objective is to use a Raspberry pi in master with an STM32Fxx in slave mode to allow rpi access to fast IO of the STM chip via SPI. It already been done with an FPGA (Spartan 6 via SPI) but it could be cheaper with a Blue Pill and the driver for FPGA could be a really good start. All i need is a good HAL for the STM, so I need to learn more... ;)

Post Reply