nuttx/configs/stm32l476vg-disco
Gregory Nutt 2fc0fbcf7e Squashed commit of the following:
commit 89e9d426e91c056e659fccf5e5c4392618f8f777
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Mon Jul 24 16:44:19 2017 -0600

    Update some comments

commit 9c5d8a5833350006ed389e898b11c8c8a20e5f4f
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Mon Jul 24 16:15:54 2017 -0600

    Spirit:  Rename drivers/wireless/spirit/src to lib.  Move Spirit network driver out of IEEE802.15.4 into drivers/wireless/spirit/drivers

commit cabc0ec9e6eb558dcb715ab17264383aa0105e7a
Merge: 87b616414a 6bd744c4b3
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Mon Jul 24 15:38:40 2017 -0600

    Merge remote-tracking branch 'origin/master' into spirit

commit 87b616414a79c01a71acea78f8258e05325c1996
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Mon Jul 24 15:37:27 2017 -0600

    Spirit radio driver is mutating into a standalone network driver.

commit 507798233868a661ae8adad3e3aa117075a7a146
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Mon Jul 24 13:32:08 2017 -0600

    Spirit: More radio initialization logic

commit 33af25704ce9ca83d576300d153cfe31cc6d2576
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Mon Jul 24 12:19:14 2017 -0600

    Spirit:  Beginning of radio initialization logic

commit 97b20014c016e55952a8f9d8f4ae29e2cc555b23
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Mon Jul 24 09:42:06 2017 -0600

    Spirit: More initialization logic.

commit 295d8e27824c0417fccea2344b30bb5c93ffbabe
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Sun Jul 23 15:39:53 2017 -0600

    Spirit:  Add header file containing enumeration of commands.

commit 8a2d9dd8eb9cc70cbcdd1b913fc9022b9c9ec8da
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Sun Jul 23 11:33:50 2017 -0600

    Spirit:  Add GPIO initialization logic

commit 8b6d80c44f92024c45a6ba63ba1af3fdafe94dc3
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Sun Jul 23 10:07:25 2017 -0600

    Spirit:  Add interrupt control logic.

commit 423f846fe5c914f92a4bfea4d9d1fa33de1c77a5
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Sat Jul 22 19:06:52 2017 -0600

    Spirit: Yet a little more radio initialization logic.

commit 5895b979823e51ddde5ad52e6de66a8ad662e883
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Sat Jul 22 15:36:05 2017 -0600

    Spirit: A little more radio initialization logic.

commit 86311ab30aad386203c181c792847dd1d37f9a02
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Sat Jul 22 13:02:32 2017 -0600

    Spirit: A miniscule amount of radio initialization logic.

commit ad55e89d5ee12ea1eeea95fcd38ff3da0db4416a
Merge: 90a7666655 f4e46b0da7
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Sat Jul 22 10:56:30 2017 -0600

    Merge remote-tracking branch 'origin/master' into spirit

commit 90a766665534b05da0157dbc383cb06a98c86a79
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Sat Jul 22 10:52:52 2017 -0600

    Spirit1:  A few fixes for a clean build of initial configuration (not much there yet)

commit bbbf04c223230a52a7705a2161128265cfbaa480
Merge: 623d54a7f7 2319ea53a9
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Sat Jul 22 09:53:57 2017 -0600

    Merge remote-tracking branch 'origin/master' into spirit

commit 623d54a7f719e9032099f88f38203efee4b80722
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Sat Jul 22 09:43:52 2017 -0600

    b-l475e-iot01a: Add a configuration for testing sprit radio.

commit d309d73d9f4665f9d870eb03531f450043d9389d
Merge: 52c3ddfae6 d88dc9b2e5
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Sat Jul 22 09:02:06 2017 -0600

    Merge remote-tracking branch 'origin/master' into spirit

commit 52c3ddfae6802e111c2b5cf1207baf21a61dd00b
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Sat Jul 22 08:33:04 2017 -0600

    Spirit:  Add register definition header file.

