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

Add support for Teensy4.1 #19311

Merged
merged 27 commits into from
Sep 9, 2020
Merged

Add support for Teensy4.1 #19311

merged 27 commits into from
Sep 9, 2020

Conversation

bilsef
Copy link
Contributor

@bilsef bilsef commented Sep 8, 2020

Description

Add support for Teensy 4.1

Benefits

More flexibility for Marlin

Configurations

Configuration.h and platformio.ini attached
config.zip

Related Issues

#16666
#17973

@extesy
Copy link

extesy commented Sep 9, 2020

Seems like it's only really supporting Teensy 4.1 because there are not enough pins on Teensy 4.0. The bottom half of your pins diagram is missing in hardware, so calling it a "plan for teensy 4.0 and teensy 4.1" is misleading.

@bilsef
Copy link
Contributor Author

bilsef commented Sep 9, 2020

@extesy, the firmware will support Teensy 4.0, but I didn't create a pinout for it.

@extesy
Copy link

extesy commented Sep 9, 2020

@bilsef You did. There is a file called pins_TEENSY40_41.h (note TEENSY40 in the name) and the documentation says plan for Teensy4.0 and Teensy4.1 (again, note Teensy4.0 in the file called pins_TEENSY40_41.h).

It might not have been your intention, but this PR does look like it fully supports Teensy 4.0 but it doesn't. I'm not trying to make your contribution less valuable, just more accurate and more approachable for other, less technical users.

If there's no pinout for Teensy 4.0 then the compilation should fail with the corresponding error message until somebody else creates the pinout.

Changed supported board name to BOARD_TEENSY41.
@bilsef
Copy link
Contributor Author

bilsef commented Sep 9, 2020

@extesy I get your point. Changes made.

@bilsef bilsef changed the title Add support for Teensy4.x Add support for Teensy4.1 Sep 9, 2020
@bilsef
Copy link
Contributor Author

bilsef commented Sep 9, 2020

Change board name in configuration.h
config.zip

@bilsef
Copy link
Contributor Author

bilsef commented Oct 3, 2020

@nanotuxi I just pushed a fix for a hang (watchdog reset) when telnet writes were attempted while no telnet client was attached. I also merged the latest bugfix-2.0.x with the SD Card fixes. SDCard and Ethernet both work for me. There are still some watchdog resets that I need to track down.

@nanotuxi
Copy link

nanotuxi commented Oct 3, 2020

Pulled it. Progress bar is running RepetierHost connected over TCP. But no commands are echoed. At the end of the file/print
Done printing file is shown. It is a very small calibration file. And now it's TV time. Will respond tomorrow again;-)

@nanotuxi
Copy link

nanotuxi commented Oct 3, 2020

So, I was a little bit curious and found out that if I start the print from sd connected via TCP/IP only M27 commands are shown. Stopping and restarting the print made the print work as expected and all gcode commands are shown and in the Manual Control window the print progress can be observed in RepetierHost.

@Gamester17
Copy link
Contributor

Gamester17 commented Oct 9, 2020

Are you aware of any shield adapters for Teensy 4.1?

FYI, read in #17973 and #16666 that @CrazzyFrenchDude from the OpenPnP community is developing a Breakout Board called "PeeNaPle" as open-source hardware that is made for Teensy 4.1 however that BoB do not have any stepper drivers slots or power Mosfets directly on it so would still need a RAMPS board to build 3D-printer with it. Fab files available here:

https://gitlab.com/CrazzyFrenchDude/peenaple_v1.1b/

PeeNaPle_V1.1b

PeeNaPle is a modular controller BoB for Teensy 4.1. It is designed with Pick and place machines using Open PnP software in mind, but is also 3D Printing, CNC and other Cartesian machines oriented, thanks to an extension and adapter daughter boards eco-system being developed. It is built upon a 6 layer PCB, offering stability an immunity to EMF and electric noises. it Natively offers 8 stepper outputs, 4 End_Stops, UEXT port, Extension port, USB_HOST, Ethernet PHY and CAN_FD. Among the adaptors and extensions being developed you can find a stepper driver adapter to use your favorite TMC2208/09 or else as well as a powerful driver with closed loop so you never miss a step, capable of handling not less than 10A, just to name those 2! Tolerance of up to 35V Max Power In and offers 12V, 5V 3A DCDC, and 3.3V 1A for your convenience. Which are available on the extension ports so you do not need complicated wiring!

