Nucleo-F401RE: With these changes and the changes from previous commits, the basic Nucleo-F401RE NSH configuration is working.

This commit is contained in:
Gregory Nutt
2014-05-06 11:07:10 -06:00
parent bd7b376e57
commit 35bb403142
2 changed files with 92 additions and 72 deletions
+83 -55
View File
@@ -342,6 +342,18 @@ Serial Consoles
TXD: PA10 CN9 pin 3, CN10 pin 33 TXD: PA10 CN9 pin 3, CN10 pin 33
PB6 CN5 pin 3, CN10 pin 17 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 STM32F401RE
----------- ------------
Pin 21 PA9 USART2_RX
Pin 33 PA10 USART2_TX
Pin 20 GND
Pin 8 U5V
To configure USART1 as the console: To configure USART1 as the console:
CONFIG_STM32_USART1=y CONFIG_STM32_USART1=y
@@ -363,9 +375,9 @@ Serial Consoles
TXD: PA2 CN9 pin 2(See SB13, 14, 62, 63). CN10 pin 35 TXD: PA2 CN9 pin 2(See SB13, 14, 62, 63). CN10 pin 35
PD5 PD5
If you have a 3.3 V TTL to RS-232 converter then this is the most convenient UART2 is the default in all of these configurations.
serial console to use. UART2 is the default in all of these
configurations. TTL to RS-232 converter connection:
Nucleo CN9 STM32F401RE Nucleo CN9 STM32F401RE
----------- ------------ ----------- ------------
@@ -462,78 +474,94 @@ Shields
Configurations Configurations
============== ==============
Composite: The composite is a super set of all the functions in nsh, nsh:
usbserial, usbmsc. (usbnsh has not been rung out). ---
Configures the NuttShell (nsh) located at apps/examples/nsh. 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).
Build it with NOTES:
make distclean;(cd tools;./configure.sh nucleo-f401re/nsh) 1. This configuration uses the mconf-based configuration tool. To
change this configuration using that tool, you should:
then run make menuconfig if you wish to customize things. a. Build and install the kconfig-mconf tool. See nuttx/README.txt
and misc/tools/
or b. Execute 'make menuconfig' in nuttx/ in order to start the
reconfiguration process.
$ make qconfig 2. By default, this configuration uses the CodeSourcery toolchain
for Linux. That can easily be reconfigured, of course.
N.B. Memory is tight, both Flash and RAM are taxed. If you enable CONFIG_HOST_LINUX=y : Builds under Linux
debugging you will need to add -Os following the line -g in the line: CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL=y : CodeSourcery for Linux
ifeq ($(CONFIG_DEBUG_SYMBOLS),y) 3. Although the default console is USART2 (which would correspond to
ARCHOPTIMIZATION = -g 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 converted connected
as shown below:
in the top level Make.degs or the code will not fit. Nucleo CN10 STM32F401RE
----------- ------------
Pin 21 PA9 USART2_RX
Pin 33 PA10 USART2_TX
Pin 20 GND
Pin 8 U5V
Stack space has been hand optimized using the stack coloring by enabling cc3000:
"Stack usage debug hooks" (CONFIG_DEBUG_STACK) in Build Setup-> Debug ------
Options. I have selected values that have 8-16 bytes of headroom with This configuration adds support for the CC3000 Shield.
network debugging on. If you enable more debugging and get a hard fault
or any weirdness like commands hanging. Then the Idle, main or Interrupt
stack my be too small. Stop the target and have a look a memory for a
blown stack: No DEADBEEF at the lowest address of a given stack.
Given the RAM memory constraints it is not possible to be running the Build it with
network and USB CDC/ACM and MSC at the same time. But on the bright
side, you can export the FLASH memory to the PC. Write files on the
Flash. Reboot and mount the FAT FS and run network code that will have
access the files.
You can use the scripts/cdc-acm.inf file to install the windows make distclean;(cd tools;./configure.sh nucleo-f401re/nsh)
composite device.
Network control is facilitated by running the c3b (cc3000basic) application. then run make menuconfig if you wish to customize things.
Run c3b from the nsh prompt. or
+-------------------------------------------+ $ make qconfig
| Nuttx CC3000 Demo Program |
+-------------------------------------------+
01 - Initialize the CC3000 You can use the scripts/cdc-acm.inf file to install the windows
02 - Show RX & TX buffer sizes, & free RAM composite device.
03 - Start Smart Config
04 - Manually connect to AP
05 - Manually add connection profile
06 - List access points
07 - Show CC3000 information
08 - Telnet
Type 01-07 to select above option: Network control is facilitated by running the c3b (cc3000basic) application.
Select 01. Then use 03 and the TI Smart config application running on an Run c3b from the nsh prompt.
IOS or Android device to configure join your network.
Use 07 to see the IP address of the device. +-------------------------------------------+
| Nuttx CC3000 Demo Program |
+-------------------------------------------+
(On the next reboot running c3b 01 the CC3000 will automaticaly rejoin the 01 - Initialize the CC3000
network after the 01 give it a few seconds and enter 07 or 08) 02 - Show RX & TX buffer sizes, & free RAM
03 - Start Smart Config
04 - Manually connect to AP
05 - Manually add connection profile
06 - List access points
07 - Show CC3000 information
08 - Telnet
Use 08 to start Telnet. Then you can connect to the device using the Type 01-07 to select above option:
address listed in command 07.
qq will exit the c3b with the telnet deamon running (if started) Select 01. Then use 03 and the TI Smart config application running on an
IOS or Android device to configure join your network.
Slow.... You will be thinking 300 bps. This is because of packet sizes and Use 07 to see the IP address of the device.
how the select thread runs in the telnet session. Telnet is not the best
showcase for the CC3000, but simply a proof of network connectivity.
http POST and GET should be more efficient. (On the next reboot running c3b 01 the CC3000 will automaticaly rejoin the
network after the 01 give it a few seconds and enter 07 or 08)
Use 08 to start Telnet. Then you can connect to the device using the
address listed in command 07.
qq will exit the c3b with the telnet deamon running (if started)
Slow.... You will be thinking 300 bps. This is because of packet sizes and
how the select thread runs in the telnet session. Telnet is not the best
showcase for the CC3000, but simply a proof of network connectivity.
http POST and GET should be more efficient.
+9 -17
View File
@@ -228,14 +228,19 @@
/* Alternate function pin selections ************************************************/ /* Alternate function pin selections ************************************************/
/* USART1: /* USART1:
* RXD: PA11 CN10 pin 14 * RXD: PA10 CN9 pin 3, CN10 pin 33
* PB7 CN7 pin 21 * PB7 CN7 pin 21
* TXD: PA10 CN9 pin 3, CN10 pin 33 * TXD: PA9 CN5 pin 1, CN10 pin 21
* PB6 CN5 pin 3, CN10 pin 17 * PB6 CN5 pin 3, CN10 pin 17
*/ */
#define GPIO_USART1_RX GPIO_USART1_RX_1 /* PA10 */ #if 1
#define GPIO_USART1_TX GPIO_USART1_TX_2 /* PA9 */ # define GPIO_USART1_RX GPIO_USART1_RX_1 /* PA10 */
# define GPIO_USART1_TX GPIO_USART1_TX_1 /* PA9 */
#else
# define GPIO_USART1_RX GPIO_USART1_RX_2 /* PB7 */
# define GPIO_USART1_TX GPIO_USART1_TX_2 /* PB6 */
#endif
/* USART2: /* USART2:
* RXD: PA3 CN9 pin 1 (See SB13, 14, 62, 63). CN10 pin 37 * RXD: PA3 CN9 pin 1 (See SB13, 14, 62, 63). CN10 pin 37
@@ -259,24 +264,11 @@
#define GPIO_USART6_RX GPIO_USART6_RX_1 /* PC7 */ #define GPIO_USART6_RX GPIO_USART6_RX_1 /* PC7 */
#define GPIO_USART6_TX GPIO_USART6_TX_1 /* PC6 */ #define GPIO_USART6_TX GPIO_USART6_TX_1 /* PC6 */
/* UART8 has no alternate pin config */
/* UART RX DMA configurations */ /* UART RX DMA configurations */
#define DMAMAP_USART1_RX DMAMAP_USART1_RX_2 #define DMAMAP_USART1_RX DMAMAP_USART1_RX_2
#define DMAMAP_USART6_RX DMAMAP_USART6_RX_2 #define DMAMAP_USART6_RX DMAMAP_USART6_RX_2
/* CAN
*
* CAN1 is routed to the onboard transceiver.
* CAN2 is routed to the expansion connector.
*/
#define GPIO_CAN1_RX GPIO_CAN1_RX_3
#define GPIO_CAN1_TX GPIO_CAN1_TX_3
#define GPIO_CAN2_RX GPIO_CAN2_RX_1
#define GPIO_CAN2_TX GPIO_CAN2_TX_2
/* I2C /* I2C
* *
* The optional _GPIO configurations allow the I2C driver to manually * The optional _GPIO configurations allow the I2C driver to manually