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

NRF5: Async serial write doesn't send first character and reads past length #4002

Closed
seppestas opened this issue Mar 23, 2017 · 0 comments
Closed

Comments

@seppestas
Copy link
Contributor

Because of an off-by-one error in the serial_api of the NRF5 target the first character of the buffer is not sent and data at buffer[length] is accessed when using the Serial.Read function.

Steps to reproduce

  • Program following firmware on an NRF52 MCU:
#include "mbed.h"

// Note: using USBTX and USBRX seems to cause issues when trying to read
// This might be caused by stdio or my hardware.
Serial serial(USBTX, USBRX);

int main()
{
	serial.write(reinterpret_cast<const uint8_t *>("Hello world!"), sizeof("Hello world"), 0, 0);
}
  • Connect to the device's serial port
  • Start the device

Result

"ello world!" is received on the other end of the serial connection.

Expected result

"Hello world" should be recieved on the other end of the serial connection.

Environment

Tested on the NINA-B112 module with UBLOX_EVK_NINA_B1 target, but this issue
should exist on all targets overriding the NRF5 target.

Originaly found on mbed-os 5.4 (f4864dc), bug still exists in master.

@seppestas seppestas changed the title Async serial write doesn't send first character and reads past length on NRF5 target NRF5: Async serial write doesn't send first character and reads past length Mar 23, 2017
@sg- sg- closed this as completed in 5c4c6ac Mar 29, 2017
sg- added a commit that referenced this issue Mar 29, 2017
Fixed OBOE in async serial tx for NRF52 target, fixes #4002
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant