Skip to main content
gil23
Associate III
July 9, 2014
Question

Working without external crystal

  • July 9, 2014
  • 3 replies
  • 1504 views
Posted on July 09, 2014 at 18:54

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 crystal

When 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.
    This topic has been closed for replies.

    3 replies

    Tesla DeLorean
    Guru
    July 9, 2014
    Posted on July 09, 2014 at 21:52

    The processor starts at 0x08000000 not 0x08008000, you can't change this with IDE/Linker settings.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    gil23
    gil23Author
    Associate III
    July 10, 2014
    Posted on July 10, 2014 at 10:54

    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.c

    Please help.

    Tesla DeLorean
    Guru
    July 10, 2014
    Posted on July 10, 2014 at 14:06

    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.
    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..