commit 8d842ab5e8f9ca653b42f9ee88dc279f06b4fa98
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Fri Jul 21 17:27:03 2017 -0600

    b-l475e-iot01a: Add initial, unverified support for the SPSRGF/Spirit1 module.

commit 73d902a1048616fb9c2dd2147cabcd8ee78e19ac
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Fri Jul 21 15:49:43 2017 -0600

    Spirit: Fixes to get skeleton IEEE 802.15.4 driver build.

commit ebc5a8387bb94f0cc3827533795f3e4a33207e67
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Fri Jul 21 15:16:29 2017 -0600

    Spirit1:  Add framework for IEEE 802.15.4 driver.  Does not yet build.

commit 52e195a7ae14ddb18bdd56258f4877381d2501ca
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Fri Jul 21 14:02:42 2017 -0600

    Spirit:  A little more SPI logic.

commit 90048d0c5b8a5af4d81a15d99535c84ed38d8ae9
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Fri Jul 21 11:19:06 2017 -0600

    Spirit: Build directories setup.  Some initial files added, mostly just to verify build.

commit 8273a381ac1f6bb081b292b5e73226185e9e634c
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Fri Jul 21 08:34:04 2017 -0600

    USB composite:  Remove references to CDC/ACM and USB MSC from composite logic.  They are no longer coupled.
2017-07-24 16:46:30 -06:00
..
include Squashed commit of the following: 2017-07-24 16:46:30 -06:00
nsh Move remaining, unique Make.defs files into scripts directory. 2017-07-11 11:14:11 -06:00
scripts Move remaining, unique Make.defs files into scripts directory. 2017-07-11 12:13:36 -06:00
src STM32L4: Eliminate a warning about implicit definition of function. While we are at it, let's improve the naming a little too. 2017-07-22 09:53:29 -06:00
Kconfig basic support of STM32L4VG Discovery board. Functioning nsh, leds, buttons. Also compatible with, but not requiring, RNG code in 'arch'. 2016-03-25 15:21:24 -05:00
README.txt Update README 2016-07-07 16:21:11 -06:00

XXX all this needs review and update
README
======

This README discusses issues unique to NuttX configurations for the ST
STM32L476VG Discovery board from ST Micro.  See

  http://www.st.com/stm32l476g-disco

STM32L476VG:

  Microprocessor: 32-bit ARM Cortex M4 at 80MHz STM32F476VGT6
  Memory:         1024 KB Flash and 96+32 KB SRAM
  ADC:            3x12-bit, 2.4 MSPS A/D converter: up to 24 channels
  DMA:            16-stream DMA controllers with FIFOs and burst support
  Timers:         Up to 11 timers: up to eight 16-bit, two 32-bit timers, two
                  watchdog timers, and a SysTick timer
  GPIO:           Up to 51 I/O ports with interrupt capability
  I2C:            Up to 3 x I2C interfaces
  USARTs:         Up to 3 USARTs, 2 UARTs, 1 LPUART
  SPIs:           Up to 3 SPIs
  SAIs:           Up to 2 dual-channel audio interfaces
  CAN interface
  SDIO interface
  QSPI interface
  USB:            USB 2.0 full-speed device/host/OTG controller with on-chip PHY
  CRC calculation unit
  RTC

Board features:

  Peripherals:    2 led, 1 d-pad joystick, 2 x LED, LCD, USC OTG FS, SAI stereo
                  Digital Microphone, MEMS Accelerometer, Magnetometer,
                  Gyroscope, 128 Mbit QSPI Flash, current ammeter
  Debug:          Serial wire debug and JTAG interfaces

  Uses a STM32F103 to provide a ST-Link for programming, debug similar to the
  OpenOcd FTDI function - USB to JTAG front-end.

  See http://mbed.org/platforms/ST-Nucleo-L476RG for more
  information about these boards.

Contents
========

  - mbed
  - Hardware
    - Button
    - LED
    - USARTs and Serial Consoles
  - LQFP64
  - mbed
  - Shields
  - Configurations

