Easily STM32F407 Discovery Programming with Mbed

STM32F407 Discovery board does not directly support STM32F407 discovery board MBED online STM32F407 discovery board IDE, but the mcu on STM32F407 discovery board is also used in another official MBED board (Seeed Studio Arch Max v1.1 ). Therefore, you can do STM32F407 discovery programming by treating it as an Arch Max board.

It is an easy way to do quick prototyping with STM32F407 discovery board MBED ‘s online IDE, no need to install STM32F407 discovery Keil/IAR/AC6 on PC and go through painful setup, common stuff like STM32F407 discovery board ADC/STM32F407 discovery board PWM/DAC/STM32F407 discovery pinout GPIO/STM32F407 discovery board UART/SPI/STM32F407 discovery I2C can be done with minimal configuration, also tested STM32F407 discovery kit onboard STM32F407 discovery board accelerometer.

STM32F407 Discovery
  • The attached code below demonstrates all of these functions.

Step 1: Go to mbed.org and log in/register

STM32F407 discovery board mbed website

Step 2: Select Platform Seeed Arch Max

Step 3: Edit, compile and download the code

The following code demonstrates the STM32F407 discovery pinout GPIO, STM32F407 discovery board ADC, serial, STM32F407 discovery PWM and on-board STM32F407 discovery board accelerometer functions

library:

#include “mbed.h”

#include “LIS3DSH.h“

STM32F407 discovery board pinout GPIO and STM32F407 discovery PWM initialization:

DigitalOut rLED(PD_14);   // on board red LED, DO

DigitalOut bLED(PD_15);   // on board blue LED. DO

DigitalOut gLED(PD_12);   // on board green LED, DO

DigitalOut oLED(PD_13);   // on board orange LED, DO

PwmOut GLED(PA_9);        // on board green LED,

PWMDigitalIn  pbSW(PA_0);    // on board blue PUSH Switch, active high DI

Serial port and STM32F407 discovery board ADC:

Serial serial(PA_2,PA_3); // serial com tx, rx UART

AnalogIn   adcPB0(PB_0);  // PB0 as 12 bit ADC

Serial baud rate and print:

// set serial baud and print welcome msg //   

serial.baud(19200);   

serial.printf(“Welcome to STM32F407 Development with mbedOS \n\r”);

STM32F407 discovery PWM frequency and duty cycle:

GLED.period(1.0f/freq);  // set pwm period

GLED.write(duty/100.0f); // set pwm duty cycle

STM32F407 discovery board LED blink:

rLED = 1;

gLED = 1;

wait(delay);

rLED = 0;

gLED = 0;

wait(delay);

STM32F407 discovery board ADC reads:

// adc value read // adcval = 4095*adcPB0.read_u16()/65535; // 12 bit value

  • Pins shared with STM32F407 discovery  onboard hardware

It is not recommended to use “unlabeled” pins, they may interfere with STM32F407 discovery onboard hardware.

STM32F407 discovery board pinout

Update 1: The DAC is available for PA4 and PA5.

A 12-bit DAC was tested on pins A4 and A5. it works. However, the STM32F407 discovery board accelerometer and audio may not be used with the DAC for other applications (same pins).

DAC settings:

// Before main

AnalogOut dac1(PA_5);

AnalogOut dac2(PA_4);

Output analog voltage:

// set up 1 volt on dac 1

dac1 = 0.333f; // vdd* 0.333 = 3.0*0.333 =  1.0 volt

// set up 1.5 volt on dac 2

dac2 = 0.5f; // vdd*0.5 = 1.5 volt

Update 2: 20×4 STM32F407 discovery LCD support

Tested the STM32F407 discovery LCD with STM32F407 discovery board mbed and it works great! A 5 volt display will have no problem running on 3.3 volt logic.

  • Precautions

1. Not all functions will work according to the STM32F407 discovery board pinout diagram above. For example, STM32F407 discovery PWM on PD13 will not work when programming with mbed. Because, the mbed compiler processes the code according to the pin map of the Arch Max board.

For pin-specific functions that will definitely work, see the attached pinout diagram below.

ArchMax equivalent pins for STM32F407 Discovery board
  • STM32F407 discovery board buy

There are a lot of STM32F407 discovery boards on the market, if you do STM32F407 discovery board buy online, you can find a lot of information about STM32F407 discovery board amazon, STM32F407 discovery studio, of course their STM32F407 discovery price are also varied. This brings great difficulty to your purchase. In view of the important role of the development board, we recommend that you choose a professional supplier.

Our STM32F407 discovery board from ST is sold overseas like STM32F407 discovery board India, STM32F407 discovery board Pakistan, with rich and complete information, such as STM32F407 discovery datasheet pdf, STM32F407 discovery board bootloader, STM32F407 discovery user manual, STM32F407 discovery board projects, STM32F407 discovery board examples, STM32F407 discovery board tutorial, etc., can help your STM32F407 discovery board getting started easily.

You can click STM32F407 discovery board to view more information, such as STM32F407 discovery kit datasheet , STM32F407 discovery kit schematic, STM32F407 discovery board projects, STM32F407 discovery board examples, etc. You can also contact us directly to obtain detailed information like STM32F407 discovery board pdf pictures, STM32F407 discovery datasheet, and do more exactly communication with us. We will provide you with a reliable STM32F407 discovery kit price, after you do STM32F407 discovery board buy, we will organize complete discovery board documents for you, include STM32F407 discovery board schematic pdf, STM32F407 discovery board manual , and more detailed STM32F407 discovery board examples and so on, and we will provide you with quality service.

In addition, we also have other types of discovery boards, such as STM32 development board series, ESP32 development board series, , 8051 development board, Raspberry Pi development board, etc., which can meet the needs of users with different technical levels and different requirements. You can click on our homepage to view. looking forward to your consultation.

Similar Posts