arm: board: Add support for board Atmel SAM4S Xplained.

This commit provides support for Atmel SAM4S Xplained board

Signed-off-by: Justin Watson <jwatson5@gmail.com>
This commit is contained in:
fallrisk 2017-05-04 16:35:04 -07:00 committed by Anas Nashif
commit 106bf1c09a
11 changed files with 247 additions and 1 deletions

View file

@ -0,0 +1,9 @@
# Kconfig - Atmel SAM4S Xplained Board selection
#
# Copyright (c) 2017 Justin Watson
# SPDX-License-Identifier: Apache-2.0
#
config BOARD_SAM4S_XPLAINED
bool "Atmel SAM4S Xplained"
depends on SOC_PART_NUMBER_SAM4S16C

View file

@ -0,0 +1,13 @@
# Kconfig - Atmel SAM4S Xplained Board configuration
#
# Copyright (c) 2017 Justin Watson
# SPDX-License-Identifier: Apache-2.0
#
if BOARD_SAM4S_XPLAINED
config BOARD
string
default sam4s_xplained
endif # BOARD_SAM4S_XPLAINED

View file

@ -0,0 +1,8 @@
# Makefile - Atmel SAM4S Xplained Board
#
# Copyright (c) 2017 Justin Watson
# SPDX-License-Identifier: Apache-2.0
#
# No C files (yet)
obj- += dummy.o

View file

@ -0,0 +1,11 @@
/*
* Copyright (c) Justin Watson 2017
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef __INC_BOARD_H
#define __INC_BOARD_H
#include <soc.h>
#endif /* __INC_BOARD_H */

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 KiB

View file

@ -0,0 +1,165 @@
.. _sam4s_xplained:
SAM4S Xplained
################
Overview
********
The SAM4S Xplained evaluation kit is a development platform to evaluate the
Atmel SAM4S series microcontrollers.
.. image:: img/sam4s_xplained.png
:width: 500px
:align: center
:alt: SAM4S Xplained
Hardware
********
- ATSAM4S16C ARM Cortex-M4 Processor
- 12 MHz crystal oscillator
- internal 32.768 kHz crystal oscillator
- IS66WV51216DALL 8 Mb SRAM
- Micro-AB USB device
- Micro-AB USB debug interface supporting SEGGER OB and Virtual COM Port and
Data
- One reset and one user pushbutton
- 2 yellow user LEDs
- IC pads for external flash chip
Supported Features
==================
The sam4s_xplained board configuration supports the following hardware
features:
+-----------+------------+-------------------------------------+
| Interface | Controller | Driver/Component |
+===========+============+=====================================+
| NVIC | on-chip | nested vector interrupt controller |
+-----------+------------+-------------------------------------+
| SYSTICK | on-chip | systick |
+-----------+------------+-------------------------------------+
| UART | on-chip | serial port |
+-----------+------------+-------------------------------------+
Other hardware features are not currently supported by Zephyr.
The default configuration can be found in the Kconfig
:file:`boards/arm/sam4s_xplained/sam4s_xplained_defconfig`.
Connections and IOs
===================
The `SAM4S Xplained Online User Guide`_ has detailed information about board
connections. Download the `SAM4S Xplained Schematic`_ for more detail.
System Clock
============
The SAM4S MCU is configured to use the 12 MHz internal oscillator on the board
with the on-chip PLL to generate an 84 MHz system clock.
Serial Port
===========
The ATSAM4S16C MCU has 2 UARTs and 2 USARTs. One of the UARTs (UART0) is
connected to the Segger J-Link OB chip (the AT91SAM3U4 is programmed to be
Segger J-Link OB). Segger J-Link OB brings the UART out as a virtual COM port.
Programming and Debugging
*************************
The SAM4S Xplained board comes with Segger `J-Link OB <https://www.segger.com/jlink-ob.html>`_. This provides a debug
interface to the SAM4S16C chip. You can use Ozone or JLink to communicate with
the SAM4S16C.
Flashing
========
#. Build the Zephyr kernel and the :ref:`hello_world` sample application:
.. code-block:: console
$ cd $ZEPHYR_BASE/samples/hello_world/
$ make BOARD=sam4s_xplained
#. Connect the SAM4S Xplained board to your host computer using the USB debug
port.
#. Run your favorite terminal program to listen for output. Under Linux the
terminal should be :code:`/dev/ttyACM0`. For example:
.. code-block:: console
$ minicom -D /dev/ttyACM0 -o
The -o option tells minicom not to send the modem initialization
string. Connection should be configured as follows:
- Speed: 115200
- Data: 8 bits
- Parity: None
- Stop bits: 1
#. Download JLink from the Segger `JLink Downloads Page`_. Go to the section
"J-Link Software and Documentation Pack" and install the "J-Link Software and
Documentation pack for Linux".
#. To flash an image open JLink and enter the following:
.. code-block:: console
JLink> device at91sam4s16c
// Hit enter to accept JTAG as the default and the other default JTAG settings
JLink> connect
.
.
.
Device "ATSAM4S16C" selected.
TotalIRLen = 4, IRPrint = 0x01
AP-IDR: 0x24770011, Type: AHB-AP
Found Cortex-M4 r0p1, Little endian.
FPUnit: 6 code (BP) slots and 2 literal slots
CoreSight components:
ROMTbl 0 @ E00FF000
ROMTbl 0 [0]: FFF0F000, CID: B105E00D, PID: 000BB000 SCS
ROMTbl 0 [1]: FFF02000, CID: B105E00D, PID: 003BB002 DWT
ROMTbl 0 [2]: FFF03000, CID: B105E00D, PID: 002BB003 FPB
ROMTbl 0 [3]: FFF01000, CID: B105E00D, PID: 003BB001 ITM
ROMTbl 0 [4]: FFF41000, CID: B105900D, PID: 000BB9A1 TPIU
Found 1 JTAG device, Total IRLen = 4:
#0 Id: 0x4BA00477, IRLen: 04, IRPrint: 0x1, CoreSight JTAG-DP (ARM)
Cortex-M4 identified.
JLink> loadbin <zephyr.bin>, 0x400000
Downloading file [/home/justin/Zephyr/zephyr/samples/hello_world/outdir/zephyr.bin]...
Comparing flash [100%] Done.
Erasing flash [100%] Done.
Programming flash [100%] Done.
Verifying flash [100%] Done.
J-Link: Flash download: Flash programming performed for 2 ranges (21504 bytes)
J-Link: Flash download: Total time needed: 0.549s (Prepare: 0.200s, Compare: 0.150s, Erase: 0.020s, Program: 0.094s, Verify: 0.001s, Restore: 0.081s)
O.K.
JLink> r
JLink> go
You should see "Hello World! arm" in your terminal.
References
**********
.. target-notes::
.. _SAM4S Xplained Online User Guide:
http://www.atmel.com/webdoc/sam4s16xplained/index.html
.. _JLink Downloads Page:
https://www.segger.com/downloads/jlink
.. _SAM4S Xplained Schematic:
http://www.atmel.com/tools/sam4s-xpld.aspx?tab=documents