Crazzy French Dude first posted about it in #16666

As a matter of fact, this board do not have any stepper drivers or power Mosfet directly on it! This is what makes it modular! Let's say you have a set of your favourite TMC2208 we got you covered! Just plug your driver on the daughter board, plug it to PeeNaPle, set your jumpers and you good to go, same as if you would with a BTT. The reason why I came to this design is sometimes, in the Open Pnp community we need beefy drivers for X and Y Axis, so I have developed a strong and reliable driver for those using big stepper driver in the CnC environment, no need to have those big boxes! If you need more steppers, just plug in the extension board and off you go, you need Wifi, sure, use the UEXT port. This board makes it easy for you build your controller with exactly and only what you need, it has an eco system ready extension package in development, and can't wait to see what extension the makers will build for it as well! Actually in testing phase I am. planning for mass production so It will the coast at a very low entry point what would get the makers interest tick! The only thing I haven't done yet is work on any Firmware. But as you suggested it is good for Open Pnp and for 3D printing as well!

Crazzy French Dude then posted in #17973

All this began with the need of a Pick and Place Machin for my "daily" DIY's!Then found out that the makers were using 3D printing controller boards for that matter! And some would have issues with using the thermistors input to plug in there vacuum sensor or other little annoying problems which are not real because the 3D controllers were not especially built for that (Pick And Place Machines)! So I went to the Open Pnp Forum and launched a thread, asking them what would their dream controller for OPNP be. Then started a humble design pcb design around the new comer Teensy 4.1, the PeeNaPle_V1.1b. With it's modularity it joins 3 worlds, not so different! 3D printing, CNC and Pick and Place Machines! With an array of extension boards, stepper driver adapters, Mosfet switches, extension boards, etc and not to mention what the makers will come up with!
Still in revision mode I just can't wait for Marlin to be supported or GrblHAL or any gerber firmware! So I give you an early glance at this little baby!

His website is not yet active

https://www.crazzyfrenchdude.com/

image

image

@nanotuxi
Copy link

nanotuxi commented Oct 9, 2020

This looks like a similar approach known from ESP32 board developer Bart Dring. His 6 Pack Universal CNC Controller has been built with a modular approach, too. The sources are available on github. This approach is in my personal opinion the best way to get rid of waisting tons of microcontroller boards where only a single element is broken. So this is a step towards "Friday for future" somehow. If Duet boards would be built in that manner I would have bought one.
The PeeNaPle board is something I would support, too. When are these boards available? Is it possible to get a board for testing?

@CrazzyFrenchDude
Copy link

CrazzyFrenchDude commented Oct 10, 2020

Hello Everyone and thanks for your interest in the PeeNaPle BoB!

