-
Notifications
You must be signed in to change notification settings - Fork 209
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
RFC draft - patch to add IrDA SIR mode support to the usart code. #466
base: master
Are you sure you want to change the base?
Conversation
In release mode it should be optimized out if not used. So I think No. |
Re f405 tests failing - the docs say that register should be present, so maybe an SVD error? Is that likely? |
No. It present in Line 695 in 7dced36
|
OK, thanks, so this needs to be conditionally not compiled for uarts (as opposed for usarts) [edit: this was incorrect - see below - the SVDs were missing the IrDA fields for UARTs - see https://github.com/stm32-rs/stm32-rs/pull/713 ], I'll take a look at that once I've worked out what's going on with the mystery of the missing start bits. |
I don't think it will be easy with current implementation. |
I think I found some workaround witch don't requires total rework. Instead of adding this to USART: Instance + core::ops::Deref<Target = crate::pac::usart1::RegisterBlock> Something like ab28a0a |
Also in this case you don't need |
The plot thickens... According to RM0090
n.b. The GTPR register is also used for Smartcard mode - which is not present on UART peripherals. |
I noticed that the GTPR register is included in the UART4 peripheral of the stm32f413, but is missing on the other models which include UART4: https://stm32-rs.github.io/stm32-rs/stm32f/stm32f4/UART4_0x40004C00.html I only have an stm32f446 here, so I tried writing to the GTPR register to see if it would have any effect. It works exactly as expected (writing to the PCS bits of the location where the GTPR reg "should" be does change the transmit pulse length in IrDA low-power mode, exactly as it does on USART peripherals on the 446, and on the 411), so I suspect that this omission is just an SVD bug, and I'll submit a PR to stm32-rs. As to why the register is missing from the SVDs... The GTPR register is used in IrDA mode, and also in Smartcard mode. The UART peripheral includes IrDA support, but doesn't include Smartcard support, so I think it was accidentally omitted from the SVD because of this (the wording in the reference manual is ambiguous, so maybe this is the original source of the error). |
PAC issue: |
A few queries about this:
Any comments welcome!
n.b. I'm seeing some weird behaviour in transmit mode (missing or truncated start bit pulse) - which I'm currently debugging - might be a clock setup issue outside of the serial driver code.