mbed
====

  The Nucleo-F401RE includes boot loader from mbed:

    https://mbed.org/platforms/ST-Nucleo-F401RE/
    https://mbed.org/handbook/Homepage

  Using the mbed loader:

  1. Connect the Nucleo-F4x1RE to the host PC using the USB connector.
  2. A new file system will appear called NUCLEO; open it with Windows
     Explorer (assuming that you are using Windows).
  3. Drag and drop nuttx.bin into the MBED window.  This will load the
     nuttx.bin binary into the Nucleo-F4x1RE.  The NUCLEO window will
     close then re-open and the Nucleo-F4x1RE will be running the new code.

Hardware
========

  GPIO
  ----
  SERIAL_TX=PA_2    USER_BUTTON=PC_13
  SERIAL_RX=PA_3    LED1       =PA_5

  A0=PA_0  USART2RX D0=PA_3            D8 =PA_9
  A1=PA_1  USART2TX D1=PA_2            D9 =PC_7
  A2=PA_4           D2=PA_10   WIFI_CS=D10=PB_6 SPI_CS
  A3=PB_0  WIFI_INT=D3=PB_3            D11=PA_7 SPI_MOSI
  A4=PC_1      SDCS=D4=PB_5            D12=PA_6 SPI_MISO
  A5=PC_0   WIFI_EN=D5=PB_4       LED1=D13=PA_5 SPI_SCK
               LED2=D6=PB_10  I2C1_SDA=D14=PB_9 Probe
                    D7=PA_8   I2C1_SCL=D15=PB_8 Probe

  From: https://mbed.org/platforms/ST-Nucleo-F401RE/

  Buttons
  -------
  B1 USER: the user button is connected to the I/O PC13 (pin 2) of the STM32
  microcontroller.

  LEDs
  ----
  The Nucleo F401RE and Nucleo F411RE provide a single user LED, LD2.  LD2
  is the green LED connected to Arduino signal D13 corresponding to MCU I/O
  PA5 (pin 21) or PB13 (pin 34) depending on the STM32target.

    - When the I/O is HIGH value, the LED is on.
    - When the I/O is LOW, the LED is off.

  These LEDs are not used by the board port unless CONFIG_ARCH_LEDS is
  defined.  In that case, the usage by the board port is defined in
  include/board.h and src/sam_leds.c. The LEDs are used to encode OS-related
  events as follows when the red LED (PE24) is available:

    SYMBOL                Meaning                   LD2
    -------------------  -----------------------  -----------
    LED_STARTED          NuttX has been started     OFF
    LED_HEAPALLOCATE     Heap has been allocated    OFF
    LED_IRQSENABLED      Interrupts enabled         OFF
    LED_STACKCREATED     Idle stack created         ON
    LED_INIRQ            In an interrupt            No change
    LED_SIGNAL           In a signal handler        No change
    LED_ASSERTION        An assertion failed        No change
    LED_PANIC            The system has crashed     Blinking
    LED_IDLE             MCU is is sleep mode       Not used

  Thus if LD2, NuttX has successfully booted and is, apparently, running
  normally.  If LD2 is flashing at approximately 2Hz, then a fatal error
  has been detected and the system has halted.

