I2C Feature Request: Please don't hardcode OwnAddress.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2021-02-16 7:00 PM
Hi All,
In a hardware architecture where there are multiple I2C slaves running the same code base, each slave must determine their own address. The code generated by Stm32Cube hard codes the OwnAddress so it is impossible to insert a unique address in its place. There are two undesirable workarounds the programmer can use:
- Replace the Stm32Cube initialisation MX_I2C1_Init() function with their own (risks missing out of future changes to MX_I2C1_Init()
- HAL De-Init I2C, insert the new unique address into structure and re-initialise using HAL Init that has the updated address. (can still use cube but Nasty).
I propose there is a new HAL function to set OwnAddress that can be called sometime after the MX_I2C1_Init(). The programmer can then set their unique address at run-time.
What do you think?
Cheers
David
Labels:
- Labels:
-
I2C
-
STM32Cube MCU Packages
-
STM32CubeMX
This discussion is locked. Please start a new topic to ask your question.
0 REPLIES 0
