2014-07-09 09:54 AM
Hi,
I'm working with STM32F401-DISCO on IAR.I'm trying to protect 2 sections of 16KB from the flash, I want to use the 2 sections for internal data.I tried to protect sections 0 & 1 , so I start the ROM from section 2.I add the command : SCB->VTOR = 0x08008000; at the void SystemInit(void) in system_stm32f4xx.c file,I run this simple project on the STM32F401-DISCO board.The project toggle PB0 pin.I have 2 boards:1.with external crystal 2.without external crystalWhen I run the project with the debugger it's works on both boards.When I disconnect the debugger the program don't run only on the board without the external crystal.What wrong with the IAR configuration file.Please advise.2014-07-09 12:52 PM
The processor starts at 0x08000000 not 0x08008000, you can't change this with IDE/Linker settings.
2014-07-10 01:54 AM
I think i can change it with startup files.
i don't know what to change in those files : startup_stm32f401x.s or system_stm32f4xx.cPlease help.2014-07-10 05:06 AM
I'm pretty sure you can't.
You need two words at 0x08000000 to point at the initial SP and PC. These can be anywhere within the memory space, but must reside at the base of the mapped boot memory. Once the processor is actually running you can point the SCB->VTOR (Vector Table) on any 512-byte boundary you want, but it's got to be executing first.