Was a bit busy designing daughter boards and other oriented 3D world stuffs!
@nanotuxi the PeeNaPle will be available at the end of the year or earlier as a customisable kit!
You will be able to chose regular stepper motor driver adapters, high current stepper motor drivers with loop control,
expansion boards etc...
There will also be a 10 Boards Giveaway, simply write a post on Instagram, (sorry guys that's my only social media for now) picking the boards front pict from the Githlab and make sure to use #crazzyfrenchdude or #peenaple and mention [@]crazzyfrenchdude and you will be in.
All these and more, will be available at the CFD Store as soon as the website will be available!

Thanks so much to everyone and thanks to @bilsef for this amazing work on the MarlinFirmware, CFD!!!

@nanotuxi
Copy link

nanotuxi commented Oct 12, 2020

@bilsef

I'm running into some problems uploading a file to SD Card over TCP. Can you try it?

It works for me with this workaround:

  1. Slice your stl file and save gcode to a file in 8.3 format.
  2. Open File upload in RepetierHost and select the saved gco file and say o.k. (Nothing happens)
  3. Reopen File upload , do nothing but click o.k.
    Now the file is uploading. Double checked it in
    a. RepetierHost
    b. Reading the file with text editor on my laptop.
    Hope it helps.

You have to upload in 8.3 file format, otherwise it won't work with RepetierHost.

@kursatu
Copy link

kursatu commented Oct 14, 2020

I am building this teensy4.1 to Mega2560 adapter/RAMPS shield.
The idea is to use a RAMPS board and use this adapter with teensy on it.
It does not have any active components, just female headers.
It connects the teensy4.1 pins to the RAMPS/Mega2560 pins.
Not sure how well this can be done never used RAMPS boards before.
Few pins were not easy to map. They conditionally map
differently, so I need to check and verify that they are correct.
https://github.com/kursatu/Teensy4.1-ramps-shield

@nanotuxi
Copy link

nanotuxi commented Oct 14, 2020

@kursatu
That is exactly what I intended to work on. Without having in mind to produce a Re-Arm like board. Mine will stay breadboard or at least manually soldered together forever. Thank you for sharing it anyway. As I am working on another project that needs much more time than this one I'll stay tuned on your and @CrazzyFrenchDude 's progress on building ready-to-use boards.
If you want a cheap supplier for production... ask this guy -> bitluni on his github channel.
Have fun ;-)

@Gamester17
Copy link
Contributor

Gamester17 commented Oct 15, 2020

FYI, there is some further discussion about Marlin Firmware for Teensy 4.1 and breakout-boards on CNX-Software website here:

https://www.cnx-software.com/2020/10/13/teensy-4-1-cortex-m7-board-gets-marlin-firmware-and-openpnp-breakout-board/

Personally, I would love to see an all-in-one breakout-board similar to the SKR series of boards by BIQU/BIGTREETECH. That is, a BoB with onboard Ethernet port and Pololu/Stepstick-slots so only need to add Teensy 4.1 and plugin stepper-drivers.

Alternatively just a complete controller board in BTT SKR style but with an integrated NXP i.MX RT10xx ARM Cortex-M7 SoC.

Regardless, hope that we will see more NXP i.MX RT10xx / i.MX RT series based boards with ARM Cortex-M7 cores in the future.

https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/i-mx-rt-crossover-mcus:IMX-RT-SERIES

Another option is the STM32H7 series of SoCs from STMicro which is also based around single-core Cortex-M7 microcontroller

https://www.cnx-software.com/2020/09/30/new-stm32h7-cortex-m7-mcus-clock-at-550-mhz-feature-octal-spi-flash-and-ethernet-interfaces/

Benefit with STM32H7 series is that it has embedded flash storage but it may increase the price compared to NXP i.MX RT series

https://www.cnx-software.com/2018/09/07/stmicro-stm32f7x0-h7x0-value-line-cortex-m7-mcu/

@nanotuxi
Copy link

@Gamester17
Personally, I would love to see an all-in-one breakout-board similar to the SKR series of boards by BIQU/BIGTREETECH. That is, a BoB with onboard Ethernet port and Pololu/Stepstick-slots so only need to add Teensy 4.1 and plugin stepper-drivers.

Lazy, lazy guy. Hey, just kidding.
To be serious, building everything in a modular way will never be accepted neither by people who are not affected in any way with hardware related stuff nor by people who want to earn money with these kind of boards. The disadvantage is the above mentioned waste of resources.
I am totally convinced that this behaviour will change in future if enough people have insight in the fact that resources on this planet are NOT INFINITE.
Thanks for the other info.

@Gamester17
Copy link
Contributor

Another FYI, just read about newly announced "iMX RT1064 uCOM" board from Embedded Artists so submitted a feature request:

#19749

Maybe depending on its price when general availability it might be an option for those looking at developing BoBs for Teensy 4.1

@Hedda
Copy link

Hedda commented Oct 15, 2020

Is anyone interested in Native Ethernet support for TCP Streaming?

