Increase buffer size possible?

Hello,

I’m currently trying to create my own code for sending UART messages on my RAK3172. I noticed that some bytes were missing even before sending, so I wrote a very simple code to check the Serial.read() function. I have noticed that at least 2 bytes are lost at every 128th position. I assume that this is due to a buffer size? Is it possible to fix this problem by maybe increasing the buffer size?

This is my code:

void setup() {
  Serial2.begin(115200, RAK_CUSTOM_MODE);
}

void loop() {
  while (Serial2.available()) {
    uint8_t c = Serial2.read();
    Serial2.printf("%c", c);
  }
}

The buffer size cannot be changed from the API side. It would require to change it directly in the BSP source code.

ok, is there any workaround to fix this issue? Or only in low level development?

Patching the existing RUI3 BSP or using directly STM32Cube ow level development are the options.
I don’t know whether STM32Cube provides functions or settings to use a larger UART buffer. Memory is very limited in the STM32WLE5.

Thank you, I will try that out! Is there an offline SDK or a sample build script for RAK3172 available?

RAK3172 WisDuo LoRaWAN Module Low Level Development Reference contains some basics, but how to use STM32CubeIDE or their MX??? thing, you have to look at STM32 for guides.

I found a workaround on this. I decreased the baudrate to 38400, then no bytes are lost

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.