[libmaple] Generic F407VE mini (vcc-gnd version)

Limited support for STM32F4 Discovery, Nucleo and custom F4 boards
stevestrong
Posts: 1829
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: [libmaple] Generic F407VE mini (vcc-gnd version)

Post by stevestrong » Sun Nov 19, 2017 9:43 am

Well, I don't know whether the official ST core has support for this board, this has 25MHz crystal.
I only found the Disco 407G the closest target supported.

EDIT
I checked the I2C part of ST official core , it does exactly the same as I do in the init phase.
Hmm.
It is really strange that the pins go low at once when I set the mode to GPIO_AF_OUTPUT_OD, and BUSY gets set.
Although I enable the I2C clock after the GPIOs are initialized, as recommended here: https://community.st.com/thread/43558-i ... ent-168570

User avatar
RogerClark
Posts: 7485
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: [libmaple] Generic F407VE mini (vcc-gnd version)

Post by RogerClark » Sun Nov 19, 2017 7:17 pm

ummm

Sounds like a question for one of STMs own forums :-(

stevestrong
Posts: 1829
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: [libmaple] Generic F407VE mini (vcc-gnd version)

Post by stevestrong » Sun Nov 19, 2017 11:37 pm

OK, so it seems that it was me (as always :? )
I forgot to set the AF mode register correspondingly.
Funny, as soon as I set it right, it started to work... :mrgreen:

User avatar
RogerClark
Posts: 7485
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: [libmaple] Generic F407VE mini (vcc-gnd version)

Post by RogerClark » Mon Nov 20, 2017 12:24 am

(LOL)

Such is programming

stevestrong
Posts: 1829
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: [libmaple] Generic F407VE mini (vcc-gnd version)

Post by stevestrong » Mon Nov 20, 2017 10:08 pm

I finally managed to bring Wire lib on F4 mini to work, the new files are checked in with this commit: https://github.com/stevstrong/Arduino_S ... 8d427d03f2
(Roger, don't ask me to prepare a PR, because I know now that I am not able to make a clean PR... :( .
Hopefully you can merge the files from the patch.)
The i2c.cpp and header files had to be amended, too.
I introduced a new parameter for Softwire: SOFT_HSPEED, which generates ~1MHz clock.

Additionally, I moved the "digitalPinTo..(pin)" defines from variant header files to gpio.h, because they are common for all variants.

EDIT
All (scanning) examples were tested and they work.
I attach an example file to handle the on-board Eeprom.
Attachments
STM32F4_Eeprom_example.ino
(3.53 KiB) Downloaded 11 times

User avatar
RogerClark
Posts: 7485
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: [libmaple] Generic F407VE mini (vcc-gnd version)

Post by RogerClark » Mon Nov 20, 2017 10:18 pm

stevestrong wrote:
Mon Nov 20, 2017 10:08 pm
I finally managed to bring Wire lib on F4 to work, the new files are checked in with this commit: https://github.com/stevstrong/Arduino_S ... 8d427d03f2
(Roger, don't ask me to prepare a PR, because I know now that I am not able to make a clean PR... :( .
Hopefully you can merge the files from the patch.)
The i2c.cpp and header files had to be amended, too.
I introduced a new parameter for Softwire: SOFT_HSPEED, which generates ~1MHz clock.

Additionally, I moved the "digitalPinTo..(pin)" defines from variant header files to gpio.h, because they are common for all variants.
Thanks Steve

OK.

I'll try to manually merge this when I get time.

User avatar
RogerClark
Posts: 7485
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: [libmaple] Generic F407VE mini (vcc-gnd version)

Post by RogerClark » Mon Nov 20, 2017 10:20 pm

Steve

Actually, if there is anything that needs to be manually merged, can you just raise and issue so I don't forget

I just raised and issue for this change

Post Reply