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

DMA Serial Reading to Circular buffer #26328

Merged
merged 44 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
fbbf539
Update README.md
rondlh Oct 7, 2023
01dcee1
DMA SERIAL READING TO CIRCULAR RX BUFFER
rondlh Oct 7, 2023
88c976b
Revert "Update README.md"
rondlh Oct 8, 2023
bd49014
Changed HAVE_HWSERIALx to USING_HW_SERIALx
rondlh Oct 8, 2023
2988878
formatting
thinkyhead Oct 8, 2023
f01ca5c
HardwareSerial2 => HAL_HardwareSerial
thinkyhead Oct 8, 2023
f92e20f
misc.
thinkyhead Oct 8, 2023
7506508
Added STM32F1xx support, untested!
rondlh Oct 8, 2023
abd47af
Merge branch 'bugfix-2.1.x' of https://github.com/rondlh/Marlin-DMA_R…
rondlh Oct 8, 2023
6d3d4ef
Merging STM32F1 update with Scott's good work, convert to HAL_Hardwar…
rondlh Oct 8, 2023
da14958
Merge branch 'bugfix-2.1.x' into pr/26328
thinkyhead Oct 8, 2023
d458fd8
format and fix
thinkyhead Oct 8, 2023
44b4e3f
etc
thinkyhead Oct 8, 2023
40d0b36
cleanup. best guess for USART4
thinkyhead Oct 8, 2023
10e866b
etc
thinkyhead Oct 8, 2023
bb77078
Leave STM32F1 (Maple) as-is
thinkyhead Oct 8, 2023
1c1d8dd
fix ctor
thinkyhead Oct 9, 2023
7037a52
Don't break other build, keep old code if not STM32F1 F2 F4
rondlh Oct 9, 2023
b355f8c
RX and TX buffers are required to make this work
rondlh Oct 9, 2023
1a3ea93
Support F1 DMA Structure in the same file
rondlh Oct 9, 2023
0f74099
Set SERIAL_PORT 1 for testing
rondlh Oct 9, 2023
f3ac9c7
Corrected issues with STM32F1
rondlh Oct 9, 2023
ef7ac35
Corrected DMA start register for STM32F1
rondlh Oct 9, 2023
f6ab50b
SERIAL_PORT set back to 0
rondlh Oct 10, 2023
4ddba70
Disable Arduino to resolve variable naming conflicts
rondlh Oct 10, 2023
0ecbb7e
Guard Serial DMA writing code with "SERIAL_DMA"
rondlh Oct 10, 2023
9a155af
STM32F0 and STM32F7 support, added Configuration_adv.h
rondlh Oct 11, 2023
8240dc9
Cleanup items not needed for SERIAL_DMA
rondlh Oct 12, 2023
8fb3072
Increase undefined or 0 size RX Buffer from 64 to 128 bytes
rondlh Oct 12, 2023
20ef32e
Improve code readability, STM32F0 support
rondlh Oct 12, 2023
0da5e5f
Merge remote-tracking branch 'upstream/bugfix-2.1.x' into bugfix-2.1.x
rondlh Oct 12, 2023
9fde816
Merge branch 'MarlinFirmware:bugfix-2.1.x' into bugfix-2.1.x
rondlh Oct 12, 2023
31eaa0f
Merge branch 'bugfix-2.1.x' of https://github.com/rondlh/Marlin-DMA_R…
rondlh Oct 12, 2023
9b4be3e
Merge remote-tracking branch 'upstream/bugfix-2.1.x' into bugfix-2.1.x
rondlh Oct 13, 2023
b644553
Merge remote-tracking branch 'upstream/bugfix-2.1.x' into bugfix-2.1.x
rondlh Oct 14, 2023
68229ab
Merge remote-tracking branch 'upstream/bugfix-2.1.x' into bugfix-2.1.x
rondlh Oct 20, 2023
34dd6bc
Fixed compilation error because UART5 has no DMA support on F0 and F1
rondlh Oct 28, 2023
e096917
Merge remote-tracking branch 'upstream/bugfix-2.1.x' into bugfix-2.1.x
rondlh Oct 28, 2023
423e822
check for defines
thinkyhead Dec 11, 2023
1b42724
Merge branch 'bugfix-2.1.x' into pr/26328
thinkyhead Dec 11, 2023
e9eba89
apply standards
thinkyhead Dec 11, 2023
28ff5d4
update comments
thinkyhead Dec 11, 2023
2f75203
add a test
thinkyhead Dec 11, 2023
6b1b5dd
Move some serial defaults
thinkyhead Dec 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -2649,10 +2649,12 @@
//#define FULL_REPORT_TO_HOST_FEATURE // Auto-report the machine status like Grbl CNC
#endif

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

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

