Skip to content

Commit b94a335

Browse files
authored
✨ SERIAL_DMA (for some STM32Fx) (MarlinFirmware#26328)
1 parent 01aa87c commit b94a335

12 files changed

+637
-57
lines changed

Marlin/Configuration_adv.h

+17-7
Original file line numberDiff line numberDiff line change
@@ -2649,10 +2649,12 @@
26492649
//#define FULL_REPORT_TO_HOST_FEATURE // Auto-report the machine status like Grbl CNC
26502650
#endif
26512651

2652-
// Bad Serial-connections can miss a received command by sending an 'ok'
2653-
// Therefore some clients abort after 30 seconds in a timeout.
2654-
// Some other clients start sending commands while receiving a 'wait'.
2655-
// This "wait" is only sent when the buffer is empty. 1 second is a good value here.
2652+
/**
2653+
* Bad Serial-connections can miss a received command by sending an 'ok'
2654+
* Therefore some clients abort after 30 seconds in a timeout.
2655+
* Some other clients start sending commands while receiving a 'wait'.
2656+
* This "wait" is only sent when the buffer is empty. 1 second is a good value here.
2657+
*/
26562658
//#define NO_TIMEOUTS 1000 // (ms)
26572659

26582660
// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary.
@@ -2665,6 +2667,15 @@
26652667
// For serial echo, the number of digits after the decimal point
26662668
//#define SERIAL_FLOAT_PRECISION 4
26672669

2670+
/**
2671+
* This feature is EXPERIMENTAL so use with caution and test thoroughly.
2672+
* Enable this option to receive data on the serial ports via the onboard DMA
2673+
* controller for more stable and reliable high-speed serial communication.
2674+
* Only some STM32 MCUs are currently supported.
2675+
* Note: This has no effect on emulated USB serial ports.
2676+
*/
2677+
//#define SERIAL_DMA
2678+
26682679
/**
26692680
* Set the number of proportional font spaces required to fill up a typical character space.
26702681
* This can help to better align the output of commands like `G29 O` Mesh Output.
@@ -3442,9 +3453,8 @@
34423453
/**
34433454
* TWI/I2C BUS
34443455
*
3445-
* This feature is an EXPERIMENTAL feature so it shall not be used on production
3446-
* machines. Enabling this will allow you to send and receive I2C data from slave
3447-
* devices on the bus.
3456+
* This feature is EXPERIMENTAL but may be useful for custom I2C peripherals.
3457+
* Enable this to send and receive I2C data from slave devices on the bus.
34483458
*
34493459
* ; Example #1
34503460
* ; This macro send the string "Marlin" to the slave device with address 0x63 (99)

Marlin/src/HAL/AVR/MarlinSerial.h

-4
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@
3737
#include "../../core/types.h"
3838
#include "../../core/serial_hook.h"
3939

40-
#ifndef SERIAL_PORT
41-
#define SERIAL_PORT 0
42-
#endif
43-
4440
#ifndef USBCON
4541

4642
// The presence of the UBRRH register is used to detect a UART.

Marlin/src/HAL/AVR/inc/Conditionals_LCD.h

+4
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,7 @@
2020
*
2121
*/
2222
#pragma once
23+
24+
#ifndef SERIAL_PORT
25+
#define SERIAL_PORT 0
26+
#endif

Marlin/src/HAL/LPC1768/MarlinSerial.h

-10
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,6 @@
3030
#endif
3131
#include "../../core/serial_hook.h"
3232

33-
#ifndef SERIAL_PORT
34-
#define SERIAL_PORT 0
35-
#endif
36-
#ifndef RX_BUFFER_SIZE
37-
#define RX_BUFFER_SIZE 128
38-
#endif
39-
#ifndef TX_BUFFER_SIZE
40-
#define TX_BUFFER_SIZE 32
41-
#endif
42-
4333
class MarlinSerial : public HardwareSerial<RX_BUFFER_SIZE, TX_BUFFER_SIZE> {
4434
public:
4535
MarlinSerial(LPC_UART_TypeDef *UARTx) : HardwareSerial<RX_BUFFER_SIZE, TX_BUFFER_SIZE>(UARTx) { }

Marlin/src/HAL/LPC1768/inc/Conditionals_LCD.h

+4
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,7 @@
2020
*
2121
*/
2222
#pragma once
23+
24+
#ifndef SERIAL_PORT
25+
#define SERIAL_PORT 0
26+
#endif

Marlin/src/HAL/LPC1768/inc/Conditionals_adv.h

+7
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,10 @@
2424
#if DISABLED(NO_SD_HOST_DRIVE)
2525
#define HAS_SD_HOST_DRIVE 1
2626
#endif
27+
28+
#ifndef RX_BUFFER_SIZE
29+
#define RX_BUFFER_SIZE 128
30+
#endif
31+
#ifndef TX_BUFFER_SIZE
32+
#define TX_BUFFER_SIZE 32
33+
#endif

0 commit comments

Comments
 (0)