Skip to content

feat: use baudrate from EspSerial in EspNuttx (RDT-1275)#352

Merged
hfudev merged 1 commit intoespressif:mainfrom
fdcavalcanti:feature/nuttx-use-proper-baudrate
Apr 17, 2025
Merged

feat: use baudrate from EspSerial in EspNuttx (RDT-1275)#352
hfudev merged 1 commit intoespressif:mainfrom
fdcavalcanti:feature/nuttx-use-proper-baudrate

Conversation

@fdcavalcanti
Copy link
Copy Markdown
Contributor

Description

This PR modifies the NuttxSerial class.

It had a fixed flash baud rate (for Espressif devices) and now it can be changed through the command line. It simply removes the custom entry for baud rate and uses the baud from the inherited EspSerial class.

Related

Testing

Tested by running Pytest without setting --esptool-baud and than by setting to a customized value.
The flash is first erased and then the firmware is uploaded. Baud rate line is marked.

  • Without setting esptool-baud:
==========================================
INFO:root:Flashing device
========================================================================================= test session starts =========================================================================================
platform linux -- Python 3.12.3, pytest-8.3.4, pluggy-1.5.0
rootdir: /dev
configfile: null
plugins: html-4.1.1, embedded-1.16.0, metadata-3.1.1
collected 77 items / 76 deselected / 1 selected                                                                                                                                                       
[...]
2025-04-16 14:18:13 Stub running...
2025-04-16 14:18:13 Changing baud rate to 921600  <<<<<=================
2025-04-16 14:18:13 Changed.
2025-04-16 14:18:13 Configuring flash size...
2025-04-16 14:18:13 Flash will be erased from 0x00000000 to 0x0003efff...
2025-04-16 14:18:13 Compressed 255036 bytes to 113121...
Wrote 255036 bytes (113121 compressed) at 0x00000000 in 1.8 seconds (effective 1126.0 kbit/s)...
2025-04-16 14:18:15 Hash of data verified.
2025-04-16 14:18:15 
2025-04-16 14:18:15 Leaving...
2025-04-16 14:18:15 Hard resetting via RTS pin...
[...]
============================================================================ 1 passed, 76 deselected, 3 warnings in 6.08s =============================================================================
  • Setting --esptool-baud=460800:
==========================================
INFO:root:Flashing device
========================================================================================= test session starts =========================================================================================
platform linux -- Python 3.12.3, pytest-8.3.4, pluggy-1.5.0
rootdir: /dev
configfile: null
plugins: html-4.1.1, embedded-1.16.0, metadata-3.1.1
collected 77 items / 76 deselected / 1 selected                                                                                                                                                       
[...]
2025-04-16 14:28:26 Stub running...
2025-04-16 14:28:26 Changing baud rate to 460800
2025-04-16 14:28:26 Changed.
2025-04-16 14:28:26 Configuring flash size...
2025-04-16 14:28:26 Flash will be erased from 0x00000000 to 0x0003efff...
2025-04-16 14:28:26 Compressed 255036 bytes to 113121...
Wrote 255036 bytes (113121 compressed) at 0x00000000 in 2.6 seconds (effective 772.6 kbit/s)...
2025-04-16 14:28:29 Hash of data verified.
2025-04-16 14:28:29 
2025-04-16 14:28:29 Leaving...
2025-04-16 14:28:29 Hard resetting via RTS pin...
[...]
============================================================================ 1 passed, 76 deselected, 3 warnings in 6.98s =============================================================================

Checklist

Before submitting a Pull Request, please ensure the following:

  • 🚨 This PR does not introduce breaking changes.
  • All CI checks (GH Actions) pass.
  • Documentation is updated as needed.
  • Tests are updated or added as necessary.
  • Code is well-commented, especially in complex areas.
  • Git history is clean — commits are squashed to the minimum necessary.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
@github-actions github-actions bot changed the title feat: use baudrate from EspSerial in EspNuttx feat: use baudrate from EspSerial in EspNuttx (RDT-1275) Apr 16, 2025
@hfudev hfudev merged commit 2cedb77 into espressif:main Apr 17, 2025
3 of 5 checks passed
@hfudev
Copy link
Copy Markdown
Member

hfudev commented Apr 17, 2025

LGTM!

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

Successfully merging this pull request may close these issues.

2 participants