-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Incorrect register mask definition #290
Comments
Thanks. |
Bit 7 - STTBRK (Start transmitter break), should be 1 So, macro should be 0xA0. |
UART Mode Register XUARTPS_MR_OFFSET at offset 0x4 has a 2-bit field to set the desired stop mode (check XUARTPS_MR_STOPMODE_2_BIT 0x80, XUARTPS_MR_STOPMODE_1_5_BIT 0x40). I'm perplexed by your comment that seemingly refers to a completely separate register, apparently the UART Control Register XUARTPS_CR_OFFSET at offset 0x0, and the bits defined in that register. I also don't necessarily disagree that a macro that sets bits 7 and 5 in that other register could be useful for something and could be defined as a separate constant in xuartps_hw.h However as of now I'm convinced that the XUARTPS_MR_STOPMODE_MASK constant was defined for a different purpose and is currently defined incorrectly. |
XUARTPS_MR_STOPMODE_2_BIT 0x80 and XUARTPS_MR_STOPMODE_1_5_BIT 0x40 are for configuring the number of stop bits (2 stop bits or 1.5 stop bits), the uartps controller issues that many stop bits during stop condition. |
That is correct, and the XUARTPS_MR_STOPMODE_MASK is the bitmask that was, apparently, intended to simplify access to this 2-bit bitfield. The bits 6,7 can't be considered independently, values XUARTPS_MR_STOPMODE_2_BIT are XUARTPS_MR_STOPMODE_1_5_BIT are mutually exclusive and the XUARTPS_MR_STOPMODE_MASK mask is there to help with e.g. read-modify-write operations on this bitfield. Just like the other similar masks that I've mentioned in my previous post. For that the value of XUARTPS_MR_STOPMODE_MASK needs to be 0xC0. |
https://github.com/Xilinx/embeddedsw/blame/3728f546f178a1bcd91cf6efc9f8921447846cec/XilinxProcessorIPLib/drivers/uartps/src/xuartps_hw.h#L119
According to mode register definition in:
https://docs.xilinx.com/r/tRsGljEoh_lnUPXyOVIunw/VVLEO6lNe6~jpmp4StFQ9Q
#define XUARTPS_MR_STOPMODE_MASK 0x000000A0U /**< Stop bits mask */
mask value should be 0xC0 not 0xA0
The text was updated successfully, but these errors were encountered: