mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 07:12:54 +08:00
STM32: Add support for the IAR compiler
This commit is contained in:
committed by
Gregory Nutt
parent
2234d7d8e5
commit
29ab0fb991
@@ -1,7 +1,7 @@
|
||||
/************************************************************************************
|
||||
* arch/arm/src/stm32/stm32_vectors.S
|
||||
* arch/arm/src/stm32/gnu/stm32_vectors.S
|
||||
*
|
||||
* Copyright (C) 2009-2013, 2015 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2009-2013, 2015-2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
File diff suppressed because it is too large
Load Diff
@@ -83,11 +83,17 @@
|
||||
|
||||
volatile uint32_t *g_current_regs[1];
|
||||
|
||||
/* This is the address of the exception vector table (determined by the
|
||||
* linker script).
|
||||
*/
|
||||
/* This is the address of the exception vector table (determined by the
|
||||
* linker script).
|
||||
*/
|
||||
|
||||
#if defined(__ICCARM__)
|
||||
/* _vectors replaced on __vector_table for IAR C-SPY Simulator */
|
||||
|
||||
extern uint32_t __vector_table[];
|
||||
#else
|
||||
extern uint32_t _vectors[];
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
@@ -329,7 +335,11 @@ void up_irqinitialize(void)
|
||||
* will need to set the NVIC vector location to this alternative location.
|
||||
*/
|
||||
|
||||
#if defined(__ICCARM__)
|
||||
putreg32((uint32_t)__vector_table, NVIC_VECTAB);
|
||||
#else
|
||||
putreg32((uint32_t)_vectors, NVIC_VECTAB);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARCH_RAMVECTORS
|
||||
/* If CONFIG_ARCH_RAMVECTORS is defined, then we are using a RAM-based
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/stm32/stm32_start.c
|
||||
* arch/arm/src/chip/stm32_start.c
|
||||
*
|
||||
* Copyright (C) 2009, 2011-2015 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2009, 2011-2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -58,6 +57,24 @@
|
||||
# include "nvic.h"
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor definitions
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(__ICCARM__)
|
||||
# define _START_BSS __sfb(".bss")
|
||||
# define _END_BSS __sfe(".bss")
|
||||
# define _DATA_INIT __sfb(".data_init")
|
||||
# define _START_DATA __sfb(".data")
|
||||
# define _END_DATA __sfe(".data")
|
||||
#else
|
||||
# define _START_BSS &_sbss
|
||||
# define _END_BSS &_ebss
|
||||
# define _DATA_INIT &_eronly
|
||||
# define _START_DATA &_sdata
|
||||
# define _END_DATA &_edata
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function prototypes
|
||||
****************************************************************************/
|
||||
@@ -263,7 +280,7 @@ void __start(void)
|
||||
* certain that there are no issues with the state of global variables.
|
||||
*/
|
||||
|
||||
for (dest = &_sbss; dest < &_ebss; )
|
||||
for (dest = _START_BSS; dest < __END_BSS; )
|
||||
{
|
||||
*dest++ = 0;
|
||||
}
|
||||
@@ -276,7 +293,7 @@ void __start(void)
|
||||
* end of all of the other read-only data (.text, .rodata) at _eronly.
|
||||
*/
|
||||
|
||||
for (src = &_eronly, dest = &_sdata; dest < &_edata; )
|
||||
for (src = _DATA_INIT, dest = _START_DATA; dest < _END_DATA; )
|
||||
{
|
||||
*dest++ = *src++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user