Re: I2c problem on 96b Carbon.

Yannis Damigos

On Fri, Aug 4, 2017 at 2:20 PM, Iñaki Malerba <inakimmalerba@...> wrote:
Hi Yannis.

Thanks for your answer.

No luck.

I found out yesterday it was looping on `handle_rxne` because i've commented
a line.

Now, cherrypicking that commit, gets looped on `handle_txe` as it doesnt
generate the stop condition (`i2c_burst_read` adds the I2C_MSG_RESTART
I don't think the problem is in i2c_burst_read. If you check the
driver code, STM32 I2C driver doesn't use msg.flags to generate a stop
I tested the I2C driver on olimexino_stm32 (stm32f103rb) and
96b_carbon (stm32f401re) boards, driving an oled display based on
ssd1306 chip at 400 kHz, using both interrupt and polling mode.

Did you also check polling mode?

I'll try to get an I2C slave device with read support to test it as
soon as possible.


Martin Iñaki Malerba
inakimmalerba@... | +54 02945 15468443

On Fri, Aug 4, 2017 at 3:53 AM, Yannis Damigos <giannis.damigos@...>


On Fri, Aug 4, 2017 at 12:27 AM, Iñaki Malerba <inakimmalerba@...>
Hi everyone!

I've been struggling with this problem for the last weeks. I cannot make
to comunicate my carbon board with an fxos8700 IMU.

Enabling the interruptions mode on the i2c driver, I can see on the
analyzer it sends the address of the byte to read, but it doesnt
the answer.
I tried my best to debug it with gdb and I get to the point where it
looped on `handle_rxne` (drivers/i2c/i2c_ll_stm32_v1.c) with `data.len =

I also have some doubts about some lines there. For example, how does it
the message if it enters the first `if` with `data.len = 1` and then,
decreased, `data.len == 1` its false.
You are right, the first `if` with `data.len = 1` should be nack and
not ack (probably I made a typo during driver development). In case a
single byte has to be received, the Acknowledge disable is made before
ADDR flag is cleared.

Could you test the I2C read both in polling and interrupt mode with
the following branch? I only have a slave I2C display which supports
only write operations and I cannot test it myself.

If everything works fine, I will create a PR to fix it.

It doesnt generate the stop bit either because the burst read sets
Why does `i2c_reg_read_byte` uses burst read instead of normal read?

Any help on this would be really apreciated, Im really stuck on here.
Martin Iñaki Malerba
inakimmalerba@... | +54 02945 15468443

Zephyr-users mailing list

Join to automatically receive all group messages.