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

STM32G4 #28

Closed
wants to merge 1 commit into from
Closed

STM32G4 #28

wants to merge 1 commit into from

Conversation

rleh
Copy link
Member

@rleh rleh commented Sep 12, 2019

STM32G4 u(s)art has no tcbgt

For the STM32G4 series only USART1/2/3 support TCBGT, UART4/5 and LPUART do not support it.

@salkinium
Copy link
Member

You should check all of them with care, I did this best-effort only!

@salkinium
Copy link
Member

Ready for merging? Or do you have more fixes?

@rleh
Copy link
Member Author

rleh commented Sep 13, 2019

I don't know what tcbgt means. It was introduced here: modm-io/modm@6cc4ac4316 Can you explain that?

I removed it because it fixed compilation errors.

Currently the modm-io/modm#287 builds successfully on CircleCI without this changes merged.

@salkinium
Copy link
Member

The "tcbgt" feature refers to the availablility of the TCBGT bit in the USART_ ISR registers:

  • Bit 25 TCBGT: Transmission complete before guard time flag

The feature descriptions in modm-devices only operate on a comparison of register maps, so that compatible subsets of one larger map can be distiguished. The SPI driver in modm uses this info much better than the UART driver.

@rleh
Copy link
Member Author

rleh commented Sep 13, 2019

STM32G4 Reference Manual (RM0440 Rev 1)

36.7.9 USART interrupt and status register [alternate] (USART_ISR)

  • Bit 25 TCBGT: Transmission complete before guard time flag
    • This bit is set when the last data written in the USART_TDR has been transmitted correctly out of the shift register. It is set by hardware in Smartcard mode, if the transmission of a frame containing data is complete and if the smartcard did not send back any NACK. An interrupt is generated if TCBGTIE=1 in the USART_CR3 register. This bit is cleared by software, by writing 1 to the TCBGTCF in the USART_ICR register or by a write to the USART_TDR register.
      • 0: Transmission is not complete or transmission is complete unsuccessfully (i.e. a NACK is received from the card)
      • 1: Transmission is complete successfully (before Guard time completion and there is no NACK from the smart card).
    • Note: If the USART does not support the Smartcard mode, this bit is reserved and kept at reset value. If the USART supports the Smartcard mode and the Smartcard mode is enabled, the TCBGT reset value is ‘1’. Refer to Section 36.4: USART implementation on page 1554.

grafik

@salkinium
Copy link
Member

Ugh. #7 is coming to get me. All this data needs to become an order of magnitude better and there needs to be unit tests (or assumption tests) built into this repo.

@salkinium
Copy link
Member

This can be closed, right?

@rleh
Copy link
Member Author

rleh commented Oct 21, 2019

Only UART1/2/3 have the TCBGT feature. This is currentyl not representable in modm-devices, see #7.

@rleh rleh closed this Feb 4, 2020
@rleh rleh deleted the feature/stm32g4 branch February 15, 2021 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants