@@ -105,7 +105,8 @@ static rt_uint32_t GetSector(rt_uint32_t Address)
105105 }
106106 else //0:dual bank mode
107107 {
108- RT_ASSERT ("rtthread doesn't support duel bank mode yet!" );
108+ LOG_E ("rtthread doesn't support duel bank mode yet!" );
109+ RT_ASSERT (0 );
109110 }
110111#else //no dual bank ability
111112 if ((Address < ADDR_FLASH_SECTOR_1 ) && (Address >= ADDR_FLASH_SECTOR_0 ))
@@ -306,13 +307,13 @@ int stm32_flash_erase(rt_uint32_t addr, size_t size)
306307}
307308
308309#if defined(PKG_USING_FAL )
309- #define FLASH_SIZE_GRANULARITY_32K 4 * 32 * 1024
310- #define FLASH_SIZE_GRANULARITY_128K 128 * 1024
311- #define FLASH_SIZE_GRANULARITY_256K 7 * 256 *1024
310+ #define FLASH_SIZE_GRANULARITY_32K ( 4 * 32 * 1024)
311+ #define FLASH_SIZE_GRANULARITY_128K ( 128 * 1024)
312+ #define FLASH_SIZE_GRANULARITY_256K ( 7 * 256 *1024)
312313
313- #define STM32_FLASH_START_ADRESS_32K STM32_FLASH_START_ADRESS
314- #define STM32_FLASH_START_ADRESS_128K STM32_FLASH_START_ADRESS_32K + FLASH_SIZE_GRANULARITY_32K
315- #define STM32_FLASH_START_ADRESS_256K STM32_FLASH_START_ADRESS_128K + FLASH_SIZE_GRANULARITY_128K
314+ #define STM32_FLASH_START_ADRESS_32K ( STM32_FLASH_START_ADRESS)
315+ #define STM32_FLASH_START_ADRESS_128K ( STM32_FLASH_START_ADRESS_32K + FLASH_SIZE_GRANULARITY_32K)
316+ #define STM32_FLASH_START_ADRESS_256K ( STM32_FLASH_START_ADRESS_128K + FLASH_SIZE_GRANULARITY_128K)
316317
317318static int fal_flash_read_32k (long offset , rt_uint8_t * buf , size_t size );
318319static int fal_flash_read_128k (long offset , rt_uint8_t * buf , size_t size );
0 commit comments