[bsp] [stm32] fix drv_flash_l4.c bug
This commit is contained in:
parent
d682c35441
commit
c4d0c91502
|
@ -53,8 +53,8 @@ static uint32_t GetPage(uint32_t Addr)
|
||||||
static uint32_t GetBank(uint32_t Addr)
|
static uint32_t GetBank(uint32_t Addr)
|
||||||
{
|
{
|
||||||
uint32_t bank = 0;
|
uint32_t bank = 0;
|
||||||
#if defined (STM32L432xx)
|
#ifndef FLASH_BANK_2
|
||||||
bank = FLASH_BANK_1;
|
bank = FLASH_BANK_1;
|
||||||
#else
|
#else
|
||||||
if (READ_BIT(SYSCFG->MEMRMP, SYSCFG_MEMRMP_FB_MODE) == 0)
|
if (READ_BIT(SYSCFG->MEMRMP, SYSCFG_MEMRMP_FB_MODE) == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -30,7 +30,7 @@ menu "On-chip Peripheral Drivers"
|
||||||
depends on BSP_USING_UART1 && RT_SERIAL_USING_DMA
|
depends on BSP_USING_UART1 && RT_SERIAL_USING_DMA
|
||||||
default n
|
default n
|
||||||
|
|
||||||
config BSP_USING_UART2
|
config BSP_USING_UART2
|
||||||
bool "Enable UART2"
|
bool "Enable UART2"
|
||||||
default y
|
default y
|
||||||
|
|
||||||
|
@ -60,7 +60,9 @@ menu "On-chip Peripheral Drivers"
|
||||||
select BSP_SPI1_TX_USING_DMA
|
select BSP_SPI1_TX_USING_DMA
|
||||||
default n
|
default n
|
||||||
endif
|
endif
|
||||||
|
config BSP_USING_ON_CHIP_FLASH
|
||||||
|
bool "Enable on-chip FLASH"
|
||||||
|
default n
|
||||||
menuconfig BSP_USING_I2C1
|
menuconfig BSP_USING_I2C1
|
||||||
bool "Enable I2C1 BUS (software simulation)"
|
bool "Enable I2C1 BUS (software simulation)"
|
||||||
default n
|
default n
|
||||||
|
|
|
@ -14,6 +14,7 @@ CubeMX_Config/Src/stm32l4xx_hal_msp.c
|
||||||
|
|
||||||
path = [cwd]
|
path = [cwd]
|
||||||
path += [cwd + '/CubeMX_Config/Inc']
|
path += [cwd + '/CubeMX_Config/Inc']
|
||||||
|
path += [cwd + '/ports']
|
||||||
|
|
||||||
startup_path_prefix = SDK_LIB
|
startup_path_prefix = SDK_LIB
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,51 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2006-2018, RT-Thread Development Team
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*
|
||||||
|
* Change Logs:
|
||||||
|
* Date Author Notes
|
||||||
|
* 2018-12-5 SummerGift first version
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _FAL_CFG_H_
|
||||||
|
#define _FAL_CFG_H_
|
||||||
|
|
||||||
|
#include <rtthread.h>
|
||||||
|
#include <board.h>
|
||||||
|
|
||||||
|
#if defined(BSP_USING_ON_CHIP_FLASH)
|
||||||
|
extern const struct fal_flash_dev stm32_onchip_flash;
|
||||||
|
#endif /* BSP_USING_ON_CHIP_FLASH */
|
||||||
|
|
||||||
|
/* ========================= Device Configuration ========================== */
|
||||||
|
#ifdef BSP_USING_ON_CHIP_FLASH
|
||||||
|
#define ONCHIP_FLASH_DEV &stm32_onchip_flash,
|
||||||
|
#else
|
||||||
|
#define ONCHIP_FLASH_DEV
|
||||||
|
#endif /* BSP_USING_ON_CHIP_FLASH */
|
||||||
|
|
||||||
|
/* flash device table */
|
||||||
|
#define FAL_FLASH_DEV_TABLE \
|
||||||
|
{ \
|
||||||
|
ONCHIP_FLASH_DEV \
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ====================== Partition Configuration ========================== */
|
||||||
|
#ifdef FAL_PART_HAS_TABLE_CFG
|
||||||
|
|
||||||
|
#ifdef BSP_USING_ON_CHIP_FLASH
|
||||||
|
#define ONCHIP_FLASH_PATITION {FAL_PART_MAGIC_WROD, "app", "onchip_flash", 0, 496 * 1024, 0}, \
|
||||||
|
{FAL_PART_MAGIC_WROD, "param", "onchip_flash", 496* 1024, 16 * 1024, 0},
|
||||||
|
#else
|
||||||
|
#define ONCHIP_FLASH_PATITION
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* partition table */
|
||||||
|
#define FAL_PART_TABLE \
|
||||||
|
{ \
|
||||||
|
ONCHIP_FLASH_PATITION \
|
||||||
|
}
|
||||||
|
#endif /* FAL_PART_HAS_TABLE_CFG */
|
||||||
|
|
||||||
|
#endif /* _FAL_CFG_H_ */
|
Loading…
Reference in New Issue