@bilsef What features/functions did you think about in regards to TCP Streaming? Basic TCP serial server feature would be nice for use with a serial client just for remote control over native Ethernet. If you are looking for that as a project then you might want to check out the tasmota-zbbridge subproject as they recently implement a TCP server for streaming serial data into Tasmota firmware for ESP8266 for other reasons, see arendst/Tasmota#8583

@Gamester17
Copy link
Contributor

Gamester17 commented Oct 16, 2020

Can you use a less generic name than "ETHERNET_SUPPORT" there will hopefully be other Ethernet supported in the future, or plan for multiple types? eg some lpc1768/9 based controller come with Ethernet ports and hopefully one day will be supported.

FYI, e.g. STM32 Nucleo-144 boards based on STM32F7 (STM32 F7) features Ethernet PHY and a relatively fast Cortex-M4 -> #19373

Also newer STM32 Nucleo-144 boards based on STM32H7 (STM32 H7) feature Ethernet PHY and a very fast Cortex-M7 -> #19751

@sjasonsmith
Copy link
Contributor

I recommend to the people working with Teensy Ethernet to post a new pull request with the code and continue the discussion there.

As for the STM32 stuff @Gamester17, please stop spamming every semi-related issue or pull request with it. It now has a home in the open feature request, let’s try to keep discussion about it there.

@bilsef
Copy link
Contributor Author

bilsef commented Oct 16, 2020

@nanotuxi, @kursatu, I was thinking about a RAMPS adapter as well. Unfortunately, there are not enough pins on Teensy 4.1 to map to everything on RAMPS, so it will have to be a subset. I've taken a stab at it here: https://github.com/bilsef/Teensy4.1-RAMPS

@CrazzyFrenchDude
Copy link

CrazzyFrenchDude commented Oct 17, 2020

Hello guys, hope you are doing fantastic!!!
I have some news, but this is also a call to all "compilers" @bilsef by example if interested!
I am actually developing an extended version of the PeeNaPle, trying to reduce the gap between the V1.4b and the the 3D printing world! I took a look at Bilsef's firmware and pins mapping and worked from there. So the extension version will be a kit with a common board then you chose ether a 3D printing or a PNP extension! With fans, bed, thermistors, inputs and outputs for 3D or solenoid drivers, vacuum pressure inputs and other input and outputs as well as 3 more stepper motors drivers! The main difference with the PeeNaPle V1.4b is that you can plug in your stepper drivers, and might be available sooner than the V1.4b!
Thanks for your messages on Instagram and keep creating!

PEENAPLE_XTD

Preview of the common board...

@nanotuxi
Copy link

nanotuxi commented Oct 17, 2020

@sjasonsmith I recommend to the people working with Teensy Ethernet to post a new pull request with the code and continue the discussion there
Thanks for that recommendation ;-)
@bilsef Unfortunately, there are not enough pins on Teensy 4.1 to map to everything on RAMPS
In some little esp32 projects some time ago I used a port expander to get behind the pin restriction of these boards. Maybe that would work on a printerboard, too?!? There are some i2s expander which could be used for this purpose.

Your teensy41-ramps is exactly what I thought of ;-)

@bilsef
Copy link
Contributor Author

bilsef commented Oct 18, 2020

PR #19801 created for Teensy Ethernet.

@tamerlano
Copy link

@CrazzyFrenchDude
are there any news about the project?

kageurufu pushed a commit to CR30-Users/Marlin-CR30 that referenced this pull request Apr 30, 2021
@KillerBug
Copy link

I am wondering if anyone has gotten this working with actual hardware? If so, would you be willing to post your config files? I flashed a 4.1 and a 4.0 and both lock up hard, not even programming again unless I use the hardware button.

Also, Teensy 4.0 has enough pins for a 3D printer: https://hackaday.io/project/179657-cnc-mod-board-pendant

@bilsef
Copy link
Contributor Author

bilsef commented Jun 8, 2021 via email

@KillerBug
Copy link

Thanks bilsef!

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.