Skip to content
This repository was archived by the owner on Nov 5, 2019. It is now read-only.

Commit 0134da2

Browse files
committed
nucleo-f411re board added
1 parent d230e49 commit 0134da2

File tree

1 file changed

+36
-12
lines changed

1 file changed

+36
-12
lines changed

hw/arm/stm32-nucleo-boards.c

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -87,24 +87,48 @@ static void nucleo_l152re_board_init_callback(MachineState *machine)
8787
}
8888
#endif
8989

90-
#if 0
91-
// Disabled due to HAL clock init problems when no clock is defined.
9290
/* ----- ST NUCLEO-F411RE ----- */
93-
static void nucleo_f411re_board_init_callback(MachineState *machine);
94-
95-
static QEMUMachine nucleo_f411re_machine = {
96-
.name = "NUCLEO-F411RE",
97-
.desc = "ST Nucleo Development Board for STM32 F4 series (Experimental)",
98-
.init = nucleo_f411re_board_init_callback};
91+
static GPIOLEDInfo nucleo_f411re_leds_info[] = {
92+
{
93+
.name = "green-led",
94+
.active_low = false,
95+
.colour_message = "Green",
96+
.x = 316,
97+
.y = 307,
98+
.w = 8,
99+
.h = 6,
100+
.gpio_path = "/machine/mcu/stm32/gpio[a]",
101+
.port_bit = 5, },
102+
{ }, /**/
103+
};
99104

100105
static void nucleo_f411re_board_init_callback(MachineState *machine)
101106
{
102107
cm_board_greeting(machine);
103-
//cortexm_mcu_alloc(machine, TYPE_STM32F411RE);
104108

105-
/* TODO: Add board inits */
109+
{
110+
/* Create the MCU */
111+
Object *mcu = cm_object_new_mcu(machine, TYPE_STM32F411RE);
112+
113+
/* The board has no oscillators. */
114+
cm_object_property_set_int(mcu, 0, "hse-freq-hz"); /* N/A */
115+
cm_object_property_set_int(mcu, 0, "lse-freq-hz"); /* N/A */
116+
117+
cm_object_realize(mcu);
118+
}
119+
120+
void *board_surface = cm_board_init_image("NUCLEO-F411RE.jpg",
121+
cm_board_get_desc(machine));
122+
123+
Object *peripheral = cm_container_get_peripheral();
124+
gpio_led_create_from_info(peripheral, nucleo_f411re_leds_info,
125+
board_surface);
106126
}
107-
#endif
127+
128+
static QEMUMachine nucleo_f411re_machine = {
129+
.name = "NUCLEO-F411RE",
130+
.desc = "ST Nucleo Development Board for STM32 F4 series",
131+
.init = nucleo_f411re_board_init_callback };
108132

109133
#if 0
110134
/* ----- ST NUCLEO-F334R8 ----- */
@@ -128,9 +152,9 @@ static void nucleo_f334r8_board_init_callback(MachineState *machine)
128152
static void stm32_machines_init(void)
129153
{
130154
qemu_register_machine(&nucleo_f103rb_machine);
155+
qemu_register_machine(&nucleo_f411re_machine);
131156
#if 0
132157
qemu_register_machine(&nucleo_l152re_machine);
133-
qemu_register_machine(&nucleo_f411re_machine);
134158
qemu_register_machine(&nucleo_f334r8_machine);
135159
#endif
136160
}

0 commit comments

Comments
 (0)