Closed jafal99 closed 3 years ago
Thanks! I've made this into a PR on your behalf.
I see that we have a separate EEPROM implementation for BL24Cxx that accounts for the address different, so maybe that can be unified with this more general i2c-based EEPROM code at some point in the future.
I did quick look on BL24CXX:
Wire
instance for first I2C (on pins PB6,7) and most libraries uses this global instance. To use the second I2C new instance must be created by calling TwoWire Wire2(2);
and then use Wire2 instead of Wire in code. According to pins on CREALITY boards BL24CXX EEPROM connected to PA11,12 not to hardware SPI. Maple core also provides SoftWire
- software implementation for I2C on any pins. This can be used instead of implementation in this BL24CXX lib. The questions are:
The possibility of specifying which I2C controller (harware1,hardware1alt,hardware2, software) shall be used can be useful in general, not only for Ender. To use second controller I need to alter core library
Apparently this change breaks EEPROM functionality for many boards. I will revert the changes from #21337 until we can figure out where the error lies.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Description
Current HAL code has support I2C EEPROM but if connected chip has size less then 32Kb (4KB) it can't be accessed. This is due the fact that smaller chips use only one byte addressing. I have prepared small fix for HAL code to allow using small and large I2C EEPROMs. Detection rely on MARLIN_EEPROM_SIZE
Patch
small_i2c_eeprom.zip