Skip to content

[U(S)ART] request list #1418

Closed
Closed

Description

@fpistm

This issue aims to list all U(S)ART requests:

Note

This is a community projects, Any contribution is welcome, so feel free submit a PR. 😉

Activity

  1. pinned this issue on Jun 11, 2021
  2. 4ndreas commented on Jul 6, 2021

    @4ndreas

    I needed the 9 Bit Mode for a project and changed all the buffers to uint16_t and it worked. But I'm not sure if there are some side effects.
    Could also solved with a flag for the 9th bit.

  3. fpistm commented on Jul 6, 2021

    @fpistm
    MemberAuthor

    Hi @4ndreas
    THis was discussed some years ago:
    #482 (comment)

    Main risk is the compatibility issue. I've added the request to the list.

  4. matthijskooijman commented on Aug 5, 2021

    @matthijskooijman
    Contributor

    I have one more suggestion for the list: Support serial writes when interrupts are disabled (e.g. from an ISR). This would make debugging a lot easier, and prevent surprise when someone prints from an ISR and the entire board locks up as soon as the buffer is full.

    To support this usecase, the busy-wait loops in flush() and write() must be modified to call the ISR (or other code that moves the buffer into the UART) whenever a bit is written.

    I implemented something similar on the Arduino AVR core, where IIRC it checks if interrupts are disabled, and if so, checks the TXE bit inside the busywait loop and calls the ISR if it is set. A similar approach can be taken here, though there are some complications:

    • There is not just a single "interrupts disabled" bit, AFAIU when another interrupt is running, the global interrupt mask is unchanged, but IRQ priorities might still prevent the TX interrupt from firing. To simplify things, I think the busy wait loops should simply disable the TXE/TXC (or whichever is used exactly) before the loop, and then inside the loop always call the ISR manually, even when interrupts were enabled already.
    • There is some additional layering with the HAL, the stm32/uart.c and HardwareSerial that makes it a bit more tricky to get this right.

    The second point makes this more complicated than I have time for right now, but I at least wanted to share this request and my thoughts.

  5. fpistm commented on Aug 10, 2021

    @fpistm
    MemberAuthor

    Thanks @matthijskooijman for sharing.
    Just FYI it exists an uart debug feature which does not rely on IT: serial_debug
    Defining DEBUG_UART (USART peripheral, ex: USART1) and DEBUG_PINNAME_TX (PY_n) allows to specify the pin to use else by default it uses the same than default Serial instance. This fallback to uart_debug_write.

  6. akasona commented on Aug 20, 2021

    @akasona
    Contributor

    This is a community projects, Any contribution is welcome, so feel free submit a PR.

    @fpistm I want to make PR for the item: Hardware Flow control for serial communication.
    Where can I find any rules or workflows to contribute this project?

  7. fpistm commented on Sep 7, 2021

    @fpistm
    MemberAuthor

    This is a community projects, Any contribution is welcome, so feel free submit a PR.

    @fpistm I want to make PR for the item: Hardware Flow control for serial communication.
    Where can I find any rules or workflows to contribute this project?

    Hi @akasona
    Sorry, I missed your comment.
    You can refers to the https://github.com/stm32duino/Arduino_Core_STM32/blob/master/CONTRIBUTING.md
    To resume:

    • Fork

    • Implement

    • Ensure Astyle is passed

    • Submit the PR

    • That's all folks 😉

  8. ht93 commented on Dec 16, 2021

    @ht93

    @fpistm For #1160 UART RX/TX level inversion on F3/F7 platforms. Is it possible implement similar function to F4 platform? Or is there any workaround besides hardware way like add physical inverter?

  9. fpistm commented on Dec 16, 2021

    @fpistm
    MemberAuthor

    Hi @ht93 , it seems not available fo F4.

  10. ht93 commented on Dec 16, 2021

    @ht93

    Hi @fpistm, is there any other way to implement this? I am current working on a design with very limit size. Thanks a lot!

  11. fpistm commented on Dec 16, 2021

    @fpistm
    MemberAuthor

    Hi @fpistm, is there any other way to implement this? I am current working on a design with very limit size. Thanks a lot!

    I don't know. You could try to ask on the forum.

  12. akasona commented on Jan 26, 2022

    @akasona
    Contributor

    @fpistm I'm sorry for so slow action! Finally I made up PR in #1634.

  13. 2 remaining items

  14. added
    enhancement
    and removed on Jul 16, 2024
  15. mhmayyan commented on Oct 29, 2024

    @mhmayyan
    Contributor

    Hi
    I am unable to start UART with a 1200 baud rate. I used Serial.begin(1200), but no data were transmitted. When I try a 2400 and higher baud rates, it works. Does anyone have any idea?
    I tried Nucelo-L476RE and B-L4S5I-IOT01A.

  16. fronders commented on Oct 30, 2024

    @fronders
    Contributor

    @mhmayyan It's probably that the BRR value would overflow 0xFFFF for your desired rate at given core frequency.
    IIRC the core runs by default at 80MHz so that would give you bauds between 1220 bps and 5Mbps. I don't know if you check the return code, but at 1200 it would probably just not initialize and return an error

    p.s. I'd recommend opening a separate issue not to flood the request list

  17. fpistm commented on Oct 30, 2024

    @fpistm
    MemberAuthor

    Hi @mhmayyan
    @fronders gave the right answer.
    BRR is overflowed, you have to decrease the clock config and for this kind of question you can open a GitHub discussion.

  18. unpinned this issue on Apr 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions