m7621 i2c read failure

Peter Naulls peter at chocky.org
Mon Feb 20 06:48:59 PST 2023


On 2/16/23 17:17, Alexander Papazoglou wrote:

> My first guess would be that your microcontroller code doesn't handle repeated 
> starts properly. All of the i2ctransfer commands you've shown involve at least 
> one repeated start with the new driver but perhaps not with the old one. To 
> verify, you can break them up in such a way that no repeated starts are issued.
> 
> Since you control the microcontroller, you can add diagnostic code (printfs?) to 
> see what I2C reads/writes are being issued by the MT7621.
> 

Yes, understood and thank you.  Unfortunately, due to present time constraints,
I need to leave this as working "well enough" with the older driver. I strongly
suspect I'll be returning to this, but it will be some weeks away. In the 
meantime, in case someone else stumbles across this, I will add some
remaining information that I should have filled in.

The MCU is an ARM-based Sinomcu part, which is a clone of some kind. I'm using
the Keil SDK and whatever libraries that is pulling in/using.

I do have an MCU development board with its own serial port, but in practice
on the real hardware, I think the only real debug is going to be i2c itself.
I think it is possible to set breakpoints of the debugger (STLink), but not
single step for whatever reason.  If there's a way to get debug strings of
of the STLink, then I haven't discovered it.

Thanks again.




More information about the openwrt-devel mailing list