2014-06-11 14:59:24 +02:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2013 INRIA
|
|
|
|
* Copyright (C) 2014 Freie Universität Berlin
|
|
|
|
*
|
|
|
|
* This file is subject to the terms and conditions of the GNU Lesser General
|
|
|
|
* Public License v2.1. See the file LICENSE in the top level directory for more
|
|
|
|
* details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @defgroup cpu_stm32f1 STM32F1
|
2014-10-19 22:07:36 +02:00
|
|
|
* @ingroup cpu
|
2014-06-11 14:59:24 +02:00
|
|
|
* @brief CPU specific implementations for the STM32F1
|
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @file
|
|
|
|
* @brief Implementation specific CPU configuration options
|
|
|
|
*
|
|
|
|
* @author Alaeddine Weslati <alaeddine.weslati@intia.fr>
|
|
|
|
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
|
|
|
*/
|
|
|
|
|
2016-01-25 11:32:08 +01:00
|
|
|
#ifndef CPU_CONF_H
|
|
|
|
#define CPU_CONF_H
|
2014-06-11 14:59:24 +02:00
|
|
|
|
2016-01-14 23:21:49 +01:00
|
|
|
#include "cpu_conf_common.h"
|
|
|
|
|
2017-10-12 19:09:53 +02:00
|
|
|
#if defined(CPU_MODEL_STM32F103C8) || defined(CPU_MODEL_STM32F103CB) || defined(CPU_MODEL_STM32F103RB)
|
2017-03-06 16:28:11 +01:00
|
|
|
#include "vendor/stm32f103xb.h"
|
2017-12-01 21:20:56 +01:00
|
|
|
#elif defined(CPU_MODEL_STM32F103RE) || defined(CPU_MODEL_STM32F103ZE)
|
2017-03-06 16:28:11 +01:00
|
|
|
#include "vendor/stm32f103xe.h"
|
2016-01-25 11:32:08 +01:00
|
|
|
#endif
|
2014-06-11 14:59:24 +02:00
|
|
|
|
2014-10-13 10:53:20 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2014-06-11 14:59:24 +02:00
|
|
|
/**
|
2015-05-27 23:08:25 +02:00
|
|
|
* @brief ARM Cortex-M specific CPU configuration
|
2014-06-11 14:59:24 +02:00
|
|
|
* @{
|
|
|
|
*/
|
2015-05-27 23:08:25 +02:00
|
|
|
#define CPU_DEFAULT_IRQ_PRIO (1U)
|
2017-12-01 21:20:56 +01:00
|
|
|
#if defined(CPU_MODEL_STM32F103RE) || defined(CPU_MODEL_STM32F103ZE)
|
2015-05-27 23:08:25 +02:00
|
|
|
#define CPU_IRQ_NUMOF (60U)
|
2017-08-20 00:14:08 +02:00
|
|
|
#else
|
|
|
|
#define CPU_IRQ_NUMOF (43U)
|
|
|
|
#endif
|
2015-05-27 23:08:25 +02:00
|
|
|
#define CPU_FLASH_BASE FLASH_BASE
|
2014-06-11 14:59:24 +02:00
|
|
|
/** @} */
|
|
|
|
|
2016-04-20 10:27:26 +02:00
|
|
|
/**
|
|
|
|
* @brief Flash page configuration
|
|
|
|
* @{
|
|
|
|
*/
|
2018-01-07 16:14:34 +01:00
|
|
|
#if defined(CPU_MODEL_STM32F103C8) || defined(CPU_MODEL_STM32F103CB) || defined(CPU_MODEL_STM32F103RB)
|
|
|
|
#define FLASHPAGE_SIZE (1024U)
|
|
|
|
#elif defined(CPU_MODEL_STM32F103RE) || defined(CPU_MODEL_STM32F103ZE)
|
2016-04-20 10:27:26 +02:00
|
|
|
#define FLASHPAGE_SIZE (2048U)
|
2018-01-07 16:14:34 +01:00
|
|
|
#endif
|
2016-04-20 10:27:26 +02:00
|
|
|
|
2018-07-09 10:35:06 +02:00
|
|
|
#define FLASHPAGE_NUMOF (STM32_FLASHSIZE / FLASHPAGE_SIZE)
|
2018-03-13 11:02:28 +01:00
|
|
|
|
|
|
|
/* The minimum block size which can be written is 2B. However, the erase
|
|
|
|
* block is always FLASHPAGE_SIZE.
|
|
|
|
*/
|
|
|
|
#define FLASHPAGE_RAW_BLOCKSIZE (2U)
|
|
|
|
/* Writing should be always 4 bytes aligned */
|
|
|
|
#define FLASHPAGE_RAW_ALIGNMENT (4U)
|
2016-04-20 10:27:26 +02:00
|
|
|
/** @} */
|
|
|
|
|
2014-10-13 10:53:20 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2016-01-25 11:32:08 +01:00
|
|
|
#endif /* CPU_CONF_H */
|
2014-06-11 14:59:24 +02:00
|
|
|
/** @} */
|