[STM32] I2C HAL driver problems and fixes

This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome. This forum is NOT for support.
User avatar
barthess
Posts: 861
Joined: Wed Dec 08, 2010 7:55 pm
Been thanked: 7 times

Re: [STM32] I2C HAL driver problems and fixes

Post by barthess »

MartinP wrote:P.S.: I assume you have defined STM32F1XX and neutralized the chDbgCheck() calls in i2c_lld_master_receive_timeout() and in i2c_lld_master_transmit_timeout()

Correct. I stably get I2C_LOCKED state on second read from bus.
User avatar
barthess
Posts: 861
Joined: Wed Dec 08, 2010 7:55 pm
Been thanked: 7 times

Re: [STM32] I2C HAL driver problems and fixes

Post by barthess »

Can you join us in IRC?
MartinP
Posts: 35
Joined: Mon Apr 02, 2012 11:54 am

Re: [STM32] I2C HAL driver problems and fixes

Post by MartinP »

Can you join us in IRC?

Sorry to answer that late
during day I'm @ work and can only check sporadically the forum and my Developer-Environment is far away @ home

Martin
MartinP
Posts: 35
Joined: Mon Apr 02, 2012 11:54 am

Re: [STM32] I2C HAL driver problems and fixes

Post by MartinP »

Barthess: Here is my test environment:
My quick and dirty test environment
My quick and dirty test environment
Untitled.jpg (237.42 KiB) Viewed 5965 times

here is the source I used
chibios.svn-based on trunk r4564.rar
(60.65 KiB) Downloaded 651 times

I'm using usb-serial. type in shell command "i2c" to start the test

Martin
User avatar
barthess
Posts: 861
Joined: Wed Dec 08, 2010 7:55 pm
Been thanked: 7 times

Re: [STM32] I2C HAL driver problems and fixes

Post by barthess »

Martin,
I really can not understand why your code works. In addition to TMP75 and LIS3 I have tested 24AA eeprom IC. In all cases I get errors.

Giovanni,
Most (if not all) users start their projects by coping one from haltest or from demo. Most of them does not touch default settings in mcuconf.h because can not understand them. For normal functioning on STM32 platform I2C must have highest priority but default confings does not correspond this rule. I propose to rebalance priorities in all mcuconfs shipped with ChibiOS.
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: [STM32] I2C HAL driver problems and fixes

Post by Giovanni »

It is OK if there is no other workaround for this issue. I am not particularly happy to put such a complex ISR at highest priority.

Giovanni
User avatar
barthess
Posts: 861
Joined: Wed Dec 08, 2010 7:55 pm
Been thanked: 7 times

Re: [STM32] I2C HAL driver problems and fixes

Post by barthess »

Giovanni,
I am not happy too but this is minimal evil. Job done at trunk with small reworking shell script and manually rechecked. Script added to repo (.tools/edit_aid) too.

Martin,
We both have the same STM32F103RBT6 MCUs but with different revisions (your revision is "1", my is "Y"). Probably this is reason.
Post Reply