Page 4 of 4
Re: [STM32] I2C HAL driver problems and fixes
Posted: Mon Aug 13, 2012 11:32 am
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.
Re: [STM32] I2C HAL driver problems and fixes
Posted: Mon Aug 13, 2012 11:34 am
by barthess
Can you join us in IRC?
Re: [STM32] I2C HAL driver problems and fixes
Posted: Mon Aug 13, 2012 9:06 pm
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
Re: [STM32] I2C HAL driver problems and fixes
Posted: Mon Aug 13, 2012 9:40 pm
by MartinP
Barthess: Here is my test environment:

- My quick and dirty test environment
- Untitled.jpg (237.42 KiB) Viewed 5967 times
here is the source I used
I'm using usb-serial. type in shell command "i2c" to start the test
Martin
Re: [STM32] I2C HAL driver problems and fixes
Posted: Tue Aug 14, 2012 1:43 am
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.
Re: [STM32] I2C HAL driver problems and fixes
Posted: Tue Aug 14, 2012 5:51 am
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
Re: [STM32] I2C HAL driver problems and fixes
Posted: Tue Aug 14, 2012 7:12 pm
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.