Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable STM32 extended I2c on many targets #118

Merged
merged 13 commits into from
Nov 6, 2018

Conversation

chris-durand
Copy link
Member

@chris-durand chris-durand commented Oct 31, 2018

This renames and enables the L4 I2C implementation for many more targets. A prescaler calculator is implemented based on ST's beautiful excel sheet with VBA macros. This calculator deliberately violates conditions stated in the reference manual to simply do what ST does (except that it does not use half-french class names).

CAUTION: This is work in progress and not ready. On my machine trying to compile the Nucleo L476 i2c example eats up all ram. ST's brute-force approach of trying to check all possible 16*255*255 combinations seems to be too much for GCC's constexpr evaluation logic. Any ideas?

@chris-durand chris-durand force-pushed the feature/stm32_i2c_extended branch 3 times, most recently from 48c92cd to b828c89 Compare November 2, 2018 01:35
@salkinium
Copy link
Member

Is the compile time still bad now with your improvements?

@chris-durand
Copy link
Member Author

Is the compile time still bad now with your improvements?

No, that is solved.

I compared the results of the calculator to CubeMX and it seemed to be correct. Sometimes the register values look vastly different but the timing will be nearly identical. In many cases there are a lot of near optimal solutions.

@salkinium
Copy link
Member

No, that is solved

Very nice!

Can you rebase on top of develop, I think you need the new STM32 CMSIS headers for the CI?

@chris-durand
Copy link
Member Author

The I2C driver now compiles successfully on all F0, F3, F7, L0, L4.

I would really appreciate it, if someone could test it on F0/F3/F7/L0 hardware

The remaining errors in the CI are unrelated problems with the ADC driver on L41x/42x targets.
@salkinium Would it be ok for you if I fix them in this PR?

@salkinium
Copy link
Member

Would it be ok for you if I fix them in this PR?

Absolutely fine with me.

I‘ll test some devices from my magic STM32 box and will post the results.

@salkinium
Copy link
Member

I tested the F3 disco accelerometer example with success, but since we don‘t have any off-the-shelf I2C examples for F0/F7, I didn‘t continue testing. Will do so tomorrow.

@salkinium salkinium changed the title [WIP] Enable STM32 extended I2c on many targets Enable STM32 extended I2c on many targets Nov 5, 2018
@salkinium
Copy link
Member

Works on F072 Discovery. Checking on F7 Disco next.

@salkinium
Copy link
Member

Working also on F7. I'm merging this once the CI passes.

Copy link
Member

@salkinium salkinium left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic work!

@salkinium salkinium merged commit 804516a into modm-io:develop Nov 6, 2018
@chris-durand
Copy link
Member Author

Thanks for testing!

@chris-durand chris-durand deleted the feature/stm32_i2c_extended branch November 6, 2018 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants