Skip to content

Commit

Permalink
fixup! feat(core): add support for STM32U585
Browse files Browse the repository at this point in the history
  • Loading branch information
TychoVrahe committed Nov 24, 2023
1 parent ebbde1e commit ecd4585
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions core/embed/trezorhal/stm32u5/flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
#include "flash.h"
#include "model.h"

#define FLASH_SEC_START_ADDRESS 0x0C000000
#define FLASH_START_ADDRESS 0x08000000

#ifdef STM32U585xx
#define FLASH_BANK_PAGES 128
#define FLASH_SECTOR_COUNT (FLASH_BANK_PAGES * 2)
Expand Down Expand Up @@ -56,8 +53,8 @@ const void *flash_get_address(uint16_t sector, uint32_t offset, uint32_t size) {
return NULL;
}

uint32_t base_addr = flash_sector_is_secure(sector) ? FLASH_SEC_START_ADDRESS
: FLASH_START_ADDRESS;
uint32_t base_addr =
flash_sector_is_secure(sector) ? FLASH_BASE_S : FLASH_BASE_NS;

return (const void *)(base_addr + FLASH_PAGE_SIZE * sector + offset);
}
Expand Down

0 comments on commit ecd4585

Please sign in to comment.