From d9f9c7d7ac48163c2c69e4359703ae5de9669f7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nima=20Askari=20=28=D9=86=DB=8C=D9=85=D8=A7=20=D8=B9=D8=B3?= =?UTF-8?q?=DA=A9=D8=B1=DB=8C=29?= Date: Sat, 9 Sep 2023 17:32:49 +0200 Subject: [PATCH] Add U599 --- ee.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/ee.c b/ee.c index 5d1c1da..4357e23 100644 --- a/ee.c +++ b/ee.c @@ -196,12 +196,28 @@ #else #define _EE_FLASH_BANK FLASH_BANK_2 #define _EE_PAGE_OR_SECTOR PAGE_NUM -#if (_EE_USE_FLASH_PAGE_OR_SECTOR > 256) +#if (_EE_USE_FLASH_PAGE_OR_SECTOR > 255) #error "Please Enter correct address, maximum is (255)" #endif #endif #endif +// 4MB version +#if defined(STM32U599xx) +#define _EE_SIZE 8192 +#define _EE_ADDR_INUSE (((uint32_t)0x08000000) | (_EE_SIZE * _EE_USE_FLASH_PAGE_OR_SECTOR)) +#define _EE_ICACHE_CTRL 1 +#if (_EE_USE_FLASH_PAGE_OR_SECTOR < 256) +#define _EE_FLASH_BANK FLASH_BANK_1 +#else +#define _EE_FLASH_BANK FLASH_BANK_2 +#define _EE_PAGE_OR_SECTOR PAGE_NUM +#if (_EE_USE_FLASH_PAGE_OR_SECTOR > 511) +#error "Please Enter correct address, maximum is (511)" +#endif +#endif +#endif + #if (_EE_USE_RAM_BYTE > 0) uint8_t ee_ram[_EE_USE_RAM_BYTE]; #endif