Serial Consoles
===============

  USART1
  ------
  Pins and Connectors:

    RXD: PA11  CN10 pin 14
         PB7   CN7 pin 21
    TXD: PA10  CN9 pin 3, CN10 pin 33
         PB6   CN5 pin 3, CN10 pin 17

  NOTE:  You may need to edit the include/board.h to select different USART1
  pin selections.

  TTL to RS-232 converter connection:

    Nucleo CN10 STM32F4x1RE
    ----------- ------------
    Pin 21 PA9  USART1_RX   *Warning you make need to reverse RX/TX on
    Pin 33 PA10 USART1_TX    some RS-232 converters
    Pin 20 GND
    Pin 8  U5V

  To configure USART1 as the console:

    CONFIG_STM32_USART1=y
    CONFIG_USART1_SERIALDRIVER=y
    CONFIG_USART1_SERIAL_CONSOLE=y
    CONFIG_USART1_RXBUFSIZE=256
    CONFIG_USART1_TXBUFSIZE=256
    CONFIG_USART1_BAUD=115200
    CONFIG_USART1_BITS=8
    CONFIG_USART1_PARITY=0
    CONFIG_USART1_2STOP=0

  USART2
  -----
  Pins and Connectors:

    RXD: PA3   CN9 pin 1 (See SB13, 14, 62, 63). CN10 pin 37
         PD6
    TXD: PA2   CN9 pin 2(See SB13, 14, 62, 63). CN10 pin 35
         PD5

  UART2 is the default in all of these configurations.

  TTL to RS-232 converter connection:

    Nucleo CN9  STM32F4x1RE
    ----------- ------------
    Pin 1  PA3  USART2_RX   *Warning you make need to reverse RX/TX on
    Pin 2  PA2  USART2_TX    some RS-232 converters

  Solder Bridges.  This configuration requires:

  - SB62 and SB63 Closed: PA2 and PA3 on STM32 MCU are connected to D1 and D0
    (pin 7 and pin 8) on Arduino connector CN9 and ST Morpho connector CN10
    as USART signals.  Thus SB13 and SB14 should be OFF.

  - SB13 and SB14 Open:  PA2 and PA3 on STM32F103C8T6 (ST-LINK MCU) are
    disconnected to PA3 and PA2 on STM32 MCU.

  To configure USART2 as the console:

    CONFIG_STM32_USART2=y
    CONFIG_USART2_SERIALDRIVER=y
    CONFIG_USART2_SERIAL_CONSOLE=y
    CONFIG_USART2_RXBUFSIZE=256
    CONFIG_USART2_TXBUFSIZE=256
    CONFIG_USART2_BAUD=115200
    CONFIG_USART2_BITS=8
    CONFIG_USART2_PARITY=0
    CONFIG_USART2_2STOP=0

  USART6
  ------
  Pins and Connectors:

    RXD: PC7    CN5 pin2, CN10 pin 19
         PA12   CN10, pin 12
    TXD: PC6    CN10, pin 4
         PA11   CN10, pin 14

  To configure USART6 as the console:

    CONFIG_STM32_USART6=y
    CONFIG_USART6_SERIALDRIVER=y
    CONFIG_USART6_SERIAL_CONSOLE=y
    CONFIG_USART6_RXBUFSIZE=256
    CONFIG_USART6_TXBUFSIZE=256
    CONFIG_USART6_BAUD=115200
    CONFIG_USART6_BITS=8
    CONFIG_USART6_PARITY=0
    CONFIG_USART6_2STOP=0

  Virtual COM Port
  ----------------
  Yet another option is to use UART2 and the USB virtual COM port.  This
  option may be more convenient for long term development, but is painful
  to use during board bring-up.

  Solder Bridges.  This configuration requires:

  - SB62 and SB63 Open: PA2 and PA3 on STM32 MCU are disconnected to D1
    and D0 (pin 7 and pin 8) on Arduino connector CN9 and ST Morpho
    connector CN10.

  - SB13 and SB14 Closed:  PA2 and PA3 on STM32F103C8T6 (ST-LINK MCU) are
    connected to PA3 and PA2 on STM32 MCU to have USART communication
    between them. Thus SB61, SB62 and SB63 should be OFF.

  Configuring USART2 is the same as given above.

  Question:  What BAUD should be configure to interface with the Virtual
  COM port?  115200 8N1?

  Default
  -------
  As shipped, SB62 and SB63 are open and SB13 and SB14 closed, so the
  virtual COM port is enabled.

