boards: arm: Add sam4e_xpro board
Add sam4e_xpro board files. This enable use of Atmel sam4e SoC. Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
This commit is contained in:
parent
4a5de7bb87
commit
c6a8ca3935
8
boards/arm/sam4e_xpro/CMakeLists.txt
Normal file
8
boards/arm/sam4e_xpro/CMakeLists.txt
Normal file
|
@ -0,0 +1,8 @@
|
|||
#
|
||||
# Copyright (c) 2019, Aurelien Jarno
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
zephyr_library()
|
||||
zephyr_library_sources(pinmux.c)
|
8
boards/arm/sam4e_xpro/Kconfig.board
Normal file
8
boards/arm/sam4e_xpro/Kconfig.board
Normal file
|
@ -0,0 +1,8 @@
|
|||
# Atmel SAM4E Xplained Pro Board selection
|
||||
|
||||
# Copyright (c) 2019 Gerson Fernando Budke
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
config BOARD_SAM4E_XPRO
|
||||
bool "Atmel SAM4E Xplained Pro"
|
||||
depends on SOC_PART_NUMBER_SAM4E16E
|
32
boards/arm/sam4e_xpro/Kconfig.defconfig
Normal file
32
boards/arm/sam4e_xpro/Kconfig.defconfig
Normal file
|
@ -0,0 +1,32 @@
|
|||
# Atmel SAM4E Xplained Pro Board configuration
|
||||
|
||||
# Copyright (c) 2019 Gerson Fernando Budke
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
if BOARD_SAM4E_XPRO
|
||||
|
||||
config BOARD
|
||||
default "sam4e_xpro"
|
||||
|
||||
if GPIO
|
||||
|
||||
config GPIO_SAM
|
||||
default y
|
||||
|
||||
endif # GPIO
|
||||
|
||||
if I2C
|
||||
|
||||
config I2C_SAM_TWI
|
||||
default y
|
||||
|
||||
endif # I2C
|
||||
|
||||
if SPI
|
||||
|
||||
config SPI_SAM
|
||||
default y
|
||||
|
||||
endif # SPI
|
||||
|
||||
endif # BOARD_SAM4E_XPRO
|
4
boards/arm/sam4e_xpro/board.cmake
Normal file
4
boards/arm/sam4e_xpro/board.cmake
Normal file
|
@ -0,0 +1,4 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
board_runner_args(openocd --cmd-post-verify "at91sam4 gpnvm set 1")
|
||||
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
|
BIN
boards/arm/sam4e_xpro/doc/img/sam4e_xpro.jpg
Normal file
BIN
boards/arm/sam4e_xpro/doc/img/sam4e_xpro.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 559 KiB |
160
boards/arm/sam4e_xpro/doc/index.rst
Normal file
160
boards/arm/sam4e_xpro/doc/index.rst
Normal file
|
@ -0,0 +1,160 @@
|
|||
.. _sam4e_xpro:
|
||||
|
||||
SAM4E Xplained Pro
|
||||
###################
|
||||
|
||||
Overview
|
||||
********
|
||||
|
||||
The SAM4E Xplained Pro evaluation kit is a development platform to evaluate the
|
||||
Atmel SAM4E series microcontrollers.
|
||||
|
||||
.. image:: img/sam4e_xpro.jpg
|
||||
:width: 500px
|
||||
:align: center
|
||||
:alt: SAM4E Xplained Pro
|
||||
|
||||
Hardware
|
||||
********
|
||||
|
||||
- ATSAM4E16E ARM Cortex-M4F Processor
|
||||
- 12 MHz crystal oscillator
|
||||
- internal 32.768 kHz crystal oscillator
|
||||
- 2 x IS61WV5128BLL 4Mb SRAM
|
||||
- MT29F2G08ABAEAWP 2Gb NAND
|
||||
- SD card connector
|
||||
- CAN-bus (TLE7250GVIOXUMA1 CAN Transceiver)
|
||||
- Ethernet port (KSZ8081MNXIA phy)
|
||||
- Micro-AB USB device
|
||||
- Micro-AB USB debug interface supporting CMSIS-DAP, Virtual COM Port and Data
|
||||
Gateway Interface (DGI)
|
||||
- One reset and one user pushbutton
|
||||
- 1 yellow user LEDs
|
||||
|
||||
|
||||
Supported Features
|
||||
==================
|
||||
|
||||
The sam4e_xpro 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 |
|
||||
+-----------+------------+-------------------------------------+
|
||||
| USART | on-chip | serial port |
|
||||
+-----------+------------+-------------------------------------+
|
||||
| I2C | on-chip | i2c |
|
||||
+-----------+------------+-------------------------------------+
|
||||
| SPI | on-chip | spi |
|
||||
+-----------+------------+-------------------------------------+
|
||||
| WATCHDOG | on-chip | watchdog |
|
||||
+-----------+------------+-------------------------------------+
|
||||
| GPIO | on-chip | gpio |
|
||||
+-----------+------------+-------------------------------------+
|
||||
|
||||
Other hardware features are not currently supported by Zephyr.
|
||||
|
||||
The default configuration can be found in the Kconfig
|
||||
:zephyr_file:`boards/arm/sam4e_xpro/sam4e_xpro_defconfig`.
|
||||
|
||||
Connections and IOs
|
||||
===================
|
||||
|
||||
The `SAM4E Xplained Pro User Guide`_ has detailed information about board
|
||||
connections. Download the `SAM4E Xplained Pro documentation`_ for more detail.
|
||||
|
||||
System Clock
|
||||
============
|
||||
|
||||
The SAM4E MCU is configured to use the 12 MHz internal oscillator on the board
|
||||
with the on-chip PLL to generate an 120 MHz system clock.
|
||||
|
||||
Serial Port
|
||||
===========
|
||||
|
||||
The ATSAM4E16E MCU has 2 UARTs and 2 USARTs. One of the UARTs (UART0) is
|
||||
configured for the console and is available as a Virtual COM Port by EDBG USB
|
||||
chip.
|
||||
|
||||
Programming and Debugging
|
||||
*************************
|
||||
|
||||
Flashing the Zephyr project onto SAM4E MCU requires the `OpenOCD tool`_.
|
||||
By default a factory new SAM4E chip will boot SAM-BA boot loader located in
|
||||
the ROM, not the flashed image. This is determined by the value of GPNVM1
|
||||
(General-Purpose NVM bit 1). The flash procedure will ensure that GPNVM1 is
|
||||
set to 1 changing the default behavior to boot from Flash.
|
||||
|
||||
If your chip has a security bit GPNVM0 set you will be unable to program flash
|
||||
memory or connect to it via a debug interface. The only way to clear GPNVM0
|
||||
is to perform a chip erase procedure that will erase all GPNVM bits and the full
|
||||
contents of the SAM4E flash memory:
|
||||
|
||||
- With the board power off, set a jumper on the J304 header.
|
||||
- Turn the board power on. The jumper can be removed soon after the power is on
|
||||
(flash erasing procedure is started when the erase line is asserted for at
|
||||
least 230ms)
|
||||
|
||||
Flashing
|
||||
========
|
||||
|
||||
#. 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
|
||||
|
||||
#. Connect the SAM4E Xplained Pro board to your host computer using the
|
||||
USB debug port. Then build and flash the :ref:`hello_world`
|
||||
application.
|
||||
|
||||
.. zephyr-app-commands::
|
||||
:zephyr-app: samples/hello_world
|
||||
:board: sam4e_xpro
|
||||
:goals: build flash
|
||||
|
||||
You should see "Hello World! arm" in your terminal.
|
||||
|
||||
Debugging
|
||||
=========
|
||||
|
||||
You can debug an application in the usual way. Here is an example for the
|
||||
:ref:`hello_world` application.
|
||||
|
||||
.. zephyr-app-commands::
|
||||
:zephyr-app: samples/hello_world
|
||||
:board: sam4e_xpro
|
||||
:maybe-skip-config:
|
||||
:goals: debug
|
||||
|
||||
References
|
||||
**********
|
||||
|
||||
.. target-notes::
|
||||
|
||||
.. _SAM4E Xplained Pro User Guide:
|
||||
http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-42216-SAM4E-Xplained-Pro_User-Guide.pdf
|
||||
|
||||
.. _SAM4E Xplained Pro documentation:
|
||||
http://ww1.microchip.com/downloads/en/DeviceDoc/SAM4E-Xplained-Pro_Design-Documentation.zip
|
||||
|
||||
.. _OpenOCD tool:
|
||||
http://openocd.org/
|
||||
|
||||
.. _SAM-BA:
|
||||
http://www.atmel.com/tools/ATMELSAM-BAIN-SYSTEMPROGRAMMER.aspx
|
16
boards/arm/sam4e_xpro/pinmux.c
Normal file
16
boards/arm/sam4e_xpro/pinmux.c
Normal file
|
@ -0,0 +1,16 @@
|
|||
/*
|
||||
* Copyright (c) 2019 Gerson Fernando Budke
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <init.h>
|
||||
|
||||
static int sam4e_xpro_init(struct device *dev)
|
||||
{
|
||||
ARG_UNUSED(dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
SYS_INIT(sam4e_xpro_init, PRE_KERNEL_1, 0);
|
58
boards/arm/sam4e_xpro/sam4e_xpro.dts
Normal file
58
boards/arm/sam4e_xpro/sam4e_xpro.dts
Normal file
|
@ -0,0 +1,58 @@
|
|||
/*
|
||||
* Copyright (c) 2019 Gerson Fernando Budke
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
|
||||
#include <atmel/sam4e16e.dtsi>
|
||||
|
||||
/ {
|
||||
model = "Atmel SAM4E Xplained Pro Board with an Atmel SAM4E16E SoC";
|
||||
compatible = "atmel,sam4e_xpro", "atmel,sam4e16e", "atmel,sam4e";
|
||||
|
||||
aliases {
|
||||
i2c-0 = &i2c0;
|
||||
led0 = &yellow_led_1;
|
||||
sw0 = &user_button;
|
||||
wdog = &wdog;
|
||||
};
|
||||
|
||||
chosen {
|
||||
zephyr,console = &uart0;
|
||||
zephyr,shell-uart = &uart0;
|
||||
zephyr,sram = &sram0;
|
||||
zephyr,flash = &flash0;
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
yellow_led_1: led_1 {
|
||||
gpios = <&portd 22 0>;
|
||||
label = "LED 1";
|
||||
};
|
||||
};
|
||||
|
||||
gpio_keys {
|
||||
compatible = "gpio-keys";
|
||||
user_button: button_1 {
|
||||
label = "User Button";
|
||||
gpios = <&porta 2 (GPIO_PUD_PULL_UP |
|
||||
GPIO_INT_ACTIVE_LOW)>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&cpu0 {
|
||||
clock-frequency = <120000000>;
|
||||
};
|
||||
|
||||
&uart0 {
|
||||
current-speed = <115200>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&wdog {
|
||||
status = "okay";
|
||||
};
|
11
boards/arm/sam4e_xpro/sam4e_xpro.yaml
Normal file
11
boards/arm/sam4e_xpro/sam4e_xpro.yaml
Normal file
|
@ -0,0 +1,11 @@
|
|||
identifier: sam4e_xpro
|
||||
name: SAM4E Xplained Pro
|
||||
type: mcu
|
||||
arch: arm
|
||||
toolchain:
|
||||
- zephyr
|
||||
- gnuarmemb
|
||||
- xtools
|
||||
supported:
|
||||
- gpio
|
||||
- watchdog
|
15
boards/arm/sam4e_xpro/sam4e_xpro_defconfig
Normal file
15
boards/arm/sam4e_xpro/sam4e_xpro_defconfig
Normal file
|
@ -0,0 +1,15 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
CONFIG_ARM=y
|
||||
CONFIG_SOC_SERIES_SAM4E=y
|
||||
CONFIG_SOC_PART_NUMBER_SAM4E16E=y
|
||||
CONFIG_CORTEX_M_SYSTICK=y
|
||||
CONFIG_CONSOLE=y
|
||||
CONFIG_UART_CONSOLE=y
|
||||
CONFIG_SERIAL=y
|
||||
CONFIG_UART_SAM=y
|
||||
CONFIG_UART_SAM_PORT_0=y
|
||||
CONFIG_BOARD_SAM4E_XPRO=y
|
||||
CONFIG_SOC_ATMEL_SAM4E_EXT_MAINCK=y
|
||||
CONFIG_GPIO_SAM=y
|
||||
CONFIG_GPIO=y
|
27
boards/arm/sam4e_xpro/support/openocd.cfg
Normal file
27
boards/arm/sam4e_xpro/support/openocd.cfg
Normal file
|
@ -0,0 +1,27 @@
|
|||
if {[info exists env(OPENOCD_INTERFACE)]} {
|
||||
set INTERFACE $env(OPENOCD_INTERFACE)
|
||||
} else {
|
||||
# By default connect over Debug USB port using the EDBG chip
|
||||
set INTERFACE "cmsis-dap"
|
||||
}
|
||||
|
||||
source [find interface/$INTERFACE.cfg]
|
||||
|
||||
transport select swd
|
||||
|
||||
set CHIPNAME atsam4e16e
|
||||
|
||||
source [find target/at91sam4sXX.cfg]
|
||||
|
||||
reset_config srst_only
|
||||
|
||||
$_TARGETNAME configure -event gdb-attach {
|
||||
echo "Debugger attaching: halting execution"
|
||||
reset halt
|
||||
gdb_breakpoint_override hard
|
||||
}
|
||||
|
||||
$_TARGETNAME configure -event gdb-detach {
|
||||
echo "Debugger detaching: resuming execution"
|
||||
resume
|
||||
}
|
Loading…
Reference in a new issue