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

Limited support for STM32F4 Discovery, Nucleo and custom F4 boards
User avatar
Manny
Posts: 73
Joined: Wed Dec 09, 2015 3:15 pm

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

Post by Manny » Tue Jan 23, 2018 8:33 pm

stevestrong wrote:
Tue Jan 23, 2018 9:59 am
My repo should be functional again.
I had no time yet to test SDIO, but the rest of peripherals should work ok.
Thanks for that . I'm still not getting any output using serial USB.

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

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

Post by stevestrong » Wed Jan 24, 2018 12:10 am

I just updated again my repo master branch, deleted all local files, cloned everything new from Github, compiled and I had working USB serial.

This is my blinky sketch:

Code: Select all

#include <Arduino.h>

#define BOARD_LED2_PIN          PA7 // on black F4

uint16_t counter;

// the setup function runs once when you press reset or power the board
void setup()
{
  Serial.begin(115200);
  while (!Serial);
  delay(1000);
  Serial.println("STM32F4 blinky...");

  pinMode(LED_BUILTIN, OUTPUT);
  pinMode(BOARD_LED2_PIN, OUTPUT);
  counter = 0;
}

// the loop function runs over and over again forever
void loop() {
  Serial.println(counter);
  digitalWrite(LED_BUILTIN, LOW);
  digitalWrite(BOARD_LED2_PIN, HIGH);
  delay(250);              // wait for a second
  digitalWrite(LED_BUILTIN, HIGH);
  digitalWrite(BOARD_LED2_PIN, LOW);
  delay(250);              // wait for a second
  counter ++;
}
I recommend you to first delete all local files before you download and extract files from the new ZIP of my repo.

Does you PC recognizes the USB as COM port? If not, you maybe need to install the official ST drivers.

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

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

Post by michael_l » Wed Jan 24, 2018 5:30 am

Thanks for the update. USB serial is working for me with your latest update but . As for SDIO I suspect some problem on my board because I tried huaweiwx's stm32generic and yours and it does not work either way. PC card reader recognizes the cars successfully

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

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

Post by stevestrong » Wed Jan 24, 2018 2:24 pm

I admit, I tested the SDIO only with the black F4 board, but not with the (blue) F4 mini.
So it may happen that the hardware SDIO connection is different on this small board, I have to check that.

EDIT
I have checked the schematics, the only difference is that the mini F4 board has and additional line to pin 10 (!) marked as SW1 of the micro SD slot, connected to PA8.
Honestly, I don't know what exactly this pins is good for. Maybe detect whether a card has been pushed in the slot?

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

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

Post by michael_l » Wed Jan 24, 2018 7:17 pm

stevestrong wrote:
Wed Jan 24, 2018 2:24 pm
I admit, I tested the SDIO only with the black F4 board, but not with the (blue) F4 mini.
So it may happen that the hardware SDIO connection is different on this small board, I have to check that.

EDIT
I have checked the schematics, the only difference is that the mini F4 board has and additional line to pin 10 (!) marked as SW1 of the micro SD slot, connected to PA8.
Honestly, I don't know what exactly this pins is good for. Maybe detect whether a card has been pushed in the slot?
Bought a new card 4GB SDHC, inserted straight from the package with this message:

Code: Select all

SdFatSdio begin() failed
Invalid format, reformat SD.
I checked that it is FAT32. It should be supported, right? Any chance to set lower clock for SDIO for debugging purposes ?
Last edited by michael_l on Wed Jan 24, 2018 8:33 pm, edited 1 time in total.

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

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

Post by Manny » Wed Jan 24, 2018 8:21 pm

stevestrong wrote:
Wed Jan 24, 2018 12:10 am
I just updated again my repo master branch, deleted all local files, cloned everything new from Github, compiled and I had working USB serial.

I recommend you to first delete all local files before you download and extract files from the new ZIP of my repo.

Does you PC recognizes the USB as COM port? If not, you maybe need to install the official ST drivers.
Spot on ...Installed STM's virtual comport driver and now getting serial USB 8-) The few libraries with SPI like Adafruit_ILI9341_STM will not compile using the Blue mini board...I'll leave that for another day.

User avatar
Pito
Posts: 1738
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

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

Post by Pito » Wed Jan 24, 2018 9:34 pm

SW1 - Card Detect switch.
Pukao Hats Cleaning Services Ltd.

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

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

Post by stevestrong » Wed Jan 24, 2018 10:28 pm

SDIO test using my latest core + SdFat repo + example sketch, for a 2GB, class 4, cheap china card (not freshly formatted), file size 8MB:

Code: Select all

######################################################
  Demo sketch of STM32F4 SDIO (DMA) implementation.
######################################################

init time: 8 ms

Card type: SD2

Manufacturer ID: 27
OEM ID: PH
Product: SD02G
Version: 3.0
Serial number: 97bdbf7c
Manufacturing date: 8/2011

cardSize: 1969.23 MB (MB = 1,000,000 bytes)
flashEraseSize: 128 blocks
eraseSingleBlock: true
OCR: 80ff8000

Volume is FAT16
blocksPerCluster: 64
clusterCount: 60086
freeClusters: 59559
freeSpace: 1951.63 MB (MB = 1,000,000 bytes)
fatStartBlock: 138
fatCount: 2
blocksPerFat: 235
rootDirStart: 608
dataStartBlock: 640

FreeStack: 61415
######################################################

Type any character to start
Test started - please wait, it may take up to 3 minutes

size, write, read
bytes, KB/sec, KB/sec
512, 190.70, 869.03
1024, 361.40, 1059.98
2048, 660.10, 2102.07
4096, 1133.33, 4088.29
8192, 1559.48, 5832.81
16384, 2007.64, 7714.63
32768, 2215.97, 8030.57

totalMicros  129325797
yieldMicros  96894938
yieldCalls   87623
yieldMaxUsec 152016
kHzSdClk     24000
Done
And, btw, W5500 lib is also working, check the web client example.

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

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

Post by michael_l » Thu Jan 25, 2018 10:47 am

Thanks Steve for the updates. Finally my board detects SD card correctly !

All the time I had used SdFat repo from greiman and added the correct define. So I suspect something may have gone wrong there. Now I checked out your SdFat repo with latest STM32 code and *boom* it works. I'm smiling :)

Code: Select all

######################################################
  Demo sketch of STM32F4 SDIO (DMA) implementation.
######################################################

init time: 8 ms

Card type: SDHC

Manufacturer ID: 74
OEM ID: J`
Product: USD  
Version: 1.0
Serial number: ffed8041
Manufacturing date: 5/2010

cardSize: 4025.48 MB (MB = 1,000,000 bytes)
flashEraseSize: 128 blocks
eraseSingleBlock: true
OCR: c0ff8000

Volume is FAT32
blocksPerCluster: 64
clusterCount: 122592
freeClusters: 122591
freeSpace: 4017.06 MB (MB = 1,000,000 bytes)
fatStartBlock: 14468
fatCount: 2
blocksPerFat: 958
rootDirStart: 2
dataStartBlock: 16384

FreeStack: 61415
######################################################

Type any character to start
Test started - please wait, it may take up to 3 minutes

size, write, read
bytes, KB/sec, KB/sec
512, 186.33, 1288.61
1024, 366.88, 2439.33
2048, 753.58, 3998.89
4096, 1473.68, 6188.57
8192, 2750.75, 8051.64
16384, 4812.20, 9550.56
32768, 5132.90, 10442.53

totalMicros  107262334
yieldMicros  85513135
yieldCalls   114269
yieldMaxUsec 74701
kHzSdClk     24000
Done

Type any character to start


Post Reply