/**
* This feature is EXPERIMENTAL so use with caution and test thoroughly.
* Enable this option to receive data on the serial ports via the onboard DMA
* controller for more stable and reliable high-speed serial communication.
* Only some STM32 MCUs are currently supported.
* Note: This has no effect on emulated USB serial ports.
*/
//#define SERIAL_DMA

/**
* Set the number of proportional font spaces required to fill up a typical character space.
* This can help to better align the output of commands like `G29 O` Mesh Output.
Expand Down Expand Up @@ -3442,9 +3453,8 @@
/**
* TWI/I2C BUS
*
* This feature is an EXPERIMENTAL feature so it shall not be used on production
* machines. Enabling this will allow you to send and receive I2C data from slave
* devices on the bus.
* This feature is EXPERIMENTAL but may be useful for custom I2C peripherals.
* Enable this to send and receive I2C data from slave devices on the bus.
*
* ; Example #1
* ; This macro send the string "Marlin" to the slave device with address 0x63 (99)
Expand Down
4 changes: 0 additions & 4 deletions Marlin/src/HAL/AVR/MarlinSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@
#include "../../core/types.h"
#include "../../core/serial_hook.h"

#ifndef SERIAL_PORT
#define SERIAL_PORT 0
#endif

#ifndef USBCON

// The presence of the UBRRH register is used to detect a UART.
Expand Down
4 changes: 4 additions & 0 deletions Marlin/src/HAL/AVR/inc/Conditionals_LCD.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@
*
*/
#pragma once

#ifndef SERIAL_PORT
#define SERIAL_PORT 0
#endif
10 changes: 0 additions & 10 deletions Marlin/src/HAL/LPC1768/MarlinSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,6 @@
#endif
#include "../../core/serial_hook.h"

#ifndef SERIAL_PORT
#define SERIAL_PORT 0
#endif
#ifndef RX_BUFFER_SIZE
#define RX_BUFFER_SIZE 128
#endif
#ifndef TX_BUFFER_SIZE
#define TX_BUFFER_SIZE 32
#endif

class MarlinSerial : public HardwareSerial<RX_BUFFER_SIZE, TX_BUFFER_SIZE> {
public:
MarlinSerial(LPC_UART_TypeDef *UARTx) : HardwareSerial<RX_BUFFER_SIZE, TX_BUFFER_SIZE>(UARTx) { }
Expand Down
4 changes: 4 additions & 0 deletions Marlin/src/HAL/LPC1768/inc/Conditionals_LCD.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@
*
*/
#pragma once

#ifndef SERIAL_PORT
#define SERIAL_PORT 0
#endif
7 changes: 7 additions & 0 deletions Marlin/src/HAL/LPC1768/inc/Conditionals_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,10 @@
#if DISABLED(NO_SD_HOST_DRIVE)
#define HAS_SD_HOST_DRIVE 1
#endif

#ifndef RX_BUFFER_SIZE
#define RX_BUFFER_SIZE 128
#endif
#ifndef TX_BUFFER_SIZE
#define TX_BUFFER_SIZE 32
#endif
Loading
Loading