Skip to content

[F4] I2C broken since last STM32F4 HAL update #463

Closed
@charlie1024

Description

@charlie1024

[Edit: transferred from stm32duino/STM32RTC]

Hello,
I recently seen the board library was updated some days ago and the HAL feature was newly implemented.
I thought that with the new master branch board platform the new library will work, so with my Nucleo-F411RE I tried to operate the new library.

It worked without I2C. I use D14/D15(I2C1) and if I connect any I2C device, then the MCU goes to forever sleep(all codes are stopped).

This code shows:

#include <Wire.h>
#include <STM32RTC.h>
STM32RTC& rtc = STM32RTC::getInstance();

void setup() {
  // put your setup code here, to run once:
  rtc.setClockSource(STM32RTC::LSE_CLOCK);
  rtc.begin(false); // initialize RTC 24H format

  if (!rtc.isTimeSet()) {
    rtc.setTime(0, 0, 0);
    rtc.setDate(1, 1, 19); // fallback
  }
  pinMode(LED_BUILTIN, OUTPUT);

  Wire.begin();

  Wire.beginTransmission(0x50);
  Wire.write(0);
  Wire.endTransmission();
}

void loop() {
  // put your main code here, to run repeatedly:
  delay(500);
  digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
}

0x50 means the EEPROM device and I just wrote a waste data to the line, so there must be no problem.
However If I use this code with any I2C device connected, F411RE just halts and not respond for anything(interrupts are all stopped too).

Couldn't be the new library used yet? Or is this a bug?

Thank you.

Metadata

Metadata

Assignees

Labels

bug 🐛Something isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions