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

Incorect baud rate for Nano Connect RP2040? #332

Open
paulhamsh opened this issue Oct 27, 2023 · 2 comments
Open

Incorect baud rate for Nano Connect RP2040? #332

paulhamsh opened this issue Oct 27, 2023 · 2 comments
Labels
topic: documentation Related to documentation for the project type: imperfection Perceived defect in any part of project

Comments

@paulhamsh
Copy link

Hi
Although it works on the Nano Connect RP2040, this code has this in HCIUartTransport.cpp
(https://github.com/arduino-libraries/ArduinoBLE/blob/master/src/utility/HCIUartTransport.cpp)

#if defined(ARDUINO_AVR_UNO_WIFI_REV2) || defined(ARDUINO_NANO_RP2040_CONNECT)
HCIUartTransportClass HCIUartTransport(SerialHCI, 119600);
#else
HCIUartTransportClass HCIUartTransport(SerialHCI, 912600);
#endif

And the NINA firmware has this in sketch.ino.cpp:
(https://github.com/arduino/nina-fw/blob/master/main/sketch.ino.cpp)

#if defined(UNO_WIFI_REV2) || defined(NANO_RP2040_CONNECT)
  btControllerConfig.hci_uart_baudrate = 115200;
#else
  btControllerConfig.hci_uart_baudrate = 912600;
#endif

So should it be changed to 115200?

@per1234 per1234 added type: imperfection Perceived defect in any part of project topic: code Related to content of the project itself labels Oct 28, 2023
@facchinm
Copy link
Contributor

The baud was set to 119k due to the drift of the internal crystal of the Nina module (which made the RX from the module borderline when the serial port host side was set at 115200). On most of the platforms, using any of this values doesn't show any difference since the core tries to find the best clocks divisors to approximate the requested baud, but on Uno WiFi Rev2 it was a necessary fix.

@per1234 per1234 added topic: documentation Related to documentation for the project and removed topic: code Related to content of the project itself labels Oct 30, 2023
@per1234
Copy link
Contributor

per1234 commented Oct 30, 2023

We'll leave this open to track the need for someone to add a comment documenting this important information to avoid this otherwise unintuitive code causing the same confusion to others in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: documentation Related to documentation for the project type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

3 participants