Shields
=======

  RS-232 from Cutedigi.com
  ------------------------
  Supports a single RS-232 connected via

    Nucleo CN9  STM32F4x1RE  Cutedigi
    ----------- ------------ --------
    Pin 1  PA3  USART2_RX    RXD
    Pin 2  PA2  USART2_TX    TXD

  Support for this shield is enabled by selecting USART2 and configuring
  SB13, 14, 62, and 63 as described above under "Serial Consoles"

  Itead Joystick Shield
  ---------------------
  See http://imall.iteadstudio.com/im120417014.html for more information
  about this joystick.

  Itead Joystick Connection:

    --------- ----------------- ---------------------------------
    ARDUINO   ITEAD             NUCLEO-F4x1
    PIN NAME  SIGNAL            SIGNAL
    --------- ----------------- ---------------------------------
     D3       Button E Output   PB3
     D4       Button D Output   PB5
     D5       Button C Output   PB4
     D6       Button B Output   PB10
     D7       Button A Output   PA8
     D8       Button F Output   PA9
     D9       Button G Output   PC7
     A0       Joystick Y Output PA0  ADC1_0
     A1       Joystick X Output PA1  ADC1_1
    --------- ----------------- ---------------------------------

    All buttons are pulled on the shield.  A sensed low value indicates
    when the button is pressed.

    NOTE: Button F cannot be used with the default USART1 configuration
    because PA9 is configured for USART1_RX by default.  Use select
    different USART1 pins in the board.h file or select a different
    USART or select CONFIG_NUCLEO_F401RE_AJOY_MINBUTTONS which will
    eliminate all but buttons A, B, and C.

  Itead Joystick Signal interpretation:

    --------- ----------------------- ---------------------------
    BUTTON     TYPE                    NUTTX ALIAS
    --------- ----------------------- ---------------------------
    Button A  Large button A          JUMP/BUTTON 3
    Button B  Large button B          FIRE/BUTTON 2
    Button C  Joystick select button  SELECT/BUTTON 1
    Button D  Tiny Button D           BUTTON 6
    Button E  Tiny Button E           BUTTON 7
    Button F  Large Button F          BUTTON 4
    Button G  Large Button G          BUTTON 5
    --------- ----------------------- ---------------------------

  Itead Joystick configuration settings:

    System Type -> STM32 Peripheral Support
      CONFIG_STM32_ADC1=y              : Enable ADC1 driver support

    Drivers
      CONFIG_ANALOG=y                  : Should be automatically selected
      CONFIG_ADC=y                     : Should be automatically selected
      CONFIG_INPUT=y                   : Select input device support
      CONFIG_AJOYSTICK=y               : Select analog joystick support

  There is nothing in the configuration that currently uses the joystick.
  For testing, you can add the following configuration options to enable the
  analog joystick example at apps/examples/ajoystick:

    CONFIG_NSH_ARCHINIT=y
    CONFIG_EXAMPLES_AJOYSTICK=y
    CONFIG_EXAMPLES_AJOYSTICK_DEVNAME="/dev/ajoy0"
    CONFIG_EXAMPLES_AJOYSTICK_SIGNO=13

  STATUS:
  2014-12-04:
    - Without ADC DMA support, it is not possible to sample both X and Y
      with a single ADC.  Right now, only one axis is being converted.
    - There is conflicts with some of the Arduino data pins and the
      default USART1 configuration.  I am currently running with USART1
      but with CONFIG_NUCLEO_F401RE_AJOY_MINBUTTONS to eliminate the
      conflict.
    - Current showstopper: I appear to be getting infinite interrupts as
      soon as joystick button interrupts are enabled.

