Spark Logic

[libmaple] Black F407VET6

stevestrong Wed Apr 12, 2017 4:37 pm

The master branch of my repo contains the latest developments for F4, so I recommend to use this if somebody wants to test it with Arduino IDE or PlatformIO.
Supported board variants: generic F4 (tested), generic F4 mini (tested), disco F407 (compiles but not tested).

Some basic information about the board can be found on wiki: http://wiki.stm32duino.com/index.php?title=STM32F407

Currently working:
– GPIOs + LED toggle
– USB serial and serial 1,2,3. Evaluated USB serial speed, Tx: ~800kBps
– SPI (1,2,3) with DMA (also for SD cards using latest SdFat lib made by Greiman), extended DMA functions
– FSMC (adapted for driving 16 bit parallel LCDs) http://stm32duino.com/viewtopic.php?f=39&t=2298#p31037
– SDIO [non-HAL implementation] (for SD cards using latest SdFat lib made by Greiman) http://stm32duino.com/viewtopic.php?f=39&t=2215
– RTC – reworked, does not need any extra time library
– I2C (Wire) viewtopic.php?f=39&t=2804&p=37376#p37376
– supports W5500-based Ethernet modules (see viewtopic.php?f=13&t=503&p=32063#p32063)
– DAC, see viewtopic.php?f=39&t=1976&p=41564#p41564
– ADC, see http://stm32duino.com/viewtopic.php?f=3 … 720#p42720
– DCMI, see viewtopic.php?f=39&t=3414&p=43358#p43358
– CAN, see: http://stm32duino.com/viewtopic.php?f=3 … 239#p49235

Todo:
– port the new (faster) version of SDIO from Victor (https://github.com/rogerclarkmelbourne/ … 2/pull/474)
– check the on-board W25Q64 SPI flash, maybe add SPIflash lib to repo (where from?) https://github.com/LowPowerLab/SPIFlash
– check/add FPU (http://stm32duino.com/viewtopic.php?f=39&t=2001, http://stm32duino.com/viewtopic.php?f=3 … 048#p31040)
– add support for Seed Arch Max board
– add Ethernet lib (usable with Seeed Arch Max board)

EDIT – 2018.10.02
– added extended SPI DMA functions, see: viewtopic.php?f=15&t=3415

EDIT – 2018.09.12
– working CAN, see: http://stm32duino.com/viewtopic.php?f=3 … 239#p49235 (thanks to @michael_i!)

EDIT – 2018.03.19
– tested ADC, see: http://stm32duino.com/viewtopic.php?f=3 … 720#p42720

EDIT – 2018.02.18
– tested DAC, see: viewtopic.php?f=39&t=1976&p=41564#p41564

EDIT – 2018.01.16
– Added I2C (Wire), see: viewtopic.php?f=39&t=2804&p=37376#p37376

EDIT – 2017.07.10
– RTC lib reworked to be independent from other time libraries. Includes an example sketch to read and set the RTC time, as well as how to use the time elements.
It can be downloaded from here: viewtopic.php?f=39&t=775&p=31218#p31218

EDIT – 2017.06.18
– Implemented SDIO [non-HAL implementation] (for SD cards using latest SdFat lib made by Greiman)
viewtopic.php?f=39&t=2215

EDIT – 2017.06.02

Upload under windows currently only possible with STLink (V2).
When BOOT0=”1″(3.3V) and BOOT1=”0″(GND), the chip is recognized by Win10 as ‘STM Device in DFU mode’ (USB\VID_0483&PID_DF11).
However, there is no working DFU loader for Windows available, yet.

Comments & suggestions are welcome in this thread.
Any bug reports & PRs in Github, please.

————————————————————————————-
Hi all,

I know there is another thread on vet6 & zet6 boards, but there are at least 2 type of boards mixed, with partially different information.
And there is a lot of other information spread over other threads, like this generic implementation from danieleff.
Wiki has some basic stuff, too (thanks, Palmer!).

So, I got my black board today and I though it makes sense to open a separate thread only for the black VET6 board. The title can be edited later if needed, and the useful and tested information can (should) be added to wiki.

First of all, this is the current situation:
Both LEDs blink, but the USB device descriptor failed (VID 0x000 PID 0x0002).
On the serial port (115200Baud, 8N1) I receive after each reset: “LCD ID:ffff”
I can connect with the ST-Link probe, and I could read out the flash (I can attach here or to wiki if wanted). I assume writing would be also possible.

Now would like to start with the sw development.
The question is: how?

I know, there are a lot of alternative options (the official STM32 core, Start Otto github, Koduino, and so on).
But honestly, I like very much the existing Arduino_STM32 repo and I would like to use this for my future work.
I also know, it will be a hard way to go. But I think, with small steps I (we?) can achieve great results.

So, will the Arduino_STM32 provide the basic structure and functionality for a blinky example?
If anyone tried that already and had success, I would appreciate a short description of what and how to do.

For the beginning I intend to use the STlink upload method as the USB DFU seems not (yet?) to work.
Is there any working bootloader available for this board?

Replies

acronis Tue Jul 11, 2017 8:26 am

Tell me, please, whether in the library, bus І2С ?

stevestrong Tue Jul 11, 2017 8:31 am

[acronis – Tue Jul 11, 2017 7:14 am] –
rtc.getTime(tm);
hh = tm.hour();

This way you get the time elements as variables in the tm structure.
As alternatives you can use:
rtc.getTime(tm);
hh = tm.hour;
// or
hh = rtc.hour(); // pay attention to the object "rtc" instead structure "tm"

acronis Tue Jul 11, 2017 8:34 am

Well !

Thank You very much ! My project perfectly works thanks to You !!!
It remains only to wait for the implementation of I2C

acronis Wed Jul 12, 2017 9:20 am

Hello.
Prompt, please, can I use FreeRTOS 9.0.0 with Your library ?

stevestrong Wed Jul 12, 2017 9:28 am

[acronis – Wed Jul 12, 2017 9:20 am] –
Hello.
Prompt, please, can I use FreeRTOS 9.0.0 with Your library ?

I don’t know, I have never used, nor tested it.
You can try it, but I cannot give you support of any kind in this case.

acronis Wed Jul 12, 2017 9:30 am

Well.
I’ll try and write here.

stevestrong Wed Jul 19, 2017 8:21 am

We can discuss about it if you find a library for that module.
If the module uses SPI, it should run out of the box.

I just realized it uses normal serial Rx/Tx. So it should work with one of the serial interfaces.
https://github.com/garfield38/RDM6300/t … er/arduino

acronis Wed Jul 19, 2017 8:40 am

This library uses #include <SoftwareSerial.h>.
SoftwareSerial only works on a STM32f103.
STM32F407VET6 on SoftwareSerial gives error.

stevestrong Wed Jul 19, 2017 8:44 am

Just comment out the line “//#include <SoftwareSerial.h>”.
Use Serial1, 2 or 3 in the code.
You could insert:
#define SoftwareSerial Serial1 // or Serial2, or Serial3

acronis Wed Jul 19, 2017 9:04 am

Where to read which pins correspond to Serial1 ?

acronis Wed Jul 19, 2017 9:12 am

PB7 – RX1
PB6 – TX1

Ok ?

acronis Thu Jul 20, 2017 4:58 am

Serial1 – RX pin PA10

Thank you very much !
It worked through physical serial port (serial1) !

acronis Fri Jul 21, 2017 4:22 am

Hello stevestrong.

Tell me how your business integration W5500 library ?
As soon as you can try out ?

acronis Sat Oct 14, 2017 9:36 pm

Hello Steven.

Doing a project in which I need a fast ADC.
Took example code https://github.com/arpruss/stm32scope-e … /scope.ino .

It is compiled on the Board STM32F1* great.

But the Board STM32F407VET6 error

error: cannot convert 'const adc_dev' to 'const adc_dev*' for argument '1' to 'void adc_set_sample_rate(const adc_dev*, adc_smp_rate)'

adc_set_sample_rate(ADC1, ADC_SMPR_1_5); // ADC_SMPR_13_5, ADC_SMPR_1_5

stevestrong Sun Oct 15, 2017 8:31 am

I think for F4 you have to use:
adc_set_sample_rate(&ADC1, ADC_SMPR_1_5);

acronis Sun Oct 15, 2017 12:43 pm

Steven Thank you.

This error is gone , but there were other

dc_read:412: error: base operand of ‘->’ has non-pointer type ‘const adc_dev’

on line

dataPoints[j+1] = ADC2->regs->DR & ADC_DR_DATA;

void fetch() {

// const adc_dev *dev = PIN_MAP[analogInPin].adc_device;

int channel = PIN_MAP[analogInPin].adc_channel;

adc_set_sample_rate(&ADC1, ADC_SMPR_1_5); // ADC_SMPR_13_5, ADC_SMPR_1_5

adc_set_sample_rate(&ADC2, ADC_SMPR_1_5); // ADC_SMPR_13_5, ADC_SMPR_1_5

adc_set_reg_seqlen(&ADC1, 1);

adc_set_reg_seqlen(&ADC2, 1);

ADC1->regs->SQR3 = channel;

ADC2->regs->SQR3 = channel;

ADC1->regs->CR1 |= 0x70000; // ADC_CR1_FASTINT;

ADC1->regs->CR2 |= ADC_CR2_CONT | ADC_CR2_SWSTART;

ADC2->regs->CR2 |= ADC_CR2_CONT | ADC_CR2_SWSTART;

ADC2->regs->CR1 |= 0x70000; // ADC_CR1_FASTINT;

nvic_globalirq_disable();

// uint32_t t = micros();

// .584 uS

for (int j = 0; j < maxSamples ; j+=2 )

{

while (!(ADC1->regs->SR & ADC_SR_EOC))

;

dataPoints[j] = ADC1->regs->DR & ADC_DR_DATA;

while (!(ADC2->regs->SR & ADC_SR_EOC))

;

dataPoints[j+1] = ADC2->regs->DR & ADC_DR_DATA;

}

nvic_globalirq_enable();
}

Sign in to reply