Sending data from a microcontroller to Duet3 (with SBC)
-
Hi,
I have an STM32F4 board running a custom pressure controller, with a melt pressure transducer connected to it. I can achieve basic functionalities with toggling IO pins on the Duet3, but my goal would be to establish a two-way communication with a custom protocol for future features. I am trying to setup an USART connection between IO0 and the STM32 pins, but seems like the Duet3 does not receive anything. I am sending this with the hopes of seeing something pop up in the DWC:
"M118 P3 S\"Hello from STM32!\"\n\r"
I lack the general understanding of how to wire things up - is the Raspberry Pi SBC setup 'overriding' the standalone functions of the Duet3 board? Maybe I should connect the STM32 to RPi, and then have a Python script that sends the commands to DWC?
I would greatly appreciate any info on how this should be done, ideally I would love to add many modules this way, so the communication method needs to be reliable.
TLDR: I need to send pressure readings to Duet3 from STM32, to have a macro which stops a print when the pressure is too low.
Thanks,
AW -
@awitc what are you ultimately going to use the STM32F4 based board for? Which specific STM32F4 processor does it run?
-
@jay_s_uk for now I have a STM32F411RE, will switch up to STM32F491RE in the following days. So it has Arm Cortex-M4. The STM is used to run a custom PID controller, which manipulates the speed of the extruder stepper motor, based on pressure.
EDIT: not extruder motor, but a drive which provides material to be extruded. I want to have the pressure in the extruder at a certain level.
-
@awitc ok. Just wanted to mention that theres a fork of the duet firmware which runs on an STM32F4 (only the STM32F407 and STM32F429) which can have an spi2can module added so it can talk directly over CAN-FD to the duet 3.
Although that probably won't help you with the control of the extruder.Have you added M575 in your config to enable the UART connector?
-
@awitc The UART channel on
io0
should be available no matter if the board is running in standalone or SBC mode but it has to be configured using M575 first (e.g.M575 P1 B57600 S2
). -
@jay_s_uk @chrishamm Yes, I have added the command, using 115200 as baudrate, but from what I see, I had the parameter S set to be default. I will try with the raw mode, that might have been the problem. Thanks!
-
EDIT: took me way too long, no idea what was missing, just started working as it should, thanks