We have working code for I2C communication which as default runs at the I2C clock speed of 100kHz. We want to be able to run at 40kHz, but if we try and use the setClock() function with 40000 it compiles, downloads then the H7 goes into SOS mode, which we have to then double click the reset button to get back from.
The libray documentation doesn’t seem to rule out any particular clock speeds and actually mentions 10kHz, but even this value results in the same SOS issue.
If we compile and run on an UNO, 40kHz works absolutely fine.
Is anyone aware of a way around this or is it a limitation of the Portenta H7? Considering the Portenta models are aimed at the professional market it seems a shame that an UNO can do something it can’t.
Unfortunately, it's a limitation of the underlying mbed-os code for the STM32 chip. Only 100000, 400000 and 1000000 are supported. Line 725 will throw an exception for any other value. Given the end-of-life status, this is unlikely to change.
It's ARM's mbed-os that's going EOL. It underpins a few Arduino boards (inc. the Portenta). Arduino have there own fork of the mbed-os repo that they will continue to patch as necessary, but new features/improvements are unlikely. Arduino are currently working on a transition to another RTOS, Zephyr.