XMC4xxx: Plug last holes to get a first, clean build.

This commit is contained in:
Gregory Nutt 2017-03-20 13:46:02 -06:00
parent 985c137b78
commit 3a91ba5264
8 changed files with 163 additions and 14 deletions

View File

@ -44,6 +44,7 @@
#include <stdint.h>
#include "up_internal.h"
#include "xmc4_config.h"
#include "xmc4_usic.h"
@ -78,6 +79,22 @@ struct uart_config_s
void xmc4_lowsetup(void);
/****************************************************************************
* Name: xmc4_earlyserialinit
*
* Description:
* Performs the low level UART initialization early in debug so that the
* serial console will be available during bootup. This must be called
* before xmc4_serialinit. NOTE: This function depends on GPIO pin
* configuration performed in xmc_lowsetup() and main clock iniialization
* performed in xmc_clock_configure().
*
****************************************************************************/
#ifdef USE_EARLYSERIALINIT
void xmc4_earlyserialinit(void);
#endif
/****************************************************************************
* Name: xmc4_uart_configure
*

View File

@ -1019,7 +1019,7 @@ static bool xmc4_txempty(struct uart_dev_s *dev)
****************************************************************************/
/****************************************************************************
* Name: up_earlyserialinit
* Name: xmc4_earlyserialinit
*
* Description:
* Performs the low level UART initialization early in debug so that the
@ -1031,7 +1031,7 @@ static bool xmc4_txempty(struct uart_dev_s *dev)
****************************************************************************/
#if defined(USE_EARLYSERIALINIT)
void up_earlyserialinit(void)
void xmc4_earlyserialinit(void)
{
/* Disable interrupts from all UARTS. The console is enabled in
* pic32mx_consoleinit()
@ -1068,7 +1068,7 @@ void up_earlyserialinit(void)
*
* Description:
* Register serial console and serial ports. This assumes
* that up_earlyserialinit was called previously.
* that xmc4_earlyserialinit was called previously.
*
* Input Parameters:
* None

View File

@ -33,8 +33,8 @@
*
************************************************************************************/
#ifndef __ARCH_ARM_SRC_XMC4_XMC4_CLOCKCONFIG_H
#define __ARCH_ARM_SRC_XMC4_XMC4_CLOCKCONFIG_H
#ifndef __ARCH_ARM_SRC_XMC4_XMC4_START_H
#define __ARCH_ARM_SRC_XMC4_XMC4_START_H
/************************************************************************************
* Included Files
@ -58,4 +58,4 @@
void xmc4_board_initialize(void);
#endif /* __ARCH_ARM_SRC_XMC4_XMC4_CLOCKCONFIG_H */
#endif /* __ARCH_ARM_SRC_XMC4_XMC4_START_H */

View File

@ -37,11 +37,7 @@ include ${TOPDIR}/.config
include ${TOPDIR}/tools/Config.mk
include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs
ifeq ($(CONFIG_ARMV7M_DTCM),y)
LDSCRIPT = flash-dtcm.ld
else
LDSCRIPT = flash-sram.ld
endif
LDSCRIPT = flash.ld
ifeq ($(WINTOOL),y)
# Windows-native toolchains

View File

@ -0,0 +1,134 @@
/****************************************************************************
* configs/xmc4500-relax/scripts/flash.ld
*
* Copyright (C) 2017 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/* The XMC4500 has 1024Kb of FLASH beginning at address 0x0800:0000 and
* 64Kb of SRAM beginning at 0x2000:0000.
*
* When booting from FLASH, FLASH memory is aliased to address 0x0000:0000
* where the code expects to begin execution by jumping to the entry point in
* the 0x0800:0000 address
* range.
*/
MEMORY
{
flash (rx) : ORIGIN = 0x08000000, LENGTH = 1024K
sram (rwx) : ORIGIN = 0x20000000, LENGTH = 64K
}
OUTPUT_ARCH(arm)
ENTRY(_stext)
SECTIONS
{
.text :
{
_stext = ABSOLUTE(.);
*(.vectors)
*(.text .text.*)
*(.fixup)
*(.gnu.warning)
*(.rodata .rodata.*)
*(.gnu.linkonce.t.*)
*(.glue_7)
*(.glue_7t)
*(.got)
*(.gcc_except_table)
*(.gnu.linkonce.r.*)
_etext = ABSOLUTE(.);
} > flash
.init_section :
{
_sinit = ABSOLUTE(.);
*(.init_array .init_array.*)
_einit = ABSOLUTE(.);
} > flash
.ARM.extab :
{
*(.ARM.extab*)
} > flash
__exidx_start = ABSOLUTE(.);
.ARM.exidx :
{
*(.ARM.exidx*)
} > flash
__exidx_end = ABSOLUTE(.);
_eronly = ABSOLUTE(.);
.data :
{
_sdata = ABSOLUTE(.);
*(.data .data.*)
*(.gnu.linkonce.d.*)
CONSTRUCTORS
_edata = ABSOLUTE(.);
} > sram AT > flash
.bss :
{
_sbss = ABSOLUTE(.);
*(.bss .bss.*)
*(.gnu.linkonce.b.*)
*(COMMON)
_ebss = ABSOLUTE(.);
} > sram
/* Global data not cleared after reset. */
.noinit :
{
_snoinit = ABSOLUTE(.);
*(.noinit*)
_enoinit = ABSOLUTE(.);
} > sram
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
.stab.exclstr 0 : { *(.stab.exclstr) }
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
.comment 0 : { *(.comment) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_info 0 : { *(.debug_info) }
.debug_line 0 : { *(.debug_line) }
.debug_pubnames 0 : { *(.debug_pubnames) }
.debug_aranges 0 : { *(.debug_aranges) }
}

View File

@ -42,7 +42,7 @@ ifeq ($(CONFIG_BUTTONS),y)
CSRCS += xmc4_buttons.c
endif
ifeq ($(CONFIG_USERLED),y)
ifeq ($(CONFIG_ARCH_LEDS),y)
CSRCS += xmc4_autoleds.c
else
CSRCS += xmc4_userleds.c

View File

@ -43,6 +43,8 @@
#include <arch/board/board.h>
#include "xmc4500-relax.h"
/****************************************************************************
* Public Functions
****************************************************************************/

View File

@ -49,7 +49,7 @@
************************************************************************************/
/************************************************************************************
* Name: xmc4_boardinitialize
* Name: xmc4_board_initialize
*
* Description:
* All STM32 architectures must provide the following entry point. This entry point
@ -58,7 +58,7 @@
*
************************************************************************************/
void xmc4_boardinitialize(void)
void xmc4_board_initialize(void)
{
#ifdef CONFIG_ARCH_LEDS
/* Configure on-board LEDs if LED support has been selected. */