2017-04-18 16:16:21 +02:00
|
|
|
Nucleo-F072RB README
|
|
|
|
====================
|
|
|
|
|
2017-04-21 16:23:25 +02:00
|
|
|
This README file discusses the port of NuttX to the STMicro Nucleo-F072RB
|
|
|
|
board. That board features the STM32F072RBT6 MCU with 128KiB of FLASH
|
|
|
|
and 16KiB of SRAM.
|
2017-04-18 16:16:21 +02:00
|
|
|
|
|
|
|
Contents
|
|
|
|
========
|
|
|
|
|
2017-04-27 17:26:12 +02:00
|
|
|
- Status
|
2017-04-18 16:16:21 +02:00
|
|
|
- Nucleo-64 Boards
|
|
|
|
- LEDs
|
|
|
|
- Buttons
|
|
|
|
- Serial Console
|
|
|
|
- Configurations
|
|
|
|
|
2017-04-27 17:26:12 +02:00
|
|
|
Status
|
|
|
|
======
|
2017-04-29 23:53:23 +02:00
|
|
|
2017-04-28: After struggling with some clock configuration and FLASH wait
|
|
|
|
state issues, the board now boots and the basic NSH configurations works
|
|
|
|
without problem.
|
2017-04-27 17:26:12 +02:00
|
|
|
|
2017-04-29 23:53:23 +02:00
|
|
|
A USB device driver was added along with support for clocking from the
|
|
|
|
HSI48. That driver remains untested.
|
2017-04-27 17:26:12 +02:00
|
|
|
|
2017-04-30 18:28:16 +02:00
|
|
|
2017-04-30: I tried using the I2C driver with the I2C tool (apps/system/i2c).
|
|
|
|
I may have something wrong, but at present the driver is just timing out
|
|
|
|
on all transfers.
|
|
|
|
|
2017-04-18 16:16:21 +02:00
|
|
|
Nucleo-64 Boards
|
|
|
|
================
|
|
|
|
|
|
|
|
The Nucleo-F072RB 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
|
|
|
|
====
|
|
|
|
|
2020-02-23 09:50:23 +01:00
|
|
|
The Nucleo-64 board has one user controllable LED, User LD2. This green
|
2017-04-18 16:16:21 +02:00
|
|
|
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
|
2017-04-21 16:23:25 +02:00
|
|
|
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:
|
2017-04-18 16:16:21 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2017-04-30 16:02:03 +02:00
|
|
|
See "Virtual COM Port" and "RS-232 Shield" below.
|
|
|
|
|
2017-04-18 16:16:21 +02:00
|
|
|
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.
|
|
|
|
|
2017-04-30 16:02:03 +02:00
|
|
|
115200 8N1 BAUD should be configure to interface with the Virtual COM
|
|
|
|
port.
|
2017-04-18 16:16:21 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
----------------------------------------
|
2017-04-21 16:23:25 +02:00
|
|
|
Each configuration is maintained in a sub-directory and can be
|
2017-04-18 16:16:21 +02:00
|
|
|
selected as follow:
|
|
|
|
|
2019-08-06 00:53:39 +02:00
|
|
|
tools/configure.sh nucleo-f072rb:<subdir>
|
2017-04-18 16:16:21 +02:00
|
|
|
|
2017-04-26 18:12:13 +02:00
|
|
|
Before building, make sure the PATH environment variable includes the
|
|
|
|
correct path to the directory than holds your toolchain binaries.
|
2017-04-18 16:16:21 +02:00
|
|
|
|
|
|
|
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
|
2017-06-28 21:18:41 +02:00
|
|
|
output on USART2, as described above under "Serial Console". The
|
2017-04-18 16:16:21 +02:00
|
|
|
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).
|
|
|
|
|
2017-08-13 15:18:19 +02:00
|
|
|
https://developer.arm.com/open-source/gnu-toolchain/gnu-rm
|
2017-04-18 16:16:21 +02:00
|
|
|
|
|
|
|
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:
|
2022-09-15 12:17:26 +02:00
|
|
|
CONFIG_ARM_TOOLCHAIN_GNU_EABI=y : GNU ARM EABI toolchain
|
2017-04-18 16:16:21 +02:00
|
|
|
|
|
|
|
Configuration sub-directories
|
|
|
|
-----------------------------
|
|
|
|
|
|
|
|
nsh:
|
|
|
|
|
|
|
|
Configures the NuttShell (nsh) located at examples/nsh. This
|
|
|
|
configuration is focused on low level, command-line driver testing.
|
|
|
|
|
|
|
|
NOTES:
|
|
|
|
|
2017-04-19 19:19:40 +02:00
|
|
|
1. This initial release of this configuration was very minimal, but
|
|
|
|
also very small:
|
2017-04-18 16:16:21 +02:00
|
|
|
|
2017-04-19 19:19:40 +02:00
|
|
|
$ size nuttx
|
|
|
|
text data bss dec hex filename
|
|
|
|
32000 92 1172 33264 81f0 nuttx
|
2017-04-18 16:16:21 +02:00
|
|
|
|
2017-04-19 19:19:40 +02:00
|
|
|
The current version, additional features have been enabled: board
|
|
|
|
bring-up initialization, button support, the procfs file system,
|
|
|
|
and NSH built-in application support. The size increased as follows:
|
2017-04-18 16:16:21 +02:00
|
|
|
|
2017-04-19 19:19:40 +02:00
|
|
|
$ size nuttx
|
|
|
|
text data bss dec hex filename
|
|
|
|
40231 92 1208 41531 a23b nuttx
|
2017-04-18 16:16:21 +02:00
|
|
|
|
2017-04-19 19:19:40 +02:00
|
|
|
Those additional features cost about 8KiB FLASH. I believe that is a
|
|
|
|
good use of the STM32F072RB's FLASH, but if you interested in the
|
|
|
|
more minimal configuration, here is what was changed:
|
2017-04-18 16:16:21 +02:00
|
|
|
|
2017-04-19 19:19:40 +02:00
|
|
|
Removed
|
|
|
|
|
|
|
|
CONFIG_BINFMT_DISABLE=y
|
|
|
|
CONFIG_DISABLE_MOUNTPOINT=y
|
|
|
|
CONFIG_NSH_DISABLE_CD=y
|
|
|
|
|
|
|
|
Added:
|
|
|
|
|
|
|
|
CONFIG_ARCH_BUTTONS=y
|
|
|
|
CONFIG_ARCH_IRQBUTTONS=y
|
|
|
|
|
|
|
|
CONFIG_BUILTIN=y
|
|
|
|
|
|
|
|
CONFIG_FS_PROCFS=y
|
|
|
|
CONFIG_NSH_PROC_MOUNTPOINT="/proc"
|
|
|
|
|
2021-08-01 09:00:54 +02:00
|
|
|
CONFIG_BOARDCTL=y
|
2017-04-19 19:19:40 +02:00
|
|
|
CONFIG_NSH_ARCHINIT=y
|
|
|
|
CONFIG_NSH_BUILTIN_APPS=y
|
|
|
|
|
2017-06-28 21:18:41 +02:00
|
|
|
Support for NSH built-in applications is enabled for future use.
|
2017-04-19 19:19:40 +02:00
|
|
|
However, no built applications are enabled in this base configuration.
|
|
|
|
|
|
|
|
2. C++ support for applications is NOT enabled. That could be enabled
|
|
|
|
with the following configuration changes:
|
|
|
|
|
|
|
|
CONFIG_HAVE_CXX=y
|
|
|
|
CONFIG_HAVE_CXXINITIALIZE=y
|
|
|
|
|
2017-08-30 10:40:58 +02:00
|
|
|
And also support for C++ constructors under apps/platform.
|