Configurations
==============

  nsh:
  ---
    Configures the NuttShell (nsh) located at apps/examples/nsh for the
    Nucleo-F401RE board.  The Configuration enables the serial interfaces
    on UART2.  Support for builtin applications is enabled, but in the base
    configuration no builtin applications are selected (see NOTES below).

    NOTES:

    1. This configuration uses the mconf-based configuration tool.  To
       change this configuration using that tool, you should:

       a. Build and install the kconfig-mconf tool.  See nuttx/README.txt
          see additional README.txt files in the NuttX tools repository.

       b. Execute 'make menuconfig' in nuttx/ in order to start the
          reconfiguration process.

    2. By default, this configuration uses the Generic ARM EABI toolchain
       for Linux.  That can easily be reconfigured, of course.

       CONFIG_HOST_LINUX=y                 : Builds under Linux
       CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL=y : Generic EABI toolchain for Linux

    3. Although the default console is USART2 (which would correspond to
       the Virtual COM port) I have done all testing with the console
       device configured for USART1 (see instruction above under "Serial
       Consoles).  I have been using a TTL-to-RS-232 converter.

    4. This example has been used to verify the OTGFS functionality.  USB is
       not enabled in the default configuration but can be enabled with the
       following settings:

         CONFIG_STM32L4_OTGFS=y

         CONFIG_USBDEV=y
         CONFIG_USBDEV_SELFPOWERED=y

     These will enable the USB CDC/ACM serial device

         CONFIG_CDCACM=y
         CONFIG_CDCACM_EP0MAXPACKET=64
         CONFIG_CDCACM_EPINTIN=1
         CONFIG_CDCACM_EPINTIN_FSSIZE=64
         CONFIG_CDCACM_EPINTIN_HSSIZE=64
         CONFIG_CDCACM_EPBULKOUT=3
         CONFIG_CDCACM_EPBULKOUT_FSSIZE=64
         CONFIG_CDCACM_EPBULKOUT_HSSIZE=512
         CONFIG_CDCACM_EPBULKIN=2
         CONFIG_CDCACM_EPBULKIN_FSSIZE=64
         CONFIG_CDCACM_EPBULKIN_HSSIZE=512
         CONFIG_CDCACM_NRDREQS=4
         CONFIG_CDCACM_NWRREQS=4
         CONFIG_CDCACM_BULKIN_REQLEN=96
         CONFIG_CDCACM_RXBUFSIZE=257
         CONFIG_CDCACM_TXBUFSIZE=193
         CONFIG_CDCACM_VENDORID=0x0525
         CONFIG_CDCACM_PRODUCTID=0xa4a7
         CONFIG_CDCACM_VENDORSTR="NuttX"
         CONFIG_CDCACM_PRODUCTSTR="CDC/ACM Serial"

         CONFIG_SERIAL_REMOVABLE=y

    These will enable the USB serial example at apps/examples/usbserial

         CONFIG_BOARDCTL_USBDEVCTRL=y

         CONFIG_EXAMPLES_USBSERIAL=y
         CONFIG_EXAMPLES_USBSERIAL_BUFSIZE=512
         CONFIG_EXAMPLES_USBSERIAL_TRACEINIT=y
         CONFIG_EXAMPLES_USBSERIAL_TRACECLASS=y
         CONFIG_EXAMPLES_USBSERIAL_TRACETRANSFERS=y
         CONFIG_EXAMPLES_USBSERIAL_TRACECONTROLLER=y
         CONFIG_EXAMPLES_USBSERIAL_TRACEINTERRUPTS=y

    Optional USB debug features:

         CONFIG_DEBUG_FEATURES=y
         CONFIG_DEBUG_USB=y
         CONFIG_ARCH_USBDUMP=y
         CONFIG_USBDEV_TRACE=y
         CONFIG_USBDEV_TRACE_NRECORDS=128
         CONFIG_USBDEV_TRACE_STRINGS=y
         CONFIG_USBDEV_TRACE_INITIALIDSET=y

         CONFIG_NSH_USBDEV_TRACE=y
         CONFIG_NSH_USBDEV_TRACEINIT=y
         CONFIG_NSH_USBDEV_TRACECLASS=y
         CONFIG_NSH_USBDEV_TRACETRANSFERS=y
         CONFIG_NSH_USBDEV_TRACECONTROLLER=y
         CONFIG_NSH_USBDEV_TRACEINTERRUPTS=y