Documentation: migrate STM32L4

This commit is contained in:
raiden00pl
2023-08-23 10:19:06 +02:00
committed by Xiang Xiao
parent 60bead4f84
commit c3f8753ecd
18 changed files with 3233 additions and 3327 deletions
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,449 @@
================
ST Nucleo L432KC
================
This page discusses issues unique to NuttX configurations for the ST
Nucleo-l432kc board from ST Micro. See
http://www.st.com/nucleo-l432kc
NucleoL432KC:
- Microprocessor: 32-bit ARM Cortex M4 at 80MHz STM32L432KCU6
- Memory: 256 KB Flash and 64 KB SRAM
- ADC: 1×12-bit, 5 MSPS A/D converter: up to 10 channels
- DMA: 16-stream DMA controllers with FIFOs and burst support
- Timers: Up to 11 timers: up to five 16-bit, one 32-bit, two low-power
16 bit timers, two watchdog timers, and a SysTick timer
- GPIO: Up to 26 I/O ports with interrupt capability, most 5v tolerant
- I2C: Up to 2 × I2C interfaces
- USARTs: Up to 3 USARTs, 2 UARTs, 1 LPUART
- SPIs: Up to 2 SPIs
- SAIs: 1 dual-channel audio interface
- CAN interface
- QSPI interface
- USB: USB 2.0 full-speed device/host/OTG controller with on-chip PHY
- CRC calculation unit
- RTC
Board features:
- Peripherals: 1 led
- Debug: Serial wire debug and JTAG interfaces via on-board micro-usb stlink v2.1
- Expansion I/F Arduino Nano Headers
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-L432KC for more
information about these boards.
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
toolchains will likely cause problems.
GNU Toolchain Options
=====================
Toolchain Configurations
------------------------
The NuttX make system has been modified to support the following different
toolchain options.
1. The NuttX buildroot Toolchain (see below), or
2. Any generic arm-none-eabi GNU toolchain.
All testing has been conducted using the NuttX CodeSourcery toolchain. To use
a different toolchain, you simply need to modify the configuration. As an
example::
CONFIG_ARM_TOOLCHAIN_GNU_EABI : Generic arm-none-eabi toolchain
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.
Makefile Build
--------------
Under Eclipse, it is pretty easy to set up an "empty makefile project" and
simply use the NuttX makefile to build the system. That is almost for free
under Linux. Under Windows, you will need to set up the "Cygwin GCC" empty
makefile project in order to work with Windows (Google for "Eclipse Cygwin" -
there is a lot of help on the internet).
Using Sourcery CodeBench from http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/overview
Download and install the latest version (as of this writing it was
sourceryg++-2013.05-64-arm-none-eabi)
Import the project from git.
File->import->Git-URI, then import a Exiting code as a Makefile progject
from the working directory the git clone was done to.
Select the Sourcery CodeBench for ARM EABI. N.B. You must do one command line
build, before the make will work in CodeBench.
Native Build
------------
Here are a few tips before you start that effort:
1) Select the toolchain that you will be using in your .config file
2) Start the NuttX build at least one time from the Cygwin command line
before trying to create your project. This is necessary to create
certain auto-generated files and directories that will be needed.
3) Set up include paths: You will need include/, arch/arm/src/stm32,
arch/arm/src/common, arch/arm/src/armv7-m, and sched/.
4) All assembly files need to have the definition option -D __ASSEMBLY__
on the command line.
Startup files will probably cause you some headaches. The NuttX startup file
is arch/arm/src/stm32/stm32_vectors.S. With RIDE, I have to build NuttX
one time from the Cygwin command line in order to obtain the pre-built
startup object needed by RIDE.
NuttX EABI "buildroot" Toolchain
================================
A GNU GCC-based toolchain is assumed. The PATH environment variable should
be modified to point to the correct path to the Cortex-M3 GCC toolchain (if
different from the default in your PATH variable).
If you have no Cortex-M3 toolchain, one can be downloaded from the NuttX
Bitbucket download site (https://bitbucket.org/nuttx/buildroot/downloads/).
This GNU toolchain builds and executes in the Linux or Cygwin environment.
1. You must have already configured NuttX in <some-dir>/nuttx.::
$ tools/configure.sh nucleo-l432kc:nsh
$ make qconfig
$ V=1 make context all 2>&1 | tee mout
2. Download the latest buildroot package into <some-dir>
3. unpack the buildroot tarball. The resulting directory may
have versioning information on it like buildroot-x.y.z. If so,
rename <some-dir>/buildroot-x.y.z to <some-dir>/buildroot.
4. cd <some-dir>/buildroot
5. cp boards/cortexm3-eabi-defconfig-4.6.3 .config
6. make oldconfig
7. make
8. Make sure that the PATH variable includes the path to the newly built
binaries.
See the file boards/README.txt in the buildroot source tree. That has more
details PLUS some special instructions that you will need to follow if you are
building a Cortex-M3 toolchain for Cygwin under Windows.
NOTE: Unfortunately, the 4.6.3 EABI toolchain is not compatible with the
the NXFLAT tools. See the top-level TODO file (under "Binary loaders") for
more information about this problem. If you plan to use NXFLAT, please do not
use the GCC 4.6.3 EABI toolchain; instead use the GCC 4.3.3 EABI toolchain.
NXFLAT Toolchain
================
If you are *not* using the NuttX buildroot toolchain and you want to use
the NXFLAT tools, then you will still have to build a portion of the buildroot
tools -- just the NXFLAT tools. The buildroot with the NXFLAT tools can
be downloaded from the NuttX Bitbucket download site
(https://bitbucket.org/nuttx/nuttx/downloads/).
This GNU toolchain builds and executes in the Linux or Cygwin environment.
1. You must have already configured NuttX in <some-dir>/nuttx.::
tools/configure.sh lpcxpresso-lpc1768:<sub-dir>
2. Download the latest buildroot package into <some-dir>
3. unpack the buildroot tarball. The resulting directory may
have versioning information on it like buildroot-x.y.z. If so,
rename <some-dir>/buildroot-x.y.z to <some-dir>/buildroot.
4. cd <some-dir>/buildroot
5. cp boards/cortexm3-defconfig-nxflat .config
6. make oldconfig
7. make
8. Make sure that the PATH variable includes the path to the newly built
NXFLAT binaries.
mbed
====
The Nucleo-L432KC includes boot loader from mbed:
https://mbed.org/handbook/Homepage
Using the mbed loader:
1. Connect the Nucleo-L432kc 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-L432kc. The NUCLEO window will
close then re-open and the Nucleo-L432KC will be running the new code.
Hardware
========
LEDs
----
The Nucleo L432KC provides a single user LED, LD3. LD3
is the green LED connected to Arduino signal D13 corresponding to MCU I/O
PB3 (pin 26).
- 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 LED is available:
=================== ======================= ===========
SYMBOL Meaning LD3
=================== ======================= ===========
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 LD3, NuttX has successfully booted and is, apparently, running
normally. If LD3 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 STM32L432KC
----------- ------------
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 STM32L432KC
----------- ------------
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
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.
SPI Flash support:
==================
We can use an external SPI Serial Flash with nucleo-l432kc board. In this
case we tested with AT45DB081D (8Mbit = 1MiB).
You can connect the AT45DB081D memory in the nucleo-l432kc board this way:
======== ===============
Memory nucleo-l432kc
======== ===============
SI D11 (PB5)
SCK D13 (PB3)
RESET 3V3
CS D10 (PA11)
WP 3V3
VCC 3V3
GND GND
SO D12 (PB4)
======== ===============
You can start with default "nucleo-l432kc/nsh" configuration option and
enable/disable these options using "make menuconfig" ::
System Type --->
STM32L4 Peripheral Support --->
[*] SPI1
Device Drivers --->
-*- Memory Technology Device (MTD) Support --->
-*- SPI-based AT45DB flash
(1000000) AT45DB Frequency
File Systems --->
[*] NXFFS file system
Then after compiling and flashing the file nuttx.bin you can test the flash
this way:
nsh> ls /mnt
/mnt:
at45db/
nsh> echo "Testing" > /mnt/at45db/file.txt
nsh> ls /mnt/at45db
/mnt/at45db:
file.txt
nsh> cat /mnt/at45db/file.txt
Testing
nsh>
Configurations
==============
nsh:
----
Configures the NuttShell (nsh) located at apps/examples/nsh for the
Nucleo-L432KC 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 ARM EABI toolchain
for Linux. That can easily be reconfigured, of course.::
CONFIG_HOST_LINUX=y : Builds under Linux
CONFIG_ARM_TOOLCHAIN_GNU_EABI=y : GNU 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 connected
as shown below::
Nucleo CN10 STM32L432KC
----------- ------------
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
spwm
----
Configures the sinusoidal PWM (SPWM) example which presents a simple use case
of the STM32L4 PWM lower-half driver without generic upper-half PWM logic.
It uses TIM1 to generate PWM and TIM6 to change waveform samples
At the moment, the waveform parameters are hardcoded, but it should be easy to
modify this example and make it more functional.
@@ -0,0 +1,238 @@
================
ST Nucleo L452RE
================
This page file discusses the port of NuttX to the STMicro Nucleo-L452RE
board. That board features the STM32L452RET6 MCU with 512KiB of FLASH
and 160KiB of SRAM.
LEDs
====
The Nucleo-64 board has one user controllable LED, User LD2. This green
LED is a user LED connected to Arduino signal D13 corresponding to STM32
I/O PA5 (PB13 on other some other Nucleo-64 boards).
- 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/stm32_autoleds.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.
Buttons
=======
B1 USER: the user button is connected to the I/O PC13 (pin 2) of the STM32
microcontroller.
Serial Console
==============
USART1
------
Pins and Connectors::
RXD: PA10 D3 CN9 pin 3, CN10 pin 33
PB7 CN7 pin 21
TXD: PA9 D8 CN5 pin 1, CN10 pin 21
PB6 D10 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 STM32F072RB
----------- ------------
Pin 21 PA9 USART1_TX *Warning you make need to reverse RX/TX on
Pin 33 PA10 USART1_RX 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 To be provided
PA15
PD6
TXD: PA2
PA14
PD5
See "Virtual COM Port" and "RS-232 Shield" below.
USART3
------
Pins and Connectors::
RXD: PB11 To be provided
PC5
PC11
D9
TXD: PB10
PC4
PC10
D8
USART4
------
Pins and Connectors::
RXD: PA1 To be provided
PC11
TXD: PA0
PC10
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.
115200 8N1 BAUD should be configure to interface with the Virtual COM
port.
Default
-------
As shipped, SB62 and SB63 are open and SB13 and SB14 closed, so the
virtual COM port is enabled.
RS-232 Shield
-------------
Supports a single RS-232 connected via::
Nucleo STM32F4x1RE Shield
--------- --------------- --------
CN9 Pin 1 PA3 USART2_RXD RXD
CN9 Pin 2 PA2 USART2_TXD TXD
Support for this shield is enabled by selecting USART2 and configuring
SB13, 14, 62, and 63 as described above under "Virtual COM Port"
Configurations
==============
Information Common to All Configurations
----------------------------------------
Each configuration is maintained in a sub-directory and can be
selected as follow::
tools/configure.sh nucleo-l452re:<subdir>
Before building, make sure the PATH environment variable includes the
correct path to the directory than holds your toolchain binaries.
And then build NuttX by simply typing the following. At the conclusion of
the make, the nuttx binary will reside in an ELF file called, simply, nuttx.::
make oldconfig
make
The <subdir> that is provided above as an argument to the tools/configure.sh
must be is one of the following.
NOTES:
1. These configurations use the mconf-based configuration tool. To
change any of these configurations 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. Unless stated otherwise, all configurations generate console
output on USART2, as described above under "Serial Console". The
elevant configuration settings are listed below::
CONFIG_STM32_USART2=y
CONFIG_STM32_USART2_SERIALDRIVER=y
CONFIG_STM32_USART=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
3. All of these configurations are set up to build under Linux using the
"GNU Tools for ARM Embedded Processors" that is maintained by ARM
(unless stated otherwise in the description of the configuration).
https://developer.arm.com/open-source/gnu-toolchain/gnu-rm
That toolchain selection can easily be reconfigured using
'make menuconfig'. Here are the relevant current settings:
Build Setup::
CONFIG_HOST_LINUX=y : Linux environment
System Type -> Toolchain::
CONFIG_ARM_TOOLCHAIN_GNU_EABI=y : GNU ARM EABI toolchain
Configuration sub-directories
-----------------------------
nsh:
----
Configures the NuttShell (nsh) located at examples/nsh. This
configuration is focused on low level, command-line driver testing.
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,256 @@
================
ST Nucleo L496ZG
================
This page discusses issues unique to NuttX configurations for the STMicro
Nucleo-144 board for STM32L4 chips.
Nucleo L496ZG
=============
ST Nucleo L496ZG board from ST Micro is supported. See
http://www.st.com/content/st_com/en/products/evaluation-tools/product-evaluation-tools/mcu-eval-tools/stm32-mcu-eval-tools/stm32-mcu-nucleo/nucleo-l496zg.html
The Nucleo L496ZG order part number is NUCLEO-L496ZG. It is one member of
the STM32 Nucleo-144 board family.
NUCLEO-L496ZG Features
----------------------
- Microprocessor: STM32L496ZGT6 Core: ARM 32-bit Cortex®-M4 CPU with FPU,
80 MHz, MPU, and DSP instructions.
- Memory: 1024 KB Flash 320KB of SRAM (including 64KB of SRAM2)
- ADC: 3×12-bit: up to 24 channels
- DMA: 2 X 7-stream DMA controllers with FIFOs and burst support
- Timers: Up to 13 timers: (2x 16-bit lowpower), two 32-bit timers,
2x watchdogs, SysTick
- GPIO: 114 I/O ports with interrupt capability
- LCD: LCD-TFT Controller, Parallel interface
- I2C: 4 × I2C interfaces (SMBus/PMBus)
- U[S]ARTs: 3 USARTs, 2 UARTs (27 Mbit/s, ISO7816 interface, LIN, IrDA,
modem control)
- SPI/12Ss: 6/3 (simplex) (up to 50 Mbit/s), 3 with muxed simplex I2S
for audio class accuracy via internal audio PLL or external
clock
- QSPI: Dual mode Quad-SPI
- SAIs: 2 Serial Audio Interfaces
- CAN: 2 X CAN interface
- SDMMC interface
- USB: USB 2.0 full-speed device/host/OTG controller with on-chip PHY
- Camera Interface: 8/14 Bit
- CRC calculation unit
- TRG: True random number generator
- RTC
See https://developer.mbed.org/platforms/ST-Nucleo-L496ZG for additional
information about this board.
Hardware
========
Section needs updating
GPIO - there are 144 I/O lines on the STM32L4xxZx with various pins pined out
on the Nucleo 144.
Keep in mind that:
- The I/O is 3.3 Volt not 5 Volt like on the Arduino products.
- The Nucleo-144 board family has 3 pages of Solder Bridges AKA Solder
Blobs (SB) that can alter the factory configuration. We will note SB
in effect but will assume the factory default settings.
Our main concern is establishing a console and LED utilization for
debugging.
Buttons
-------
B1 USER: the user button is connected to the I/O PC13 (Tamper support, SB173
ON and SB180 OFF)
LEDs
----
The Board provides a 3 user LEDs, LD1-LD3
LED1 (Green) PB_0 (SB120 ON and SB119 OFF)
LED2 (Blue) PB_7 (SB139 ON)
LED3 (Red) PB_14 (SP118 ON)
- When the I/O is HIGH value, the LEDs are on.
- When the I/O is LOW, the LEDs are 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/stm32_autoleds.c. The LEDs are used to encode OS
related events as follows when the LEDs are available:
=================== ======================= === ===== ====
SYMBOL Meaning RED GREEN BLUE
=================== ======================= === ===== ====
LED_STARTED NuttX has been started OFF OFF OFF
LED_HEAPALLOCATE Heap has been allocated OFF OFF ON
LED_IRQSENABLED Interrupts enabled OFF ON OFF
LED_STACKCREATED Idle stack created OFF ON ON
LED_INIRQ In an interrupt NC NC ON (momentary)
LED_SIGNAL In a signal handler NC ON OFF (momentary)
LED_ASSERTION An assertion failed ON NC ON (momentary)
LED_PANIC The system has crashed ON OFF OFF (flashing 2Hz)
LED_IDLE MCU is is sleep mode ON OFF OFF
=================== ======================= === ===== ====
OFF - means that the OS is still initializing. Initialization is very fast
so if you see this at all, it probably means that the system is
hanging up somewhere in the initialization phases.
GREEN - This means that the OS completed initialization.
BLUE - Whenever and interrupt or signal handler is entered, the BLUE LED is
illuminated and extinguished when the interrupt or signal handler
exits.
VIOLET - If a recovered assertion occurs, the RED and blue LED will be
illuminated briefly while the assertion is handled. You will
probably never see this.
Flashing RED - In the event of a fatal crash, all other LEDs will be
extinguished and RED LED will FLASH at a 2Hz rate.
Thus if the GREEN LED is lit, NuttX has successfully booted and is,
apparently, running normally. If the RED LED is flashing at
approximately 2Hz, then a fatal error has been detected and the system has
halted.
Serial Consoles
===============
USART3
------
Default board is configured to use USART3 as console.
Pins and Connectors::
FUNC GPIO Connector
Pin NAME
---- --- ------- ----
TXD: PC4 CN8-9, A4
RXD: PC5 CN8-11, A5
---- --- ------- ----
You must use a 3.3 TTL to RS-232 converter or a USB to 3.3V TTL::
Nucleo 144 FTDI TTL-232R-3V3
------------- -------------------
TXD - CN8-9 - RXD - Pin 5 (Yellow)
RXD - CN8-11 - TXD - Pin 4 (Orange)
GND - GND Pin 1 (Black)
------------- -------------------
*Note you will be reverse RX/TX
Use make menuconfig to configure USART3 as the console::
CONFIG_STM32L4_USART3=y
CONFIG_USART3_SERIALDRIVER=y
CONFIG_USART3_SERIAL_CONSOLE=y
CONFIG_USART3_RXBUFSIZE=256
CONFIG_USART3_TXBUFSIZE=256
CONFIG_USART3_BAUD=115200
CONFIG_USART3_BITS=8
CONFIG_USART3_PARITY=0
CONFIG_USART3_2STOP=0
USART2
------
USART 2 could be used as console as well.
Virtual COM Port
----------------
Yet another option is to use LPUART1 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. However the LPUART peripheral has not yet
been tested for this board.
Solder Bridges. This configuration requires::
PG7 LPUART1 TX SB131 ON and SB195 OFF (Default)
PG8 LPUART1 RX SB130 ON and SB193 OFF (Default)
Default
-------
As shipped, the virtual COM port is enabled.
SPI
---
Since this board is so generic, having a quick way to vet the SPI
configuration seams in order. So the board provides a quick test
that can be selected vi CONFIG_NUCLEO_SPI_TEST that will initialize
the selected buses (SPI1-SPI3) and send some text on the bus at
application initialization time board_app_initialize.
SDIO
----
To test the SD performance one can use a SparkFun microSD Sniffer
from https://www.sparkfun.com/products/9419 or similar board
and connect it as follows::
VCC V3.3 CN11 16
GND GND CN11-8
CMD PD2 CN11-4
CLK PC12 CN11-3
DAT0 - PC8 CN12-2
DAT1 - PC9 CN12-1
DAT2 PC10 CN11-1
CD PC11 CN11-2
Configurations
==============
nsh
---
Configures the NuttShell (nsh) located at apps/examples/nsh for the
Nucleo-144 boards. The Configuration enables the serial interfaces
on USART6. 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. If this is the initial configuration then execute::
./tools/configure.sh nucleo-l496zg:nsh
in nuttx/ in order to start configuration process.
Caution: Doing this step more than once will overwrite .config with
the contents of the nucleo-l496zg/nsh/defconfig file.
c. Execute 'make oldconfig' in nuttx/ in order to refresh the
configuration.
d. Execute 'make menuconfig' in nuttx/ in order to start the
reconfiguration process.
e. Save the .config file to reuse it in the future starting at step d.
2. By default, this configuration uses the ARM GNU toolchain
for Linux. That can easily be reconfigured, of course.::
CONFIG_HOST_LINUX=y : Builds under Linux
CONFIG_ARM_TOOLCHAIN_GNU_EABI=y : ARM GNU for Linux
3. Although the default console is LPUART1 (which would correspond to
the Virtual COM port) I have done all testing with the console
device configured for USART3 (see instruction above under "Serial
Consoles).
@@ -1,17 +1,16 @@
README
======
===================
ST STEVAL-STLCS01V1
===================
This README discusses issues unique to NuttX configurations for the ST
STEVAL-STLCS01V1 board (SensorTile module) from ST Micro based on
STM32L476JG MCU. The board features:
- LSM6DSM, 6DoF inertial measurement unit (IMU),
- LSM303AGR, 3D accelerometer and 3D magnetometer,
- LPS22HB, pressure sensor,
- MP34DT05-A, omni-directional digital microphone
- BlueNRG-MS, SPI based BLE Network Processor
- LSM6DSM, 6DoF inertial measurement unit (IMU),
- LSM303AGR, 3D accelerometer and 3D magnetometer,
- LPS22HB, pressure sensor,
- MP34DT05-A, omni-directional digital microphone
- BlueNRG-MS, SPI based BLE Network Processor
Refer to https://www.st.com/en/evaluation-tools/steval-stlkt01v1.html for
further information about this board.
@@ -1,53 +1,53 @@
README
======
=============
STM32L476-mdk
=============
This README discusses issues unique to NuttX configurations for STM32L476ME
This page discusses issues unique to NuttX configurations for STM32L476ME
part in the Motorola MDK. This is referred to as the MuC in Motorola
technical documentation.
STM32L476ME:
Microprocessor: 32-bit ARM Cortex M4 at 80MHz STM32L476ME
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 (not connected)
QSPI interface (not connected)
USB: USB 2.0 full-speed device/host/OTG controller with on-chip PHY
CRC calculation unit
RTC
- Microprocessor: 32-bit ARM Cortex M4 at 80MHz STM32L476ME
- 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 (not connected)
- QSPI interface (not connected)
- USB: USB 2.0 full-speed device/host/OTG controller with on-chip PHY
- CRC calculation unit
- RTC
Acronyms
========
MDK is, of course, the Motorola Development Kit.
MuC is the acronym that is used to refer to the STM32L476ME on the MDK
board.
MHB is the acronym given to Toshiba Interface Bridge, part number T6WV7XBG.
See https://toshiba.semicon-storage.com/us/product/assp/interface-bridge.html
NuttX runs the MuC.
MDK is, of course, the Motorola Development Kit.
MuC is the acronym that is used to refer to the STM32L476ME on the MDK board.
MHB is the acronym given to Toshiba Interface Bridge, part number T6WV7XBG.
See https://toshiba.semicon-storage.com/us/product/assp/interface-bridge.html
NuttX runs the MuC.
Flashing
========
The MDK has a built-in FTDI to support flashing from openocd. There are a
few extensions to openocd that haven't been integrated upstream yet. To
flash (or debug) the MDK, you will need the code from:
flash (or debug) the MDK, you will need the code from::
$ git clone https://github.com/MotorolaMobilityLLC/openocd
Refer to detailed OpenOCD build instructions at developer.motorola.com
After building, you can flash the STM32L476 (MuC) with the following
command:
command::
$ openocd -f board/moto_mdk_muc.cfg -c "program nuttx.bin 0x08000000 reset exit"
@@ -58,17 +58,17 @@ Switch B4 must be in the ON position. See the MDK User Guide at
developer.motorola.com for more information on the hardware including the DIP
switches.
Or you can use the GDB server. To start the GDB server:
Or you can use the GDB server. To start the GDB server::
$ openocd -f board/moto_mdk_mu_reset.cfg &
Then start GDB:
Then start GDB::
$ arm-none-linux-gdb
(gdb) target extended-remote localhost:3333
(gdb) set can-use-hw-watchpoints 1
You can load code into FLASH like:
You can load code into FLASH like::
(gdb) mon halt
(gdb) load nuttx
@@ -93,7 +93,7 @@ device at 11500 baud, no parity, 8 bits of data, 1 stop bit (115200 8N1 in
minicom-speak) and with no flow control. Minicom works well.
You will probably need to be super-user in order access the /dev/ttyUSB2
device:
device::
$ sudo minicom mdk
@@ -101,7 +101,7 @@ When mdk is the name of my saved configuration using the above serial
configuration.
The Motorola documentation also mentions picocom. NSH also works well with
picocom:
picocom::
$ sudo apt install picocom
$ sudo picocom -b 115200 /dev/ttyUSB2
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,421 @@
====================
ST STM32L4R9AI-DISCO
====================
This page discusses issues unique to NuttX configurations for the ST
STM32L4R9AI Discovery board from ST Micro. See
https://www.st.com/content/st_com/en/products/evaluation-tools/product-evaluation-tools/mcu-eval-tools/stm32-mcu-eval-tools/stm32-mcu-discovery-kits/32l4r9idiscovery.html
STM32L4R9AI:
- Microprocessor: 32-bit ARM Cortex M4 at 120MHz STM32L4R9AI
- Memory: 2048 KB Flash and 192+64+384 KB SRAM
- ADC: 1x12-bit, 5 MSPS A/D converter: up to 14 external channels
- DAC: 2 channels
- DFSDM: 4 filters, 8 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 131 I/O ports with interrupt capability
- I2C: Up to 4 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
- OCTOSPI interface
- Camera interface
- USB: USB 2.0 full-speed device/host/OTG controller with on-chip PHY
- CRC calculation unit
- RTC
Board features:
- Peripherals: 1 d-pad joystick, 2 x LED, AMOLED display, USC OTG FS,
2 x MEMS Digital Microphones, SAI codec, 16 Mbit PSRAM,
512 Mbit OCTOSPI 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.
mbed
====
The STM32L4R9AI-DISCO includes boot loader from mbed:
https://mbed.org/handbook/Homepage
Using the mbed loader:
1. Connect the board to the host PC using the USB connector.
2. A new file system will appear called DIS_L4R9AI; 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 board. The DIS_L49RAIO window will
close then re-open and the board will be running the new code.
Hardware
========
Buttons
-------
B1 USER: the user button is connected to the I/O PC13 (pin 2) of the STM32
microcontroller.
LEDs
----
The STM32L4R9AI-DISCO board provides two user LEDs, LD1 (orange) and LD2 (green).
PB0 is LD1 (orange)
PH4 is LD2 (green)
- 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/stm32_autoleds.c. The LEDs are used to encode OS-related
events as follows when the green LED (PH4) 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 is on, 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.
U[S]ARTs and 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
Pin 33 PA10 USART1_TX
Pin 20 GND
Pin 8 U5V
=========== ============
Warning you make need to reverse RX/TX on some RS-232 converters
To configure USART1 as the console::
CONFIG_STM32L4_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
TTL to RS-232 converter connection:
=========== ============
Nucleo CN9 STM32F4x1RE
=========== ============
Pin 1 PA3 USART2_RX
Pin 2 PA2 USART2_TX
=========== ============
Warning you make need to reverse RX/TX on 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_STM32L4_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
UART4
-----
Pins and Connectors::
RXD: PA1 -> CN11 D5
TXD: PA0 -> CN17 A4
To configure USART4 as the console::
CONFIG_STM32L4_UART4=y
CONFIG_USART4_SERIALDRIVER=y
CONFIG_USART4_SERIAL_CONSOLE=y
CONFIG_USART4_RXBUFSIZE=512
CONFIG_USART4_TXBUFSIZE=256
CONFIG_USART4_BAUD=2000000
CONFIG_USART4_BITS=8
CONFIG_USART4_PARITY=0
CONFIG_USART4_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.
Segger J-Link
=============
Reference: https://www.segger.com/downloads/application-notes/AN00021
1. Connect J-Link VTref (1) to pin VDD
2. Connect J-Link SWDIO (7) to pin PA13
3. Connect J-Link SWCLK (9) to pin PA14
4. Connect J-Link SWO (13) to pin PB3
5. Connect J-Link RESET (15) to pin NRST
6. Connect J-Link 5V-Supply (19) to pin 5V
7. Connect J-Link GND (4) to pin GND
Jumpers on CN4 (ST-Link) must be removed for external debug.
Configurations
==============
knsh
----
This is identical to the nsh configuration below except that (1) NuttX
is built as a PROTECTED mode, monolithic module and the user applications
are built separately and, as a consequence, (2) some features that are
only available in the FLAT build are disabled.
It is recommends to use a special make command; not just 'make' but make
with the following two arguments::
make pass1 pass2
In the normal case (just 'make'), make will attempt to build both user-
and kernel-mode blobs more or less interleaved. That actual works!
However, for me it is very confusing so I prefer the above make command:
Make the user-space binaries first (pass1), then make the kernel-space
binaries (pass2)
NOTES:
1. At the end of the build, there will be several files in the top-level
NuttX build directory:
PASS1:
nuttx_user.elf - The pass1 user-space ELF file
nuttx_user.hex - The pass1 Intel HEX format file (selected in defconfig)
User.map - Symbols in the user-space ELF file
PASS2:
nuttx - The pass2 kernel-space ELF file
nuttx.hex - The pass2 Intel HEX file (selected in defconfig)
System.map - Symbols in the kernel-space ELF file
The J-Link programmer will except files in .hex, .mot, .srec, and .bin
formats.
2. Combining .hex files. If you plan to use the .hex files with your
debugger or FLASH utility, then you may need to combine the two hex
files into a single .hex file. Here is how you can do that.
a. The 'tail' of the nuttx.hex file should look something like this
(with my comments added)::
$ tail nuttx.hex
# 00, data records
...
:10 9DC0 00 01000000000800006400020100001F0004
:10 9DD0 00 3B005A0078009700B500D400F300110151
:08 9DE0 00 30014E016D0100008D
# 05, Start Linear Address Record
:04 0000 05 0800 0419 D2
# 01, End Of File record
:00 0000 01 FF
Use an editor such as vi to remove the 05 and 01 records.
b. The 'head' of the nuttx_user.hex file should look something like
this (again with my comments added)::
$ head nuttx_user.hex
# 04, Extended Linear Address Record
:02 0000 04 0801 F1
# 00, data records
:10 8000 00 BD89 01084C800108C8110208D01102087E
:10 8010 00 0010 00201C1000201C1000203C16002026
:10 8020 00 4D80 01085D80010869800108ED83010829
...
Nothing needs to be done here. The nuttx_user.hex file should
be fine.
c. Combine the edited nuttx.hex and un-edited nuttx_user.hex
file to produce a single combined hex file:
$ cat nuttx.hex nuttx_user.hex >combined.hex
Then use the combined.hex file with the to write the FLASH image.
If you do this a lot, you will probably want to invest a little time
to develop a tool to automate these steps.
nsh
---
Configures the NuttShell (nsh) located at apps/examples/nsh for the
STM32L4R9AI-DISCO board. The Configuration enables the serial interfaces
on UART4. 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:
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_ARM_TOOLCHAIN_GNU_EABI=y : Generic EABI toolchain for Linux
3. The default console is UART4
4. This example can be used to verify the OTGFS functionality. USB is
not enabled in the default configuration but can be enabled with the
following settings: (TODO: need to test!)::
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
nxhello
-------
A simple NSH example using apps/examples/nxhello, a very simply test of
basic NX functionality.
@@ -0,0 +1,114 @@
==========
ST STM32L4
==========
Supported MCUs
==============
This is a port of NuttX to the STM32L4 Family
Used development boards are the Nucleo L476RG, Nucleo L496ZG,
Nucleo L452RE, Nucleo L432KC, STM32L4VG Discovery and
Motorola MDK.
Most code is copied and adapted from the STM32 and STM32F7 ports.
The various supported STM32L4 families are:
============ ======= ====== ================================
MCU Support Manual Note
============ ======= ====== ================================
STM32L471xx No RM0392
STM32L4X1 Yes RM0394 Subset of STM32L4_STM32L4X3 [1]
STM32L4X2 Yes RM0394 Subset of STM32L4_STM32L4X3 [1]
STM32L4X3 Yes RM0394
STM32L4X5 Yes RM0351 (was RM0395 in past)
STM32L4X6 Yes RM0351
STM32L4XR Yes RM0432 (STM32L4+)
============ ======= ====== ================================
[1]: Please avoid depending on CONFIG_STM32L4_STM32L4X1 and
CONFIG_STM32L4_STM32L4X2 as the MCUs are of the same subfamily
as CONFIG_STM32L4_STM32L4X3.
Peripheral Support
==================
The following list indicates peripherals supported in NuttX:
========== ======= ==============================
Peripheral Support Notes
========== ======= ==============================
IRQs Yes
GPIO Yes
EXTI Yes
HSI Yes
HSE Yes
PLL Yes Works @ 80 MHz
MSI Yes
LSE Yes
RCC Yes
SYSCTL Yes
USART Yes
DMA Yes
SRAM2 Yes
SPI Yes
I2C Yes
RTC Yes
QSPI Yes
CAN Yes
OTGFS Yes
Timers Yes
PM Yes
FSMC No
AES No
RNG Yes
CRC No configurable polynomial
WWDG No
IWDG Yes
SDMMC Yes
ADC Yes
DAC Yes
DMA2D No
========== ======= ==============================
========== ======= ==============================
Peripheral Support Notes
========== ======= ==============================
FIREWALL Yes requires support from ldscript
TSC No
SWP No
LPUART Yes
LPTIM Yes
OPAMP No
COMP Yes
DFSDM Yes
LCD No
SAIPLL Yes
SAI Yes
HASH No
DCMI No
========== ======= ==============================
New peripherals only in STM32L4+:
========== ======= ==============================
Peripheral Support Notes
========== ======= ==============================
DMAMUX1 Yes
DSI No
GFXMMU No
LTDC No
OCTOSPI No
OCTOSPIIOM No
========== ======= ==============================
Supported Boards
================
.. toctree::
:glob:
:maxdepth: 1
boards/*/*
-103
View File
@@ -1,103 +0,0 @@
This is a port of NuttX to the STM32L4 Family
Used development boards are the Nucleo L476RG, Nucleo L496ZG,
Nucleo L452RE, Nucleo L432KC, STM32L4VG Discovery and
Motorola MDK.
Most code is copied and adapted from the STM32 and STM32F7 ports.
The various supported STM32L4 families are:
-----------------------------------------------------------------
| NuttX config | Manual | Chips
|
| Not supported | RM0392 | STM32L471xx
|
| STM32L4_STM32L4X1 | RM0394 | Subset of STM32L4_STM32L4X3 [*]
|
| STM32L4_STM32L4X2 | RM0394 | Subset of STM32L4_STM32L4X3 [*]
|
| STM32L4_STM32L4X3 | RM0394 | STM32L43xxx/44xxx/45xxx/46xxx
|
| STM32L4_STM32L4X5 | RM0351 | STM32L475xx (was RM0395 in past)
|
| STM32L4_STM32L4X6 | RM0351 | STM32L476xx, STM32L486xx,
| STM32L496xx, STM32L4A6xx
|
| STM32L4_STM32L4XR | RM0432 | STM32L4Rxxx, STM32L4Sxxx (STM32L4+)
------------------------------------------------------------------
[*]: Please avoid depending on CONFIG_STM32L4_STM32L4X1 and
CONFIG_STM32L4_STM32L4X2 as the MCUs are of the same subfamily
as CONFIG_STM32L4_STM32L4X3.
TODO list
---------
Peripherals with implementation in STM32 port:
IRQs : OK
GPIO : OK
EXTI : OK
HSI : OK
HSE : OK
PLL : Works @ 80 MHz
MSI : OK
LSE : OK
RCC : All registers defined, peripherals enabled, basic clock working
SYSCTL : All registers defined
USART : OK
DMA : OK
SRAM2 : OK; can be included in MM region or left separate for special app
: purposes
SPI : OK, tested (including DMA)
I2C : works
RTC : works
QSPI : works in polling, interrupt, DMA, and also memory-mapped modes
CAN : OK, tested
OTGFS : dev implemented, tested, outstanding issue with CDCACM
: (ACM_SET_LINE_CODING, but otherwise works); host implemented,
: only build smoke-tested (i.e. builds, but no functional testing
: yet)
Timers : Implemented, with PWM oneshot and freerun, tickless OS support.
: Limited testing (focused on tickless OS so far), PWM and QE tested OK.
PM : TODO, PWR registers defined
FSMC : TODO
AES : TODO
RNG : works
CRC : TODO (configurable polynomial)
WWDG : TODO
IWDG : works
SDMMC : works
ADC : works
DAC : works
DMA2D : TODO (Chrom-Art Accelerator for image manipulation)
New peripherals with implementation to be written from scratch.
These are Low Priority TODO items, unless someone requests or contributes
it.
FIREWALL : Code written, to be tested, requires support from ldscript
TSC : TODO (Touch Screen Controller)
SWP : TODO (Single wire protocol master, to connect with NFC enabled
: SIM cards)
LPUART : Experimental support (Low power UART working with LSE at low
: baud rates)
LPTIM : Code written, to be tested (Low power TIMER)
OPAMP : TODO (Analog operational amplifier)
COMP : There is some code (Analog comparators)
DFSDM : There is some code (Digital Filter for Sigma-Delta Modulators)
LCD : TODO (Segment LCD controller)
SAIPLL : works (PLL For Digital Audio interfaces, and other things)
SAI : There is some code (Digital Audio interfaces, I2S, SPDIF, etc)
HASH : TODO (SHA-1, SHA-224, SHA-256, HMAC)
DCMI : TODO (Digital Camera interfaces)
New peripherals only in STM32L4+:
DMAMUX1 : OK
DSI : TODO
GFXMMU : TODO
LTDC : TODO
OCTOSPI : TODO
OCTOSPIIOM : TODO
File diff suppressed because it is too large Load Diff
-469
View File
@@ -1,469 +0,0 @@
README
======
This README discusses issues unique to NuttX configurations for the ST
Nucleo-l432kc board from ST Micro. See
http://www.st.com/nucleo-l432kc
NucleoL432KC:
Microprocessor: 32-bit ARM Cortex M4 at 80MHz STM32L432KCU6
Memory: 256 KB Flash and 64 KB SRAM
ADC: 1×12-bit, 5 MSPS A/D converter: up to 10 channels
DMA: 16-stream DMA controllers with FIFOs and burst support
Timers: Up to 11 timers: up to five 16-bit, one 32-bit, two low-power
16 bit timers, two watchdog timers, and a SysTick timer
GPIO: Up to 26 I/O ports with interrupt capability, most 5v tolerant
I2C: Up to 2 × I2C interfaces
USARTs: Up to 3 USARTs, 2 UARTs, 1 LPUART
SPIs: Up to 2 SPIs
SAIs: 1 dual-channel audio interface
CAN interface
QSPI interface
USB: USB 2.0 full-speed device/host/OTG controller with on-chip PHY
CRC calculation unit
RTC
Board features:
Peripherals: 1 led
Debug: Serial wire debug and JTAG interfaces via on-board micro-usb stlink v2.1
Expansion I/F Arduino Nano Headers
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-L432KC for more
information about these boards.
Contents
========
- Nucleo-32 Boards
- Development Environment
- GNU Toolchain Options
- IDEs
- NuttX EABI "buildroot" Toolchain
- NXFLAT Toolchain
- Hardware
- Button
- LED
- USARTs and Serial Consoles
- QFN32
- mbed
- SPI Flash support
- Configurations
Nucleo-32 Boards
================
The Nucleo-L432KC is a member of the Nucleo-64 board family. The Nucleo-64
is a standard board for use with several STM32 parts in the LQFP64 package.
Variants include
Order code Targeted STM32
------------- --------------
NUCLEO-F031K6 STM32F031K6T6
NUCLEO-F042K6 STM32F042K6T6
NUCLEO-F303K8 STM32F303K8T6
NUCLEO-L011K4 STM32L011K4T6
NUCLEO-L031K6 STM32L031K6T6
NUCLEO-L432KC STM32L432KCU6
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
toolchains will likely cause problems.
GNU Toolchain Options
=====================
Toolchain Configurations
------------------------
The NuttX make system has been modified to support the following different
toolchain options.
1. The NuttX buildroot Toolchain (see below), or
2. Any generic arm-none-eabi GNU toolchain.
All testing has been conducted using the NuttX CodeSourcery toolchain. To use
a different toolchain, you simply need to modify the configuration. As an
example:
CONFIG_ARM_TOOLCHAIN_GNU_EABI : Generic arm-none-eabi toolchain
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.
Makefile Build
--------------
Under Eclipse, it is pretty easy to set up an "empty makefile project" and
simply use the NuttX makefile to build the system. That is almost for free
under Linux. Under Windows, you will need to set up the "Cygwin GCC" empty
makefile project in order to work with Windows (Google for "Eclipse Cygwin" -
there is a lot of help on the internet).
Using Sourcery CodeBench from http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/overview
Download and install the latest version (as of this writing it was
sourceryg++-2013.05-64-arm-none-eabi)
Import the project from git.
File->import->Git-URI, then import a Exiting code as a Makefile progject
from the working directory the git clone was done to.
Select the Sourcery CodeBench for ARM EABI. N.B. You must do one command line
build, before the make will work in CodeBench.
Native Build
------------
Here are a few tips before you start that effort:
1) Select the toolchain that you will be using in your .config file
2) Start the NuttX build at least one time from the Cygwin command line
before trying to create your project. This is necessary to create
certain auto-generated files and directories that will be needed.
3) Set up include paths: You will need include/, arch/arm/src/stm32,
arch/arm/src/common, arch/arm/src/armv7-m, and sched/.
4) All assembly files need to have the definition option -D __ASSEMBLY__
on the command line.
Startup files will probably cause you some headaches. The NuttX startup file
is arch/arm/src/stm32/stm32_vectors.S. With RIDE, I have to build NuttX
one time from the Cygwin command line in order to obtain the pre-built
startup object needed by RIDE.
NuttX EABI "buildroot" Toolchain
================================
A GNU GCC-based toolchain is assumed. The PATH environment variable should
be modified to point to the correct path to the Cortex-M3 GCC toolchain (if
different from the default in your PATH variable).
If you have no Cortex-M3 toolchain, one can be downloaded from the NuttX
Bitbucket download site (https://bitbucket.org/nuttx/buildroot/downloads/).
This GNU toolchain builds and executes in the Linux or Cygwin environment.
1. You must have already configured NuttX in <some-dir>/nuttx.
$ tools/configure.sh nucleo-l432kc:nsh
$ make qconfig
$ V=1 make context all 2>&1 | tee mout
2. Download the latest buildroot package into <some-dir>
3. unpack the buildroot tarball. The resulting directory may
have versioning information on it like buildroot-x.y.z. If so,
rename <some-dir>/buildroot-x.y.z to <some-dir>/buildroot.
4. cd <some-dir>/buildroot
5. cp boards/cortexm3-eabi-defconfig-4.6.3 .config
6. make oldconfig
7. make
8. Make sure that the PATH variable includes the path to the newly built
binaries.
See the file boards/README.txt in the buildroot source tree. That has more
details PLUS some special instructions that you will need to follow if you are
building a Cortex-M3 toolchain for Cygwin under Windows.
NOTE: Unfortunately, the 4.6.3 EABI toolchain is not compatible with the
the NXFLAT tools. See the top-level TODO file (under "Binary loaders") for
more information about this problem. If you plan to use NXFLAT, please do not
use the GCC 4.6.3 EABI toolchain; instead use the GCC 4.3.3 EABI toolchain.
NXFLAT Toolchain
================
If you are *not* using the NuttX buildroot toolchain and you want to use
the NXFLAT tools, then you will still have to build a portion of the buildroot
tools -- just the NXFLAT tools. The buildroot with the NXFLAT tools can
be downloaded from the NuttX Bitbucket download site
(https://bitbucket.org/nuttx/nuttx/downloads/).
This GNU toolchain builds and executes in the Linux or Cygwin environment.
1. You must have already configured NuttX in <some-dir>/nuttx.
tools/configure.sh lpcxpresso-lpc1768:<sub-dir>
2. Download the latest buildroot package into <some-dir>
3. unpack the buildroot tarball. The resulting directory may
have versioning information on it like buildroot-x.y.z. If so,
rename <some-dir>/buildroot-x.y.z to <some-dir>/buildroot.
4. cd <some-dir>/buildroot
5. cp boards/cortexm3-defconfig-nxflat .config
6. make oldconfig
7. make
8. Make sure that the PATH variable includes the path to the newly built
NXFLAT binaries.
mbed
====
The Nucleo-L432KC includes boot loader from mbed:
https://mbed.org/handbook/Homepage
Using the mbed loader:
1. Connect the Nucleo-L432kc 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-L432kc. The NUCLEO window will
close then re-open and the Nucleo-L432KC will be running the new code.
Hardware
========
LEDs
----
The Nucleo L432KC provides a single user LED, LD3. LD3
is the green LED connected to Arduino signal D13 corresponding to MCU I/O
PB3 (pin 26).
- 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 LED is available:
SYMBOL Meaning LD3
------------------- ----------------------- -----------
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 LD3, NuttX has successfully booted and is, apparently, running
normally. If LD3 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 STM32L432KC
----------- ------------
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 STM32L432KC
----------- ------------
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
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.
SPI Flash support:
=====================
We can use an external SPI Serial Flash with nucleo-l432kc board. In this
case we tested with AT45DB081D (8Mbit = 1MiB).
You can connect the AT45DB081D memory in the nucleo-l432kc board this way:
--------------------------------
| Memory nucleo-l432kc |
|------------------------------|
| SI ---> D11 (PB5) |
| SCK ---> D13 (PB3) |
| /RESET ---> 3V3 |
| /CS ---> D10 (PA11) |
| /WP ---> 3V3 |
| VCC ---> 3V3 |
| GND ---> GND |
| SO ---> D12 (PB4) |
--------------------------------
You can start with default "nucleo-l432kc/nsh" configuration option and
enable/disable these options using "make menuconfig" :
System Type --->
STM32L4 Peripheral Support --->
[*] SPI1
Device Drivers --->
-*- Memory Technology Device (MTD) Support --->
-*- SPI-based AT45DB flash
(1000000) AT45DB Frequency
File Systems --->
[*] NXFFS file system
Then after compiling and flashing the file nuttx.bin you can test the flash
this way:
nsh> ls /mnt
/mnt:
at45db/
nsh> echo "Testing" > /mnt/at45db/file.txt
nsh> ls /mnt/at45db
/mnt/at45db:
file.txt
nsh> cat /mnt/at45db/file.txt
Testing
nsh>
Configurations
==============
nsh:
---------
Configures the NuttShell (nsh) located at apps/examples/nsh for the
Nucleo-L432KC 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 ARM EABI toolchain
for Linux. That can easily be reconfigured, of course.
CONFIG_HOST_LINUX=y : Builds under Linux
CONFIG_ARM_TOOLCHAIN_GNU_EABI=y : GNU 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 connected
as shown below:
Nucleo CN10 STM32L432KC
----------- ------------
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
spwm
----
Configures the sinusoidal PWM (SPWM) example which presents a simple use case
of the STM32L4 PWM lower-half driver without generic upper-half PWM logic.
It uses TIM1 to generate PWM and TIM6 to change waveform samples
At the moment, the waveform parameters are hardcoded, but it should be easy to
modify this example and make it more functional.
-268
View File
@@ -1,268 +0,0 @@
Nucleo-L452RE README
====================
This README file discusses the port of NuttX to the STMicro Nucleo-L452RE
board. That board features the STM32L452RET6 MCU with 512KiB of FLASH
and 160KiB of SRAM.
Contents
========
- Status
- Nucleo-64 Boards
- LEDs
- Buttons
- Serial Console
- Configurations
Status
======
2017-05-04: The board now boots and the basic NSH configurations works
without problem.
Nucleo-64 Boards
================
The Nucleo-L452RE is a member of the Nucleo-64 board family. The Nucleo-64
is a standard board for use with several STM32 parts in the LQFP64 package.
Variants including:
Order code Targeted STM32
------------- --------------
NUCLEO-F030R8 STM32F030R8T6
NUCLEO-F070RB STM32F070RBT6
NUCLEO-F072RB STM32F072RBT6
NUCLEO-F091RC STM32F091RCT6
NUCLEO-F103RB STM32F103RBT6
NUCLEO-F302R8 STM32F302R8T6
NUCLEO-F303RE STM32F303RET6
NUCLEO-F334R8 STM32F334R8T6
NUCLEO-F401RE STM32F401RET6
NUCLEO-F410RB STM32F410RBT6
NUCLEO-F411RE STM32F411RET6
NUCLEO-F446RE STM32F446RET6
NUCLEO-L053R8 STM32L053R8T6
NUCLEO-L073RZ STM32L073RZT6
NUCLEO-L152RE STM32L152RET6
NUCLEO-L452RE STM32L452RET6
NUCLEO-L476RG STM32L476RGT6
LEDs
====
The Nucleo-64 board has one user controllable LED, User LD2. This green
LED is a user LED connected to Arduino signal D13 corresponding to STM32
I/O PA5 (PB13 on other some other Nucleo-64 boards).
- 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/stm32_autoleds.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.
Buttons
=======
B1 USER: the user button is connected to the I/O PC13 (pin 2) of the STM32
microcontroller.
Serial Console
==============
USART1
------
Pins and Connectors:
RXD: PA10 D3 CN9 pin 3, CN10 pin 33
PB7 CN7 pin 21
TXD: PA9 D8 CN5 pin 1, CN10 pin 21
PB6 D10 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 STM32F072RB
----------- ------------
Pin 21 PA9 USART1_TX *Warning you make need to reverse RX/TX on
Pin 33 PA10 USART1_RX 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 To be provided
PA15
PD6
TXD: PA2
PA14
PD5
See "Virtual COM Port" and "RS-232 Shield" below.
USART3
------
Pins and Connectors:
RXD: PB11 To be provided
PC5
PC11
D9
TXD: PB10
PC4
PC10
D8
USART3
------
Pins and Connectors:
RXD: PA1 To be provided
PC11
TXD: PA0
PC10
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.
115200 8N1 BAUD should be configure to interface with the Virtual COM
port.
Default
-------
As shipped, SB62 and SB63 are open and SB13 and SB14 closed, so the
virtual COM port is enabled.
RS-232 Shield
-------------
Supports a single RS-232 connected via
Nucleo STM32F4x1RE Shield
--------- --------------- --------
CN9 Pin 1 PA3 USART2_RXD RXD
CN9 Pin 2 PA2 USART2_TXD TXD
Support for this shield is enabled by selecting USART2 and configuring
SB13, 14, 62, and 63 as described above under "Virtual COM Port"
Configurations
==============
Information Common to All Configurations
----------------------------------------
Each configuration is maintained in a sub-directory and can be
selected as follow:
tools/configure.sh nucleo-l452re:<subdir>
Before building, make sure the PATH environment variable includes the
correct path to the directory than holds your toolchain binaries.
And then build NuttX by simply typing the following. At the conclusion of
the make, the nuttx binary will reside in an ELF file called, simply, nuttx.
make oldconfig
make
The <subdir> that is provided above as an argument to the tools/configure.sh
must be is one of the following.
NOTES:
1. These configurations use the mconf-based configuration tool. To
change any of these configurations 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. Unless stated otherwise, all configurations generate console
output on USART2, as described above under "Serial Console". The
elevant configuration settings are listed below:
CONFIG_STM32_USART2=y
CONFIG_STM32_USART2_SERIALDRIVER=y
CONFIG_STM32_USART=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
3. All of these configurations are set up to build under Linux using the
"GNU Tools for ARM Embedded Processors" that is maintained by ARM
(unless stated otherwise in the description of the configuration).
https://developer.arm.com/open-source/gnu-toolchain/gnu-rm
That toolchain selection can easily be reconfigured using
'make menuconfig'. Here are the relevant current settings:
Build Setup:
CONFIG_HOST_LINUX=y : Linux environment
System Type -> Toolchain:
CONFIG_ARM_TOOLCHAIN_GNU_EABI=y : GNU ARM EABI toolchain
Configuration sub-directories
-----------------------------
nsh:
Configures the NuttShell (nsh) located at examples/nsh. This
configuration is focused on low level, command-line driver testing.
File diff suppressed because it is too large Load Diff
-299
View File
@@ -1,299 +0,0 @@
README
======
This README discusses issues unique to NuttX configurations for the STMicro
Nucleo-144 board for STM32L4 chips.
Contents
========
- Nucleo-144 Boards
- Nucleo L496ZG
- Hardware
- Button
- LED
- U[S]ARTs and Serial Consoles
- SPI
- SDIO - MMC
- SPI Test
- Configurations
nsh
Nucleo-144 Boards:
=================
The Nucleo-144 is a standard board for use with several STM32 parts in the
LQFP144 package. Variants with a STM32L4 MCU include:
STM32 Part Board Variant Name
------------- ------------------
STM32L496ZGT6 NUCLEO-L496ZG
STM32L496ZGT6P NUCLEO-L496ZG-P
STM32L4A6ZGT6 NUCLEO-L4A6ZG
STM32L4R5ZIT6 NUCLEO-L4R5ZI
STM32L4R5ZIT6P NUCLEO-L4R5ZI-P
------------- ------------------
This directory supports only the STM32L4 variants of Nucleo-144. For others,
see boards/arm/stm32f7/nucleo-144 configuration.
Please read the User Manual UM2179: Getting started with STM32 Nucleo board
software development tools and take note of the Powering options for the
board (6.3 Power supply and power selection) and the Solder bridges based
hardware configuration changes that are configurable (6.11 Solder bridges).
Also note that UM1727 is not valid for L4 Nucleo-144 boards!
Common Board Features:
---------------------
Peripherals: 8 leds, 2 push button (3 LEDs, 1 button) under software
control
Debug: STLINK/V2-1 debugger/programmer Uses a STM32F103CB to
provide a ST-Link for programming, debug similar to the
OpenOcd FTDI function - USB to JTAG front-end.
Expansion I/F: ST Zio and Extended Ardino and Morpho Headers
Nucleo L496ZG
=============
ST Nucleo L496ZG board from ST Micro is supported. See
http://www.st.com/content/st_com/en/products/evaluation-tools/product-evaluation-tools/mcu-eval-tools/stm32-mcu-eval-tools/stm32-mcu-nucleo/nucleo-l496zg.html
The Nucleo L496ZG order part number is NUCLEO-L496ZG. It is one member of
the STM32 Nucleo-144 board family.
NUCLEO-L496ZG Features:
----------------------
Microprocessor: STM32L496ZGT6 Core: ARM 32-bit Cortex®-M4 CPU with FPU,
80 MHz, MPU, and DSP instructions.
Memory: 1024 KB Flash 320KB of SRAM (including 64KB of SRAM2)
ADC: 3×12-bit: up to 24 channels
DMA: 2 X 7-stream DMA controllers with FIFOs and burst support
Timers: Up to 13 timers: (2x 16-bit lowpower), two 32-bit timers,
2x watchdogs, SysTick
GPIO: 114 I/O ports with interrupt capability
LCD: LCD-TFT Controller, Parallel interface
I2C: 4 × I2C interfaces (SMBus/PMBus)
U[S]ARTs: 3 USARTs, 2 UARTs (27 Mbit/s, ISO7816 interface, LIN, IrDA,
modem control)
SPI/12Ss: 6/3 (simplex) (up to 50 Mbit/s), 3 with muxed simplex I2S
for audio class accuracy via internal audio PLL or external
clock
QSPI: Dual mode Quad-SPI
SAIs: 2 Serial Audio Interfaces
CAN: 2 X CAN interface
SDMMC interface
USB: USB 2.0 full-speed device/host/OTG controller with on-chip
PHY
Camera Interface: 8/14 Bit
CRC calculation unit
TRG: True random number generator
RTC
See https://developer.mbed.org/platforms/ST-Nucleo-L496ZG for additional
information about this board.
Hardware
========
< Section needs updating >
GPIO - there are 144 I/O lines on the STM32L4xxZx with various pins pined out
on the Nucleo 144.
Keep in mind that:
1) The I/O is 3.3 Volt not 5 Volt like on the Arduino products.
2) The Nucleo-144 board family has 3 pages of Solder Bridges AKA Solder
Blobs (SB) that can alter the factory configuration. We will note SB
in effect but will assume the factory default settings.
Our main concern is establishing a console and LED utilization for
debugging.
Buttons
-------
B1 USER: the user button is connected to the I/O PC13 (Tamper support, SB173
ON and SB180 OFF)
LEDs
----
The Board provides a 3 user LEDs, LD1-LD3
LED1 (Green) PB_0 (SB120 ON and SB119 OFF)
LED2 (Blue) PB_7 (SB139 ON)
LED3 (Red) PB_14 (SP118 ON)
- When the I/O is HIGH value, the LEDs are on.
- When the I/O is LOW, the LEDs are 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/stm32_autoleds.c. The LEDs are used to encode OS
related events as follows when the LEDs are available:
SYMBOL Meaning RED GREEN BLUE
------------------- ----------------------- --- ----- ----
LED_STARTED NuttX has been started OFF OFF OFF
LED_HEAPALLOCATE Heap has been allocated OFF OFF ON
LED_IRQSENABLED Interrupts enabled OFF ON OFF
LED_STACKCREATED Idle stack created OFF ON ON
LED_INIRQ In an interrupt NC NC ON (momentary)
LED_SIGNAL In a signal handler NC ON OFF (momentary)
LED_ASSERTION An assertion failed ON NC ON (momentary)
LED_PANIC The system has crashed ON OFF OFF (flashing 2Hz)
LED_IDLE MCU is is sleep mode ON OFF OFF
OFF - means that the OS is still initializing. Initialization is very fast
so if you see this at all, it probably means that the system is
hanging up somewhere in the initialization phases.
GREEN - This means that the OS completed initialization.
BLUE - Whenever and interrupt or signal handler is entered, the BLUE LED is
illuminated and extinguished when the interrupt or signal handler
exits.
VIOLET - If a recovered assertion occurs, the RED and blue LED will be
illuminated briefly while the assertion is handled. You will
probably never see this.
Flashing RED - In the event of a fatal crash, all other LEDs will be
extinguished and RED LED will FLASH at a 2Hz rate.
Thus if the GREEN LED is lit, NuttX has successfully booted and is,
apparently, running normally. If the RED LED is flashing at
approximately 2Hz, then a fatal error has been detected and the system has
halted.
Serial Consoles
===============
USART3
------
Default board is configured to use USART3 as console.
Pins and Connectors:
FUNC GPIO Connector
Pin NAME
---- --- ------- ----
TXD: PC4 CN8-9, A4
RXD: PC5 CN8-11, A5
---- --- ------- ----
You must use a 3.3 TTL to RS-232 converter or a USB to 3.3V TTL
Nucleo 144 FTDI TTL-232R-3V3
------------- -------------------
TXD - CN8-9 - RXD - Pin 5 (Yellow)
RXD - CN8-11 - TXD - Pin 4 (Orange)
GND - GND Pin 1 (Black)
------------- -------------------
*Note you will be reverse RX/TX
Use make menuconfig to configure USART3 as the console:
CONFIG_STM32L4_USART3=y
CONFIG_USART3_SERIALDRIVER=y
CONFIG_USART3_SERIAL_CONSOLE=y
CONFIG_USART3_RXBUFSIZE=256
CONFIG_USART3_TXBUFSIZE=256
CONFIG_USART3_BAUD=115200
CONFIG_USART3_BITS=8
CONFIG_USART3_PARITY=0
CONFIG_USART3_2STOP=0
USART2
------
USART 2 could be used as console as well.
Virtual COM Port
----------------
Yet another option is to use LPUART1 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. However the LPUART peripheral has not yet
been tested for this board.
Solder Bridges. This configuration requires:
PG7 LPUART1 TX SB131 ON and SB195 OFF (Default)
PG8 LPUART1 RX SB130 ON and SB193 OFF (Default)
Default
-------
As shipped, the virtual COM port is enabled.
SPI
---
Since this board is so generic, having a quick way to vet the SPI
configuration seams in order. So the board provides a quick test
that can be selected vi CONFIG_NUCLEO_SPI_TEST that will initialize
the selected buses (SPI1-SPI3) and send some text on the bus at
application initialization time board_app_initialize.
SDIO
----
To test the SD performance one can use a SparkFun microSD Sniffer
from https://www.sparkfun.com/products/9419 or similar board
and connect it as follows:
VCC V3.3 CN11 16
GND GND CN11-8
CMD PD2 CN11-4
CLK PC12 CN11-3
DAT0 - PC8 CN12-2
DAT1 - PC9 CN12-1
DAT2 PC10 CN11-1
CD PC11 CN11-2
Configurations
==============
nsh:
----
Configures the NuttShell (nsh) located at apps/examples/nsh for the
Nucleo-144 boards. The Configuration enables the serial interfaces
on USART6. 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. If this is the initial configuration then execute
./tools/configure.sh nucleo-l496zg:nsh
in nuttx/ in order to start configuration process.
Caution: Doing this step more than once will overwrite .config with
the contents of the nucleo-l496zg/nsh/defconfig file.
c. Execute 'make oldconfig' in nuttx/ in order to refresh the
configuration.
d. Execute 'make menuconfig' in nuttx/ in order to start the
reconfiguration process.
e. Save the .config file to reuse it in the future starting at step d.
2. By default, this configuration uses the ARM GNU toolchain
for Linux. That can easily be reconfigured, of course.
CONFIG_HOST_LINUX=y : Builds under Linux
CONFIG_ARM_TOOLCHAIN_GNU_EABI=y : ARM GNU for Linux
3. Although the default console is LPUART1 (which would correspond to
the Virtual COM port) I have done all testing with the console
device configured for USART3 (see instruction above under "Serial
Consoles).
File diff suppressed because it is too large Load Diff
@@ -1,414 +0,0 @@
README
======
This README discusses issues unique to NuttX configurations for the ST
STM32L4R9AI Discovery board from ST Micro. See
https://www.st.com/content/st_com/en/products/evaluation-tools/product-evaluation-tools/mcu-eval-tools/stm32-mcu-eval-tools/stm32-mcu-discovery-kits/32l4r9idiscovery.html
STM32L4R9AI:
Microprocessor: 32-bit ARM Cortex M4 at 120MHz STM32L4R9AI
Memory: 2048 KB Flash and 192+64+384 KB SRAM
ADC: 1x12-bit, 5 MSPS A/D converter: up to 14 external channels
DAC: 2 channels
DFSDM: 4 filters, 8 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 131 I/O ports with interrupt capability
I2C: Up to 4 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
OCTOSPI interface
Camera interface
USB: USB 2.0 full-speed device/host/OTG controller with on-chip PHY
CRC calculation unit
RTC
Board features:
Peripherals: 1 d-pad joystick, 2 x LED, AMOLED display, USC OTG FS,
2 x MEMS Digital Microphones, SAI codec, 16 Mbit PSRAM,
512 Mbit OCTOSPI 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.
Contents
========
- mbed
- Hardware
- Button
- LED
- U[S]ARTs and Serial Consoles
- Segger J-Link
- LQFP64
- Configurations
mbed
====
The STM32L4R9AI-DISCO includes boot loader from mbed:
https://mbed.org/handbook/Homepage
Using the mbed loader:
1. Connect the board to the host PC using the USB connector.
2. A new file system will appear called DIS_L4R9AI; 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 board. The DIS_L49RAIO window will
close then re-open and the board will be running the new code.
Hardware
========
Buttons
-------
B1 USER: the user button is connected to the I/O PC13 (pin 2) of the STM32
microcontroller.
LEDs
----
The STM32L4R9AI-DISCO board provides two user LEDs, LD1 (orange) and LD2 (green).
PB0 is LD1 (orange)
PH4 is LD2 (green)
- 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/stm32_autoleds.c. The LEDs are used to encode OS-related
events as follows when the green LED (PH4) 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 is on, 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.
U[S]ARTs and 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_STM32L4_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
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_STM32L4_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
UART4
------
Pins and Connectors:
RXD: PA1 -> CN11 D5
TXD: PA0 -> CN17 A4
To configure USART4 as the console:
CONFIG_STM32L4_UART4=y
CONFIG_USART4_SERIALDRIVER=y
CONFIG_USART4_SERIAL_CONSOLE=y
CONFIG_USART4_RXBUFSIZE=512
CONFIG_USART4_TXBUFSIZE=256
CONFIG_USART4_BAUD=2000000
CONFIG_USART4_BITS=8
CONFIG_USART4_PARITY=0
CONFIG_USART4_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.
Segger J-Link
=============
Reference: https://www.segger.com/downloads/application-notes/AN00021
1. Connect J-Link VTref (1) to pin VDD
2. Connect J-Link SWDIO (7) to pin PA13
3. Connect J-Link SWCLK (9) to pin PA14
4. Connect J-Link SWO (13) to pin PB3
5. Connect J-Link RESET (15) to pin NRST
6. Connect J-Link 5V-Supply (19) to pin 5V
7. Connect J-Link GND (4) to pin GND
Jumpers on CN4 (ST-Link) must be removed for external debug.
Configurations
==============
knsh:
----
This is identical to the nsh configuration below except that (1) NuttX
is built as a PROTECTED mode, monolithic module and the user applications
are built separately and, as a consequence, (2) some features that are
only available in the FLAT build are disabled.
It is recommends to use a special make command; not just 'make' but make
with the following two arguments:
make pass1 pass2
In the normal case (just 'make'), make will attempt to build both user-
and kernel-mode blobs more or less interleaved. That actual works!
However, for me it is very confusing so I prefer the above make command:
Make the user-space binaries first (pass1), then make the kernel-space
binaries (pass2)
NOTES:
1. At the end of the build, there will be several files in the top-level
NuttX build directory:
PASS1:
nuttx_user.elf - The pass1 user-space ELF file
nuttx_user.hex - The pass1 Intel HEX format file (selected in defconfig)
User.map - Symbols in the user-space ELF file
PASS2:
nuttx - The pass2 kernel-space ELF file
nuttx.hex - The pass2 Intel HEX file (selected in defconfig)
System.map - Symbols in the kernel-space ELF file
The J-Link programmer will except files in .hex, .mot, .srec, and .bin
formats.
2. Combining .hex files. If you plan to use the .hex files with your
debugger or FLASH utility, then you may need to combine the two hex
files into a single .hex file. Here is how you can do that.
a. The 'tail' of the nuttx.hex file should look something like this
(with my comments added):
$ tail nuttx.hex
# 00, data records
...
:10 9DC0 00 01000000000800006400020100001F0004
:10 9DD0 00 3B005A0078009700B500D400F300110151
:08 9DE0 00 30014E016D0100008D
# 05, Start Linear Address Record
:04 0000 05 0800 0419 D2
# 01, End Of File record
:00 0000 01 FF
Use an editor such as vi to remove the 05 and 01 records.
b. The 'head' of the nuttx_user.hex file should look something like
this (again with my comments added):
$ head nuttx_user.hex
# 04, Extended Linear Address Record
:02 0000 04 0801 F1
# 00, data records
:10 8000 00 BD89 01084C800108C8110208D01102087E
:10 8010 00 0010 00201C1000201C1000203C16002026
:10 8020 00 4D80 01085D80010869800108ED83010829
...
Nothing needs to be done here. The nuttx_user.hex file should
be fine.
c. Combine the edited nuttx.hex and un-edited nuttx_user.hex
file to produce a single combined hex file:
$ cat nuttx.hex nuttx_user.hex >combined.hex
Then use the combined.hex file with the to write the FLASH image.
If you do this a lot, you will probably want to invest a little time
to develop a tool to automate these steps.
nsh:
---
Configures the NuttShell (nsh) located at apps/examples/nsh for the
STM32L4R9AI-DISCO board. The Configuration enables the serial interfaces
on UART4. 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:
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_ARM_TOOLCHAIN_GNU_EABI=y : Generic EABI toolchain for Linux
3. The default console is UART4
4. This example can be used to verify the OTGFS functionality. USB is
not enabled in the default configuration but can be enabled with the
following settings: (TODO: need to test!)
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
nxhello:
-------
A simple NSH example using apps/examples/nxhello, a very simply test of
basic NX functionality.