Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

I2C: allow static redefinition of I2C buffer size#853

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@ABOSTM
Copy link
Contributor

Summary

I2C: allow static redefinition of I2C buffer size.
Default buffer size is still 32, but it is now possible to redefine compilation switch: I2C_TXRX_BUFFER_SIZE
It's maximum value is 255

Now it is possible to transfer up to 255 bytes for all following cases:

  • Master read
  • Master write
  • Slave read
  • Slave write

Warning: a bug in STM32 cube HAL currently prevents, in Master mode, to send/receive exactly 255 bytes.
Issue is tracked internally, and fix should come in later release.

Nevertheless, if required, it is possible to patch the STM32 cube HAL:
for example, when working on NUCLEO_L476RG in file stm32l4xx_hal_i2c.c (adapt file name to the STM32 familly you are working on), replace all occurrences of
if (hi2c->XferCount < MAX_NBYTE_SIZE)
by
if (hi2c->XferCount <= MAX_NBYTE_SIZE)

fpistm reacted with thumbs up emoji
Default buffer size is still 32,but it is now possible to redefine compilation switch: I2C_TXRX_BUFFER_SIZEIt's maximum value is 255
@fpistmfpistm added the enhancementNew feature or request labelJan 3, 2020
@fpistmfpistm added this to the1.8.1 milestoneJan 3, 2020
@fpistmfpistm self-requested a reviewJanuary 3, 2020 17:06
Copy link
Member

@fpistmfpistm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM

@fpistm
Copy link
Member

Note: this is internal I2C buffer size.

@ABOSTMABOSTM mentioned this pull requestJan 3, 2020
@fpistm
Copy link
Member

@fpistmfpistm merged commitbca9a7e intostm32duino:masterJan 6, 2020
@fpistmfpistm added the fix 🩹Bug fix labelJan 6, 2020
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fpistmfpistmfpistm approved these changes

Assignees

@ABOSTMABOSTM

Labels

enhancementNew feature or requestfix 🩹Bug fix

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@ABOSTM@fpistm

[8]ページ先頭

©2009-2025 Movatter.jp