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

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

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: 7680
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: 2048
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany
Contact:

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: 7680
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: 2048
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany
Contact:

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 22 times

User avatar
RogerClark
Posts: 7680
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: 7680
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

michael_l
Posts: 364
Joined: Mon Aug 24, 2015 6:11 pm

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

Post by michael_l » Sun Jan 21, 2018 4:30 pm

Is this the correct place to report errors with Steve's repo?

I just downloaded Steve's libmaple master branch and tried simple led blink sketch with F407VE mini board. Didn't work so tried debugging with the new Atollic IDE and here's the result:
bug.PNG
bug.PNG (22.68 KiB) Viewed 59 times
Here's the sketch:

Code: Select all

void setup() {
     

  pinMode(LED_BUILTIN, OUTPUT);


}

// the loop function runs over and over again forever
void loop() {
    
  while(true) {
    
    digitalWrite(LED_BUILTIN, LOW);   // Turn the LED on (Note that LOW is the voltage level
    delay(300);                      // Wait for a second
    digitalWrite(LED_BUILTIN, HIGH);   // Turn the LED on (Note that LOW is the voltage level
    delay(300);                      // Wait for a second
  }
}

User avatar
Manny
Posts: 72
Joined: Wed Dec 09, 2015 3:15 pm

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

Post by Manny » Sun Jan 21, 2018 7:46 pm

michael_l wrote:
Sun Jan 21, 2018 4:30 pm
Is this the correct place to report errors with Steve's repo?

I just downloaded Steve's libmaple master branch and tried simple led blink sketch with F407VE mini board. Didn't work so tried debugging with the new Atollic IDE and here's the result:
Got blink to work but not serial USB...did you chose the the right board?

michael_l
Posts: 364
Joined: Mon Aug 24, 2015 6:11 pm

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

Post by michael_l » Sun Jan 21, 2018 7:52 pm

Manny wrote:
Sun Jan 21, 2018 7:46 pm
michael_l wrote:
Sun Jan 21, 2018 4:30 pm
Is this the correct place to report errors with Steve's repo?

I just downloaded Steve's libmaple master branch and tried simple led blink sketch with F407VE mini board. Didn't work so tried debugging with the new Atollic IDE and here's the result:
Got blink to work but not serial USB...did you chose the the right board?
Yes, I chose the right board (mini) and serial USB from the Arduino menu. The wiki suggests to check pull-up for the usb pin if it doesn't enumerate. As we know It should be 1.5k. Have to check that next I guess.

Post Reply