Hi,
Barthess condensed his suggestions regarding I2C in this article: m
Also try setting I2C IRQ priority to 3 and see if it makes a difference.
Giovanni
I got it working now, and the root cause was that I ignored PULL-UP resistor on SCL line cause I think PULL-UP resistor on SDA is enough. I ...
Search found 9 matches
- Thu Jul 06, 2017 6:30 pm
- Forum: STM32 Support
- Topic: I2C No ack error
- Replies: 17
- Views: 13299
- Thu Jul 06, 2017 2:56 pm
- Forum: STM32 Support
- Topic: I2C No ack error
- Replies: 17
- Views: 13299
Re: I2C No ack error
Giovanni wrote:If the driver is locked you need restart it. See the driver state machine here: http://chibios.sourceforge.net/docs3/ha ... _i2_c.html
Giovanni
Thanks, do you have any idea why I2C doesn't work with 24LC512 EEPROM? I'm looking at https://github.com/barthess/24aa I think it works the same way?
- Thu Jul 06, 2017 9:47 am
- Forum: STM32 Support
- Topic: I2C No ack error
- Replies: 17
- Views: 13299
Re: I2C No ack error
It sounds as if your EEPROM isn't responding - when that happens the I2C (intentionally) locks up in a 'not ready' state, and you have to reset it as you have done.
ChibiOS expects a 7-bit I2C address - the 'Slave Address' field in your diagram (other people use 8-bit, with bit 0 set to zero). So ...
ChibiOS expects a 7-bit I2C address - the 'Slave Address' field in your diagram (other people use 8-bit, with bit 0 set to zero). So ...
- Thu Jul 06, 2017 5:26 am
- Forum: STM32 Support
- Topic: I2C No ack error
- Replies: 17
- Views: 13299
Re: I2C No ack error
I got it working with following modification:
// main function
...
palSetPadMode(GPIOB, 6, PAL_MODE_STM32_ALTERNATE_OPENDRAIN); /* SCL */
palSetPadMode(GPIOB, 7, PAL_MODE_STM32_ALTERNATE_OPENDRAIN); /* SDA */
i2cStart(&I2CD1, &i2cfg1);
chThdCreateStatic(waEEPROM, sizeof(waEEPROM ...
// main function
...
palSetPadMode(GPIOB, 6, PAL_MODE_STM32_ALTERNATE_OPENDRAIN); /* SCL */
palSetPadMode(GPIOB, 7, PAL_MODE_STM32_ALTERNATE_OPENDRAIN); /* SDA */
i2cStart(&I2CD1, &i2cfg1);
chThdCreateStatic(waEEPROM, sizeof(waEEPROM ...
- Thu Jul 06, 2017 1:21 am
- Forum: STM32 Support
- Topic: I2C No ack error
- Replies: 17
- Views: 13299
Re: I2C No ack error
On a quick look, the code looks sensible (and, yes, strip the code down to the minimum which shows the problem).
Two hardware things to check:
1. Do you have pullups on the I2C lines? (Typically in the region of 2K2 to 4K7; higher should work if lines are short and speed is low)
2. Are other pins ...
Two hardware things to check:
1. Do you have pullups on the I2C lines? (Typically in the region of 2K2 to 4K7; higher should work if lines are short and speed is low)
2. Are other pins ...
- Thu Jul 06, 2017 1:15 am
- Forum: STM32 Support
- Topic: I2C No ack error
- Replies: 17
- Views: 13299
Re: I2C No ack error
Giovanni wrote:Hi,
The reason is "not ready" meaning that the driver is not in the ready state, what is the state when the problem occurs?
Giovanni
I printed out I2CD1.state and it says state 5. I guess it's I2C_LOCKED = 5 /**> Bus or driver locked. */.
- Wed Jul 05, 2017 5:01 pm
- Forum: STM32 Support
- Topic: I2C No ack error
- Replies: 17
- Views: 13299
Re: I2C No ack error
Hi,
I faced a problem in reading EEPROM 24LC512 using I2C STM32F103C8T6. Whenever I tried to use i2cMasterTransmitTimeout() and it hang at ch.dbg.panic_msg = reason when I commented the function and it works fine. I tested EEPROM on Arduino and it works just fine so it's not EEPROM problem. Debug ...
I faced a problem in reading EEPROM 24LC512 using I2C STM32F103C8T6. Whenever I tried to use i2cMasterTransmitTimeout() and it hang at ch.dbg.panic_msg = reason when I commented the function and it works fine. I tested EEPROM on Arduino and it works just fine so it's not EEPROM problem. Debug ...
- Mon Jun 12, 2017 3:56 pm
- Forum: Development and Feedback
- Topic: The RTC driver topic
- Replies: 228
- Views: 143677
Re: The RTC driver topic
Giovanni wrote:hi,
It is probably because HSE is shut down, about LSI, I don't know if VBAT is required, it is possible if it is part of the backup domain.
Giovanni
I'll try with LSE tomorrow and will update here so others may aware of.
- Mon Jun 12, 2017 2:48 pm
- Forum: Development and Feedback
- Topic: The RTC driver topic
- Replies: 228
- Views: 143677
Re: The RTC driver topic
Hi all, i'm a newbie to ChibiOS and thanks @Giovanni for releasing ChibiOS to the world
I'm not sure it's a bug or not but RTC wakeup from Power-Down Deep-Sleep mode on my STM32F103C8T6 only works if STM32_RTCSEL is set to STM32_RTCSEL_LSI (LSE is broken so I haven't gotten a chance to test out ...
I'm not sure it's a bug or not but RTC wakeup from Power-Down Deep-Sleep mode on my STM32F103C8T6 only works if STM32_RTCSEL is set to STM32_RTCSEL_LSI (LSE is broken so I haven't gotten a chance to test out ...