diff --git a/arch/arm/src/samdl/samd_clockconfig.c b/arch/arm/src/samdl/samd_clockconfig.c index 70b558b52cd..704245468db 100644 --- a/arch/arm/src/samdl/samd_clockconfig.c +++ b/arch/arm/src/samdl/samd_clockconfig.c @@ -558,7 +558,7 @@ static inline void sam_osc8m_config(void) * BOARD_DFLL_FINEVALUE - Value * * Closed loop mode only: - * BOARD_DFLL_SRCGCLKGEN - See GCLK_CLKCTRL_GEN* definitions + * BOARD_DFLL_SRCGCLKGEN - GCLK index * BOARD_DFLL_MULTIPLIER - Value * BOARD_DFLL_MAXCOARSESTEP - Value * BOARD_DFLL_MAXFINESTEP - Value @@ -644,7 +644,7 @@ static inline void sam_dfll_config(void) * Enable DFLL reference clock if in closed loop mode. * Depends on: * - * BOARD_DFLL_SRCGCLKGEN - See GCLK_CLKCTRL_GEN* definitions + * BOARD_DFLL_SRCGCLKGEN - GCLK index * * Input Parameters: * None @@ -675,7 +675,8 @@ static inline void sam_dfll_reference(void) * NOTE: We could enable write lock here to prevent further modification */ - regval = (BOARD_DFLL_SRCGCLKGEN | GCLK_CLKCTRL_ID_DFLL48M); + regval = ((BOARD_DFLL_SRCGCLKGEN << GCLK_CLKCTRL_GEN_SHIFT) | + GCLK_CLKCTRL_ID_DFLL48M); putreg16(regval, SAM_GCLK_CLKCTRL); /* Enable the DFLL reference clock */ diff --git a/configs/samd20-xplained/README.txt b/configs/samd20-xplained/README.txt index 69934a20f84..0900fcd5c74 100644 --- a/configs/samd20-xplained/README.txt +++ b/configs/samd20-xplained/README.txt @@ -1,5 +1,5 @@ README -^^^^^^ +====== This README discusses issues unique to NuttX configurations for the Atmel SAMD20 Xplained Pro development board. This board features the @@ -14,9 +14,9 @@ The SAMD20 Xplained Pro Starter Kit may be bundled with three modules: logic). Contents -^^^^^^^^ +======== - - STATUS + - STATUS/ISSUES - Modules - Development Environment - GNU Toolchain Options @@ -28,11 +28,12 @@ Contents - SAMD20 Xplained Pro-specific Configuration Options - Configurations - STATUS/ISSUES: +STATUS/ISSUES +============= - 1. The FLASH waitstates is set to 2 (see include/board.h). According to + 1. The FLASH wait states is set to 2 (see include/board.h). According to the data sheet, it should work at 1 but I sometimes see crashes when - the waitstates are set to one (about half of the time) (2014-2-18). + the wait states are set to one (about half of the time) (2014-2-18). 2. Garbage appears on the display sometimes after a reset (maybe 20% of the time) or after a power cycle (less after a power cycle). I don't @@ -62,13 +63,9 @@ Contents 4. OLED1 module is untested. These instructions were just lifted from the SAM4L Xplained Pro README.txt file. - 5. As of 20154-05-24, this SAMD20 configurations are broken. This - seems to have occurred as a consequence of the SAML21 integration - between NuttX-7.9 and NuttX-7.10. Hence, I expect that the problem - is trivial but nevertheless real. - Modules -^^^^^^^ +======= + The SAMD20 Xplained Pro Starter Kit is bundled with four modules: I/O1 @@ -270,7 +267,7 @@ Modules There is no built-in support for the PROTO1 module. Development Environment -^^^^^^^^^^^^^^^^^^^^^^^ +======================= Either Linux or Cygwin on Windows can be used for the development environment. The source has been built only using the GNU toolchain (see below). Other @@ -278,7 +275,7 @@ Development Environment environment. GNU Toolchain Options -^^^^^^^^^^^^^^^^^^^^^ +===================== The NuttX make system can be configured to support the various different @@ -334,7 +331,7 @@ GNU Toolchain Options MKDEP = $(TOPDIR)/tools/mknulldeps.sh IDEs -^^^^ +==== NuttX is built using command-line make. It can be used with an IDE, but some effort will be required to create the project. @@ -366,7 +363,7 @@ IDEs startup object needed by an IDE. NuttX EABI "buildroot" Toolchain -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +================================ A GNU GCC-based toolchain is assumed. The files */setenv.sh should be modified to point to the correct path to the Cortex-M0 GCC toolchain (if @@ -403,7 +400,8 @@ NuttX EABI "buildroot" Toolchain building a Cortex-M0 toolchain for Cygwin under Windows. LEDs -^^^^ +==== + There is one yellow LED available on the SAM D20 Xplained Pro board that can be turned on and off. The LED can be activated by driving the connected PA14 I/O line to GND. @@ -427,7 +425,7 @@ LEDs 2Hz, then a fatal error has been detected and the system has halted. Serial Consoles -^^^^^^^^^^^^^^^ +=============== SERCOM4 ------ @@ -462,28 +460,32 @@ Serial Consoles PA25 SERCOM3 / USART RXD Atmel Studio 6.1 -^^^^^^^^^^^^^^^^ +================ Loading Code into FLASH: ----------------------- + Tools menus: Tools -> Device Programming. Debugging the NuttX Object File ------------------------------- + 1) Rename object file from nutt to nuttx.elf. That is an extension that will be recognized by the file menu. 2) File menu: File -> Open -> Open object file for debugging + - Select nuttx.elf object file - Select AT91SAMD20J18 - Select files for symbols as desired - Select debugger 3) Debug menu: Debug -> Start debugging and break + - This will reload the nuttx.elf file into FLASH SAMD20 Xplained Pro-specific Configuration Options -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +================================================== CONFIG_ARCH - Identifies the arch/ subdirectory. This should be set to: @@ -600,7 +602,7 @@ SAMD20 Xplained Pro-specific Configuration Options CONFIG_USARTn_2STOP - Two stop bits Configurations -^^^^^^^^^^^^^^ +============== Each SAMD20 Xplained Pro configuration is maintained in a sub-directory and can be selected as follow: diff --git a/configs/saml21-xplained/README.txt b/configs/saml21-xplained/README.txt index 554bac24231..02423d281e5 100644 --- a/configs/saml21-xplained/README.txt +++ b/configs/saml21-xplained/README.txt @@ -16,6 +16,7 @@ Contents - LEDs and Buttons - Serial Consoles - Atmel Studio 6.1 + - JTAG - SAML21 Xplained Pro-specific Configuration Options - Configurations @@ -491,6 +492,14 @@ Atmel Studio 6.1 3) Debug menu: Debug -> Start debugging and break - This will reload the nuttx.elf file into FLASH +JTAG +==== + + I did all of the debug of the SAML21 Xplained using a Segger J-Link + connected to the micro JTAG connector on board the SAML21 Xplained. + I used an Olimex ARM-JTAG 20-10 Adapter to connect the J-Link to + the SAML21 Xplained. + SAML21 Xplained Pro-specific Configuration Options ==================================================