Skip to content

xilinx.cpp: avoid masking 32 bit register fields - #758

Merged
trabucayre merged 1 commit into
trabucayre:masterfrom
umarcor:umarcor/32bmask
Nov 7, 2026
Merged

trabucayre merged 1 commit into
trabucayre:masterfrom
umarcor:umarcor/32bmask

Conversation

@umarcor

@umarcor umarcor commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

uint32_t mask = (1 << size) - 1; is undefined if size==32. It produces 0x0.

This PR avoids masking the reg_val when the size of the field is 32.

Before:

$ sudo /opt/OFL/bin/openFPGALoader -c ft231X --pins=RXD:RTS:TXD:CTS --read-register CTRL1
Jtag probe limited to 3MHz
Jtag frequency : requested 6000000Hz -> real 3000000Hz
ret 0
Register raw value: 0x1e3d0
Reserved        0x0

After:

$ sudo /opt/OFL/bin/openFPGALoader -c ft231X --pins=RXD:RTS:TXD:CTS --read-register CTRL1
Jtag probe limited to 3MHz
Jtag frequency : requested 6000000Hz -> real 3000000Hz
ret 0
Register raw value: 0x1e3d0
Reserved        0x1e3d0

@trabucayre
trabucayre merged commit 8053cb8 into trabucayre:master Nov 7, 2026
12 checks passed
@trabucayre

Copy link
Copy Markdown
Owner

Good catch!
Thanks @umarcor !

@umarcor
umarcor deleted the umarcor/32bmask branch November 7, 2026 20:04
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