Skip to content

Commit 953f7ae

Browse files
1010101001010101Anas Nashif
authored andcommitted
samples/basic/disco: Add support for Nucleo F401RE and A101
The README.txt file is updated with information about wiring and building. A testcase.ini file is also added by this patch. Change-Id: I7354d844ac3dec41f0c9af02ede5da26f3ad0398 Signed-off-by: Flavio Santes <[email protected]>
1 parent 8f96628 commit 953f7ae

File tree

3 files changed

+63
-18
lines changed

3 files changed

+63
-18
lines changed

samples/basic/disco/README.txt

Lines changed: 58 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,75 @@
11
Title: Disco demo
22

3-
Description:
3+
Description
44

55
A simple 'disco' demo. The demo assumes that 2 LEDs are connected to
6-
GPIO outputs of the MCU/board. The sample code is configured to work
7-
on Nucleo-64 F103RB board, with LEDs connected to PB5 and PB8
8-
pins.
6+
GPIO outputs of the MCU/board.
97

10-
After startup, the program looks up a predefined GPIO device (GPIOB),
11-
and configures pins 5 and 8 in output mode. During each iteration of
12-
the main loop, the state of GPIO lines will be changed so that one of
13-
the lines is in high state, while the other is in low, thus switching
14-
the LEDs on and off in an alternating pattern.
8+
After startup, the program looks up a predefined GPIO device defined
9+
by 'PORT', and configures pins 'LED1' and 'LED2' in output mode.
10+
During each iteration of the main loop, the state of GPIO lines will
11+
be changed so that one of the lines is in high state, while the other
12+
is in low, thus switching the LEDs on and off in an alternating
13+
pattern.
14+
15+
This project does not output to the serial console, but instead
16+
causes two LEDs connected to the GPIO device to blink in an
17+
alternating pattern.
1518

1619
--------------------------------------------------------------------------------
1720

18-
Building and Running Project:
21+
Wiring
1922

20-
This microkernel project does not output to the console, but instead
21-
causes two LEDs connected to the GPIO device to blink in an
22-
alternating pattern. It can be built for a nucleo_f103rb board as
23-
follows:
23+
Nucleo-64 F103RB/F401RE boards:
24+
25+
Connect two LEDs to PB5 and PB8 pins. PB5 is mapped to the
26+
Arduino's D4 pin and PB8 to Arduino's D15. For more details about
27+
these boards see:
28+
29+
https://developer.mbed.org/platforms/ST-Nucleo-F103RB/
30+
https://developer.mbed.org/platforms/ST-Nucleo-F401RE/
31+
32+
Arduino 101 (x86):
33+
34+
Connect two LEDs to D4 (IO4) and D7 (IO7) pins. The schematics
35+
for the Arduino 101 board is available at:
36+
37+
https://www.arduino.cc/en/uploads/Main/Arduino101-REV4Schematic.pdf
38+
39+
For Arduino 101's pinmux mapping in Zephyr, see:
40+
41+
boards/x86/arduino_101/pinmux.c
42+
43+
Modify the src/main.c file and set:
44+
45+
#define PORT CONFIG_GPIO_QMSI_0_NAME
46+
/* GPIO_19 is Arduino's D4 */
47+
#define LED1 19
48+
/* GPIO_20 is Arduino's D7 */
49+
#define LED2 20
50+
51+
--------------------------------------------------------------------------------
52+
53+
Building
54+
55+
Nucleo F103RB:
56+
57+
make pristine && make BOARD=nucleo_f103rb
58+
59+
Nucleo F401RE:
60+
61+
make pristine && make BOARD=nucleo_f401re
62+
63+
Arduino 101:
2464

25-
make
65+
make pristine && make BOARD=arduino_101
2666

27-
The code may need adaption before running the code on another board.
67+
The code may need some work before running on another board: set PORT,
68+
LED1 and LED2 according to the board's GPIO configuration.
2869

2970
--------------------------------------------------------------------------------
3071

31-
Troubleshooting:
72+
Troubleshooting
3273

3374
Problems caused by out-dated project information can be addressed by
3475
issuing one of the following commands then rebuilding the project:

samples/basic/disco/prj.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
# use default configuration settings
1+
# nothing here

samples/basic/disco/testcase.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[test]
2+
build_only = true
3+
tags = samples
4+
platform_whitelist = nucleo_f103rb nucleo_f401re

0 commit comments

Comments
 (0)