View file

@ -0,0 +1,13 @@
CONFIG_ARM=y
CONFIG_SOC_FAMILY_SAM=y
CONFIG_SOC_SERIES_SAM4S=y
CONFIG_SOC_PART_NUMBER_SAM4S16C=y
CONFIG_CORTEX_M_SYSTICK=y
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_UART_CONSOLE_ON_DEV_NAME="UART_1"
CONFIG_SERIAL=y
CONFIG_UART_SAM=y
CONFIG_UART_SAM_PORT_1=y
CONFIG_BOARD_SAM4S_XPLAINED=y
CONFIG_SOC_ATMEL_SAM4S_EXT_MAINCK=y

View file

@ -39,6 +39,7 @@ dtb-$(CONFIG_BOARD_QUARK_SE_C1000_BLE) = quark_se_c1000_ble.dts_compiled
dtb-$(CONFIG_BOARD_QEMU_CORTEX_M3) = qemu_cortex_m3.dts_compiled
dtb-$(CONFIG_BOARD_SAM_E70_XPLAINED) = sam_e70_xplained.dts_compiled
dtb-$(CONFIG_BOARD_ARDUINO_DUE) = arduino_due.dts_compiled
dtb-$(CONFIG_BOARD_SAM4S_XPLAINED) = sam4s_xplained.dts_compiled
always := $(dtb-y)
endif

View file

@ -0,0 +1,18 @@
/*
* Copyright (c) Justin Watson 2017
* SPDX-License-Identifier: Apache-2.0
*/
/dts-v1/;
#include <atmel/sam4s.dtsi>
/ {
model = "Atmel SAM4S Xplained Board with an Atmel SAM4S16C SoC";
compatible = "atmel,sam4s_xplained", "atmel,sam4s16c", "atmel,sam4s";
chosen {
zephyr,sram = &sram0;
zephyr,flash = &flash0;
};
};

View file

@ -0,0 +1,8 @@
/* This file is a temporary workaround for mapping of the generated information
* to the current driver definitions. This will be removed when the drivers
* are modified to handle the generated information, or the mapping of
* generated data matches the driver definitions.
*/
#define CONFIG_NUM_IRQ_PRIO_BITS ARM_V7M_NVIC_E000E100_ARM_NUM_IRQ_PRIORITY_BITS

View file

@ -9,7 +9,7 @@ platforms = qemu_cortex_m3 frdm_k64f arduino_due nucleo_f103rb stm32_mini_a15
sam_e70_xplained curie_ble nrf52_blenano2 hexiwear_kw40z
cc3220sf_launchxl frdm_kl25z disco_l475_iot1 nucleo_l432kc
nucleo_f413zh stm32l496g_disco stm32f4_disco 96b_carbon_nrf51
stm32f469i_disco nucleo_f412zg
stm32f469i_disco nucleo_f412zg sam4s_xplained
supported_toolchains = zephyr gccarmemb