Serial Buffer Size - How to adjust
Posted: Fri Feb 21, 2025 2:04 pm
Hi
I'm running an STM32F407VET using UART to another uC (on same PCB) and would like the option to change the buffer from 64 bytes to 256.
I've tried to follow the guidance at https://github.com/stm32duino/Arduino_C ... uffer-size
What i have specifically done is - added another file in my project folder, "hal_conf_extra.h"
- inside that I've put the following only (I haven't put anything else like #include "Arduino.h" for example):
if !defined(SERIAL_TX_BUFFER_SIZE)
#define DSERIAL_TX_BUFFER_SIZE=256
#endif
#if !defined(SERIAL_RX_BUFFER_SIZE)
#define DSERIAL_RX_BUFFER_SIZE=256
#endif[/code]
in my .ino i have added:
#include "hal_conf_extra.h"
In my setup() I defined my serial (that works fine, just the buffer is a little smaller than I'd like) with:
HardwareSerial ESPSerial(PC11, PC10); //Rx, TX pins from/to ESP32
When I use the Arduino IDE debugger, under Variables - Global - ESPSerial - Stream _rx_buffer still shows [64], and so does tx.
Any ideas where I am going wrong? Am I defining the 256 to a different serial perhaps?
I'm running an STM32F407VET using UART to another uC (on same PCB) and would like the option to change the buffer from 64 bytes to 256.
I've tried to follow the guidance at https://github.com/stm32duino/Arduino_C ... uffer-size
What i have specifically done is - added another file in my project folder, "hal_conf_extra.h"
- inside that I've put the following only (I haven't put anything else like #include "Arduino.h" for example):
if !defined(SERIAL_TX_BUFFER_SIZE)
#define DSERIAL_TX_BUFFER_SIZE=256
#endif
#if !defined(SERIAL_RX_BUFFER_SIZE)
#define DSERIAL_RX_BUFFER_SIZE=256
#endif[/code]
in my .ino i have added:
#include "hal_conf_extra.h"
In my setup() I defined my serial (that works fine, just the buffer is a little smaller than I'd like) with:
HardwareSerial ESPSerial(PC11, PC10); //Rx, TX pins from/to ESP32
When I use the Arduino IDE debugger, under Variables - Global - ESPSerial - Stream _rx_buffer still shows [64], and so does tx.
Any ideas where I am going wrong? Am I defining the 256 to a different serial perhaps?