Skip to main content
Associate II
March 9, 2024
Question

HAL i2c 0x78 problem

  • March 9, 2024
  • 1 reply
  • 2176 views

iam using nucleo f446re for reading from and writing to i2c eeprom 
on arduino i used to extrat the 7bit address from the 10 bit 
using this core for that 

void writeLexChip(uint16_t TenBits_slave_address, uint8_t firstRegisterByte, uint8_t secondRegisterByte, uint8_t thirdRegisterByte, uint8_t *contentBuffer, uint16_t writeSize) {
ChipOn();
uint16_t slave_address_LSB = TenBits_slave_address & 0x0FF;
uint16_t slave_address_MSB = TenBits_slave_address & 0x300;
slave_address_MSB = slave_address_MSB >> 8;
uint8_t SevenBits_compat_address = 0x78 | slave_address_MSB;
contentBuffer[0] = slave_address_LSB;
contentBuffer[1] = firstRegisterByte;
contentBuffer[2] = secondRegisterByte;
contentBuffer[3] = thirdRegisterByte;
Wire.beginTransmission(SevenBits_compat_address);
Wire.write(contentBuffer, 4 + writeSize);
Wire.endTransmission(true);
Serial.println(F("Write OK"));
ChipOff();
}

on stm32 cube ide i worked for many many weeks for even show the i2c address on any i2c scanner source on internet 
or try to make one 
try to use for (i=o i<127; i++)
time 127 and time 177 like some arduino codes 
the nucleo f446re totally refuse to show 0x78 address while it is so easy to do that using eso8266 or arduino uno or nano or any other trademark 
i used HAL isdevice ready 
mem read
i2c master recive 
with all possible ways 
like using software i2c on arduino with this board 
using internal pullups or external
and then i found that this address is reserved for RTC BKP register 10 in the stm32fxx.h file 
can i avoid that or change the reserved address in the source 
can any one help me please 

 

This topic has been closed for replies.

1 reply

TDK
Super User
March 10, 2024

> iam using nucleo f446re for reading from and writing to i2c eeprom 

What EEPROM are you using? How is it hooked up to the Nucleo board, specifically? What pins, are external pullups present? Do SDA/SCL lines read 3.3V when probed with a multimeter?

Once hooked up, create a CubeMX project, initialize the I2C peripheral and pins you are using and write a program which uses HAL_I2C_IsDeviceReady to look for the device. Show the code you are using. Do you get HAL_OK back?

 

> try to use for (i=o i<127; i++)

It does no good to post rubbish code like this. Show the actual code you are using.

"If you feel a post has answered your question, please click ""Accept as Solution""."
adelsaeedAuthor
Associate II
March 11, 2024

uint32_t RESERVED6[2];  /*!< Reserved, 0x78-0x7C
__IO uint32_t BKP10R;     /*!< RTC backup register 10, Address offset: 0x78 */

stm32f412rx.h

i found the 0x78 address is used for the RTC in the bkp register 10 as reserved address and i need to use it for my i2c eeprom 
and my i2c eeprom 
working with this address 
and i provided the arduino code i used to use it for my eeprom 
and its working very good 
how does agood microprocessor like nucleo f446re cannot handle such process 





TDK
Super User
March 11, 2024

> how does agood microprocessor like nucleo f446re cannot handle such process 

well that's easy, bad coding

 

I'm not following your logic at all. You're using an STM32F446RE chip, and you're using an STM32F412 as the EEPROM? And you think a register in the RTC is the slave address of that chip? It just doesn't make any logical sense. A STM32F412 will not act as an I2C device unless its firmware is coded to do that.

After re-reading, maybe you're not using the F412 at all, but then why are we talking about it? I asked which EEPROM chip you're using and your answer only mentions the F412 chip.

 

Showing arduino can't explain why you're HAL code (unshown) will not work.

 

I feel like I'm not being very useful here, but perhaps if you run through exactly what you're doing, with code, I could provide more assistance. If you just want to complain about why things won't work, you can do that here, but you probably won't get to the root of the issue either. And if you just want to complain, that's fine too. Cheers.

"If you feel a post has answered your question, please click ""Accept as Solution""."