[riot-notifications] [RIOT-OS/RIOT] boards/stm32f4discovery: Add initial renode support (#15473)

Alexandre Abadie notifications at github.com
Tue Jan 5 17:31:00 CET 2021


@aabadie approved this pull request.

Tested and works like a charm :) 

<details><summary>make BOARD=stm32f4discovery -C examples/hello-world all emulate</summary>

![image](https://user-images.githubusercontent.com/1375137/103671690-8839e780-4f7b-11eb-8315-2efa30537067.png)

![image](https://user-images.githubusercontent.com/1375137/103671732-9b4cb780-4f7b-11eb-84a5-a264e1413b14.png)


```
make: Entering directory '/work/riot/RIOT/examples/hello-world'
Building application "hello-world" for "stm32f4discovery" with MCU "stm32".

"make" -C /work/riot/RIOT/boards/stm32f4discovery
"make" -C /work/riot/RIOT/core
"make" -C /work/riot/RIOT/cpu/stm32
"make" -C /work/riot/RIOT/cpu/cortexm_common
"make" -C /work/riot/RIOT/cpu/cortexm_common/periph
"make" -C /work/riot/RIOT/cpu/stm32/periph
"make" -C /work/riot/RIOT/cpu/stm32/stmclk
"make" -C /work/riot/RIOT/cpu/stm32/vectors
"make" -C /work/riot/RIOT/drivers
"make" -C /work/riot/RIOT/drivers/periph_common
"make" -C /work/riot/RIOT/sys
"make" -C /work/riot/RIOT/sys/auto_init
"make" -C /work/riot/RIOT/sys/malloc_thread_safe
"make" -C /work/riot/RIOT/sys/newlib_syscalls_default
"make" -C /work/riot/RIOT/sys/pm_layered
"make" -C /work/riot/RIOT/sys/stdio_uart
   text	   data	    bss	    dec	    hex	filename
   8984	    112	   2312	  11408	   2c90	/work/riot/RIOT/examples/hello-world/bin/stm32f4discovery/hello-world.elf
renode -e "set image_file '/work/riot/RIOT/examples/hello-world/bin/stm32f4discovery/hello-world.elf'" -e "include @/work/riot/RIOT/boards/stm32f4discovery/dist/board.resc" -e start
Gtk-Message: 17:29:33.938: Failed to load module "canberra-gtk-module"
17:29:35.1428 [INFO] Loaded monitor commands from: /opt/renode/./scripts/monitor.py
17:29:35.5777 [INFO] Including script: /work/riot/RIOT/boards/stm32f4discovery/dist/board.resc
17:29:35.6304 [INFO] System bus created.
17:29:36.5844 [INFO] sysbus: Loaded SVD: /tmp/renode-18048/7e0078b8-9de4-42fb-91d9-0bac7bca649d.tmp. Name: STM32F40x. Description: STM32F40x.
17:29:36.8423 [INFO] sysbus: Loading segment of 8984 bytes length at 0x8000000.
17:29:36.8497 [INFO] sysbus: Loading segment of 1912 bytes length at 0x8002318.
17:29:36.8498 [INFO] sysbus: Loading segment of 512 bytes length at 0x20000000.
17:29:36.9051 [INFO] cpu: Guessing VectorTableOffset value to be 0x8000000.
17:29:36.9197 [INFO] cpu: Setting initial values: PC = 0x800074D, SP = 0x20000200.
17:29:36.9298 [INFO] STM32F4_Discovery: Machine started.
17:29:37.0639 [WARNING] nvic: Unhandled read from offset 0xD94.
17:29:37.0677 [WARNING] nvic: Unhandled write to offset 0xD94, value 0x5.
17:29:37.0803 [WARNING] nvic: Unhandled value written to System Control Register: 0x10.
17:29:37.0804 [WARNING] nvic: Unhandled read from offset 0xD14.
17:29:37.0805 [WARNING] nvic: Unhandled write to offset 0xD14, value 0x200.
17:29:37.0949 [WARNING] rcc: Unhandled write to offset 0x30. Unhandled bits: [11, 13-15] when writing value 0xFFFF. Tags: RESERVED (0x1), RESERVED (0x7).
17:29:37.1077 [WARNING] sysbus: Write of value 0xFFFFFFFF to an unimplemented register GPIOG:MODER (0x40021800) generated from SVD.
17:29:37.1087 [WARNING] sysbus: Write of value 0xFFFFFFFF to an unimplemented register GPIOH:MODER (0x40021C00) generated from SVD.
17:29:37.1089 [WARNING] sysbus: Write of value 0xFFFFFFFF to an unimplemented register GPIOI:MODER (0x40022000) generated from SVD.
17:29:37.1102 [WARNING] rcc: Unhandled write to offset 0xC, value 0x0.
17:29:37.1129 [WARNING] sysbus: Write of value 0x706 to an unimplemented register FLASH:ACR (0x40023C00) generated from SVD.
17:29:37.1137 [WARNING] rcc: Unhandled write to offset 0x4. Unhandled bits: [29] when writing value 0x8402D04. Tags: RESERVED (0x2).
17:29:37.1169 [WARNING] uart2: Unhandled write to offset 0x14, value 0x0.
17:29:37.1459 [WARNING] nvic: Unhandled write to offset 0xD98, value 0x2.
17:29:37.1461 [WARNING] nvic: Unhandled write to offset 0xD9C, value 0x20000280.
17:29:37.1462 [WARNING] nvic: Unhandled write to offset 0xDA0, value 0x16060009.
17:29:56.5986 [INFO] STM32F4_Discovery: Machine paused.
17:29:56.6138 [INFO] STM32F4_Discovery: Disposed.
make: Leaving directory '/work/riot/RIOT/examples/hello-world'
```

</details>

<details><summary>make BOARD=stm32f4discovery -C examples/hello-world emulate debug</summary>

```
make: Entering directory '/work/riot/RIOT/examples/hello-world'
Building application "hello-world" for "stm32f4discovery" with MCU "stm32".

"make" -C /work/riot/RIOT/boards/stm32f4discovery
"make" -C /work/riot/RIOT/core
"make" -C /work/riot/RIOT/cpu/stm32
"make" -C /work/riot/RIOT/cpu/cortexm_common
"make" -C /work/riot/RIOT/cpu/cortexm_common/periph
"make" -C /work/riot/RIOT/cpu/stm32/periph
"make" -C /work/riot/RIOT/cpu/stm32/stmclk
"make" -C /work/riot/RIOT/cpu/stm32/vectors
"make" -C /work/riot/RIOT/drivers
"make" -C /work/riot/RIOT/drivers/periph_common
"make" -C /work/riot/RIOT/sys
"make" -C /work/riot/RIOT/sys/auto_init
"make" -C /work/riot/RIOT/sys/malloc_thread_safe
"make" -C /work/riot/RIOT/sys/newlib_syscalls_default
"make" -C /work/riot/RIOT/sys/pm_layered
"make" -C /work/riot/RIOT/sys/stdio_uart
   text	   data	    bss	    dec	    hex	filename
   8984	    112	   2312	  11408	   2c90	/work/riot/RIOT/examples/hello-world/bin/stm32f4discovery/hello-world.elf
/work/riot/RIOT/dist/tools/emulator/debug.sh stm32f4discovery /work/riot/RIOT/examples/hello-world /work/riot/RIOT/examples/hello-world/bin/stm32f4discovery/hello-world.elf 3333 "-ex \"monitor start\""
Using Renode pid file /tmp/emulator_pid.tM8KEbErXK
Reading symbols from /work/riot/RIOT/examples/hello-world/bin/stm32f4discovery/hello-world.elf...
renode -e "set image_file '/work/riot/RIOT/examples/hello-world/bin/stm32f4discovery/hello-world.elf'" -e "include @/work/riot/RIOT/boards/stm32f4discovery/dist/board.resc" --pid-file /tmp/emulator_pid.tM8KEbErXK -e "machine StartGdbServer 3333 true"
Gtk-Message: 17:25:42.417: Failed to load module "canberra-gtk-module"
17:25:43.6968 [INFO] Loaded monitor commands from: /opt/renode/./scripts/monitor.py
17:25:44.1506 [INFO] Including script: /work/riot/RIOT/boards/stm32f4discovery/dist/board.resc
17:25:44.1905 [INFO] System bus created.
17:25:45.2110 [INFO] sysbus: Loaded SVD: /tmp/renode-17252/f989b3e9-d3dc-43c1-b32d-06b8af1a0665.tmp. Name: STM32F40x. Description: STM32F40x.
17:25:45.4643 [INFO] sysbus: Loading segment of 8984 bytes length at 0x8000000.
17:25:45.4729 [INFO] sysbus: Loading segment of 1912 bytes length at 0x8002318.
17:25:45.4730 [INFO] sysbus: Loading segment of 512 bytes length at 0x20000000.
17:25:45.6486 [INFO] STM32F4_Discovery: GDB server with all CPUs started on port :3333
Remote debugging using :3333
17:25:48.5408 [WARNING] sysbus: Tried to access bytes at non-existing peripheral in range <0x00000000, 0x00000003>.
17:25:48.5422 [WARNING] sysbus: Tried to access bytes at non-existing peripheral in range <0xFFFFFFFC, 0xFFFFFFFF>.
17:25:48.5435 [WARNING] sysbus: Tried to access bytes at non-existing peripheral in range <0x00000000, 0x00000003>.
17:25:48.5862 [WARNING] sysbus: Tried to access bytes at non-existing peripheral in range <0xFFFFFFFC, 0xFFFFFFFF>.
17:25:48.5866 [WARNING] sysbus: Tried to access bytes at non-existing peripheral in range <0x00000000, 0x00000001>.
17:25:48.5870 [WARNING] sysbus: Tried to access bytes at non-existing peripheral in range <0xFFFFFFFE, 0xFFFFFFFF>.
17:25:48.5875 [WARNING] sysbus: Tried to access bytes at non-existing peripheral in range <0xFFFFFFFC, 0xFFFFFFFD>.
17:25:48.5879 [WARNING] sysbus: Tried to access bytes at non-existing peripheral in range <0x00000000, 0x00000001>.
17:25:48.5884 [WARNING] sysbus: Tried to access bytes at non-existing peripheral in range <0xFFFFFFFE, 0xFFFFFFFF>.
17:25:48.5888 [WARNING] sysbus: Tried to access bytes at non-existing peripheral in range <0xFFFFFFFC, 0xFFFFFFFD>.
17:25:48.5891 [WARNING] sysbus: Tried to access bytes at non-existing peripheral in range <0x00000000, 0x00000003>.
17:25:48.5895 [WARNING] sysbus: Tried to access bytes at non-existing peripheral in range <0xFFFFFFFC, 0xFFFFFFFF>.
17:25:48.5899 [WARNING] sysbus: Tried to access bytes at non-existing peripheral in range <0x00000000, 0x00000003>.
17:25:48.5903 [WARNING] sysbus: Tried to access bytes at non-existing peripheral in range <0xFFFFFFFC, 0xFFFFFFFF>.
17:25:48.5906 [WARNING] sysbus: Tried to access bytes at non-existing peripheral in range <0x00000000, 0x00000003>.
17:25:48.5910 [WARNING] sysbus: Tried to access bytes at non-existing peripheral in range <0x00000000, 0x00000003>.
17:25:48.5914 [WARNING] sysbus: Tried to access bytes at non-existing peripheral in range <0x00000000, 0x00000003>.
0x00000000 in ?? ()
17:25:48.6026 [INFO] cpu: Guessing VectorTableOffset value to be 0x8000000.
17:25:48.6074 [INFO] cpu: Setting initial values: PC = 0x800074D, SP = 0x20000200.
17:25:48.6104 [INFO] STM32F4_Discovery: Machine started.
Starting emulation...
(gdb) load
Loading section .text, size 0x2318 lma 0x8000000
Loading section .relocate, size 0x70 lma 0x8002318
Start address 0x0800074c, load size 9096
Transfer rate: 115 KB/sec, 2274 bytes/write.
(gdb) b main
Breakpoint 1 at 0x8000188: file /work/riot/RIOT/examples/hello-world/main.c, line 26.
(gdb) l
12	 *
13	 * @file
14	 * @brief       Hello World application
15	 *
16	 * @author      Kaspar Schleiser <kaspar at schleiser.de>
17	 * @author      Ludwig Knüpfer <ludwig.knuepfer at fu-berlin.de>
18	 *
19	 * @}
20	 */
21	
(gdb) c
Continuing.
17:25:57.4133 [WARNING] nvic: Unhandled read from offset 0xD94.
17:25:57.4146 [WARNING] nvic: Unhandled write to offset 0xD94, value 0x5.
17:25:57.4219 [WARNING] nvic: Unhandled value written to System Control Register: 0x10.
17:25:57.4219 [WARNING] nvic: Unhandled read from offset 0xD14.
17:25:57.4220 [WARNING] nvic: Unhandled write to offset 0xD14, value 0x200.
17:25:57.4296 [WARNING] rcc: Unhandled write to offset 0x30. Unhandled bits: [11, 13-15] when writing value 0xFFFF. Tags: RESERVED (0x1), RESERVED (0x7).
17:25:57.4331 [WARNING] sysbus: Write of value 0xFFFFFFFF to an unimplemented register GPIOG:MODER (0x40021800) generated from SVD.
17:25:57.4333 [WARNING] sysbus: Write of value 0xFFFFFFFF to an unimplemented register GPIOH:MODER (0x40021C00) generated from SVD.
17:25:57.4333 [WARNING] sysbus: Write of value 0xFFFFFFFF to an unimplemented register GPIOI:MODER (0x40022000) generated from SVD.
17:25:57.4336 [WARNING] rcc: Unhandled write to offset 0xC, value 0x0.
17:25:57.4343 [WARNING] sysbus: Write of value 0x706 to an unimplemented register FLASH:ACR (0x40023C00) generated from SVD.
17:25:57.4345 [WARNING] rcc: Unhandled write to offset 0x4. Unhandled bits: [29] when writing value 0x8402D04. Tags: RESERVED (0x2).
17:25:57.4382 [WARNING] uart2: Unhandled write to offset 0x14, value 0x0.
17:25:57.4485 [WARNING] nvic: Unhandled write to offset 0xD98, value 0x2.
17:25:57.4486 [WARNING] nvic: Unhandled write to offset 0xD9C, value 0x20000280.
17:25:57.4486 [WARNING] nvic: Unhandled write to offset 0xDA0, value 0x16060009.

Breakpoint 1, main () at /work/riot/RIOT/examples/hello-world/main.c:26
26	    puts("Hello World!");
(gdb) n
28	    printf("You are running RIOT on a(n) %s board.\n", RIOT_BOARD);
(gdb) n
29	    printf("This board features a(n) %s MCU.\n", RIOT_MCU);
(gdb) n
31	    return 0;
(gdb) quit
A debugging session is active.

	Inferior 1 [Remote target] will be killed.

Quit anyway? (y or n) EOF [assumed Y]
make: Leaving directory '/work/riot/RIOT/examples/hello-world'
```

</details>

ACK!



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/15473#pullrequestreview-561940557
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210105/0db2c8c5/attachment-0001.htm>


More information about the notifications mailing list