BLACKPILL custom target.

BLACKPILL custom target

Board pinout

When equipped with STM32F401CCU6:

Zoom in
https://os.mbed.com/media/uploads/hudakz/blackpill_f401cc.png

When equipped with STM32F411CEU6:

Zoom in
https://os.mbed.com/media/uploads/hudakz/blackpill-pinout.png

Advantages of the BLACKPILL custom target over the NUCLEO_F401RE/ NUCLEO_F411RE
  • The onboard external 25 MHz crystal is used as system clock source rather than the less precise internal 16 MHz RC oscillator.
  • The onboard LED works as LED1 in programs.
  • The onboard KEY on STM32F411CEU6 boards works as USER_BUTTON pin in programs.
  • You can use the USB peripheral in your programs and connect the board to the PC over the onboard USB connector. An example of using the USB peripheral as USBSerial (12 Mbit/s) is available here.
Building programs for the BLACKPILL custom target in Mbed Studio
  • Connect an STM32 ST-Link programmer to your BLACKPILL board and PC (see below for more details).
  • Create a new program in the Mbed Studio IDE.
  • Right-click on the program's root folder and in the popup window select Add library...
  • Open the drop-list and select default as Branch or tag and click on the Finish button.
  • Open the BLACKPILL_Custom_Target folder and according to you board drag&drop the TARGET_BLACKPILL_F401CC or the TARGET_BLACKPILL_F411CE folder and the custom_targets.json file one by one to the root folder of your program.
  • Delete the BLACKPILL_Custom_Target folder from your project. (Right-click and select delete).
  • Open the Target drop-list and click on the button with a "chip" icon on it (Manage custom targets) .
  • Open the USB device drop-list and select your STM32 ST-Link programmer.
  • Open the Build target drop-list and according to your board select BLACKPILL_F401CC or BLACKPILL_F411CE.
  • Click on the Save All button.
  • Build your program (click on hammer button).

For more info visit

Import programBlackpill_Hello

Using low cost Blackpill (STM32F411CEU6) boards with mbed.

TARGET_BLACKPILL_F401CC/TOOLCHAIN_ARM/stm32f401xc.sct

Committer:
hudakz
Date:
2022-03-30
Revision:
9:2f993be74e92
Parent:
7:3a74f7149fa4

File content as of revision 9:2f993be74e92:

#! armclang -E --target=arm-arm-none-eabi -x c -mcpu=cortex-m4
; Scatter-Loading Description File
;
; SPDX-License-Identifier: BSD-3-Clause
;******************************************************************************
;* @attention
;*
;* Copyright (c) 2016-2020 STMicroelectronics.
;* All rights reserved.
;*
;* This software component is licensed by ST under BSD 3-Clause license,
;* the "License"; You may not use this file except in compliance with the
;* License. You may obtain a copy of the License at:
;*                        opensource.org/licenses/BSD-3-Clause
;*
;******************************************************************************

#include "../cmsis_nvic.h"

#if !defined(MBED_APP_START)
  #define MBED_APP_START  MBED_ROM_START
#endif

#if !defined(MBED_APP_SIZE)
  #define MBED_APP_SIZE  MBED_ROM_SIZE
#endif

#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
/* This value is normally defined by the tools to 0x1000 for bare metal and 0x400 for RTOS */
#if defined(MBED_BOOT_STACK_SIZE)
#define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
#else
#define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
#endif
#endif

/* Round up VECTORS_SIZE to 8 bytes */
#define VECTORS_SIZE  (((NVIC_NUM_VECTORS * 4) + 7) AND ~7)

#define MBED_CRASH_REPORT_RAM_SIZE  0x100

#define MBED_IRAM1_START (MBED_RAM_START + VECTORS_SIZE + MBED_CRASH_REPORT_RAM_SIZE)
#define MBED_IRAM1_SIZE (MBED_RAM_SIZE - VECTORS_SIZE - MBED_CRASH_REPORT_RAM_SIZE)


#define RAM_FIXED_SIZE (MBED_CONF_TARGET_BOOT_STACK_SIZE + VECTORS_SIZE + MBED_CRASH_REPORT_RAM_SIZE)

LR_IROM1  MBED_APP_START  MBED_APP_SIZE  {

  ER_IROM1  MBED_APP_START  MBED_APP_SIZE  {
    *.o (RESET, +First)
    *(InRoot$$Sections)
    .ANY (+RO)
  }

  RW_m_crash_data  (MBED_RAM_START + VECTORS_SIZE)  EMPTY MBED_CRASH_REPORT_RAM_SIZE { ; RW data
  }

  RW_IRAM1  MBED_IRAM1_START  MBED_IRAM1_SIZE  {  ; RW data
   .ANY (+RW +ZI)
  }

  ARM_LIB_HEAP  AlignExpr(+0, 16)  EMPTY  (MBED_IRAM1_START + MBED_RAM_SIZE - RAM_FIXED_SIZE - AlignExpr(ImageLimit(RW_IRAM1), 16))  {  ; Heap growing up
  }

  ARM_LIB_STACK  (MBED_RAM_START + MBED_RAM_SIZE)  EMPTY  -MBED_CONF_TARGET_BOOT_STACK_SIZE  { ; Stack region growing down
  }
}