Thanks to visit codestin.com
Credit goes to github.com

Skip to content

grisp_i2c breaks when a longer message is sent after a short one #30

@lwehmeier

Description

@lwehmeier

Versions

  • OS: Ubuntu 16.04
  • Erlang: Erlang/OTP 20 Erts 9.2
  • Rebar: rebar 3.5.3 on Erlang/OTP 20 Erts 9.2
  • rebar3-grisp: master

Description

When a short message is sent before a longer message, the grisp_i2c module only transmits $SHORTMSGLENGTH bytes of the longer message correctly and 0x00 after that.

Reproduce:

  • grisp_i2c:msgs([16#40, {write, <<16#23, 16#24, 16#25>>}]). works fine
  • grisp_i2c:msgs([16#40, {write, <<16#42>>}, {write, <<16#23, 16#24, 16#25>>}]). What happens on the I2C bus: I2C_START to Address 40, I2C_WRITE, 0x23, 0x00, 0x00

capture

Edit

The problem persisted even through several resets, but after connecting a debugger to take a look at the ATSAM's I2C registers, the problem mysteriously disappeared.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions