FreeRTOSを動かしてみる(4)

[前回](https://qiita.com/t-yano-tryhard/items/ea3fb589ce85621ef947)の続き

# 開始時点のコード
[FreeRTOSのデモ(CORTEX_M3_MPS2_QEMU_GCCを使用)](https://github.com/tyano461/freertos_cm3/commit/d55447f7e5790668ca861a3af3140a5de31a389f)
[FreeRTOS-Plus-TCP(v4を使用するため別管理)](https://github.com/tyano461/freertos_tcpv4/commit/e431dbde42f8d252b094a96f9a99b65fc6e0dba6)

# NICの実装

## 接続判定
ARPリプライを送っただけで固まってしまったので
もうちょっと調べてみる必要がある。

### 不具合調査
```
#0  xEventGroupWaitBits (xEventGroup=0x200131c8, uxBitsToWaitFor=uxBitsToWaitFor@entry=40, xClearOnExit=xClearOnExit@entry=1, xWaitForAllBits=xWaitForAllBits@entry=0, xTicksToWait=4294967295) at /home/voyager/workspace/freertos/FreeRTOSv202212.01/FreeRTOS/Source/event_groups.c:413
#1  0x00009d84 in FreeRTOS_connect (xClientSocket=xClientSocket@entry=0x20013008, pxAddress=<optimized out>, pxAddress@entry=0x20012d60, xAddressLength=xAddressLength@entry=24) at /home/voyager/workspace/freertos/FreeRTOS-Plus-TCP/source/FreeRTOS_Sockets.c:3849
#2  0x0000d890 in vTCPSend (pcBufferToTransmit=pcBufferToTransmit@entry=0x20011454 <buf> "aiueo", xTotalLengthToSend=xTotalLengthToSend@entry=5) at app_client.c:55
#3  0x0000d98c in client_task (param=<optimized out>) at app_client.c:32
#4  0x00000280 in prvPortStartFirstTask () at /home/voyager/workspace/freertos/FreeRTOSv202212.01/FreeRTOS/Source/portable/GCC/ARM_CM3/port.c:247
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) n
424	        uxReturn = uxTaskResetEventItemValue();
```

毎回異なる場所で固まっている。ちょっと動きがおかしい
```
(gdb) l
698	
699	    if( xWaitForAllBits == pdFALSE )
700	    {
701	        /* Task only has to wait for one bit within uxBitsToWaitFor to be
702	         * set.  Is one already set? */
703	        if( ( uxCurrentEventBits & uxBitsToWaitFor ) != ( EventBits_t ) 0 )
704	        {
705	            xWaitConditionMet = pdTRUE;
706	        }
707	        else
(gdb) n
xEventGroupWaitBits (xEventGroup=0x200131c8, uxBitsToWaitFor=uxBitsToWaitFor@entry=40, xClearOnExit=xClearOnExit@entry=1, xWaitForAllBits=xWaitForAllBits@entry=0, xTicksToWait=4294967295) at /home/voyager/workspace/freertos/FreeRTOSv202212.01/FreeRTOS/Source/event_groups.c:453
453	            taskEXIT_CRITICAL();
(gdb) 


^C
Program received signal SIGINT, Interrupt.
prvGetRegistersFromStack (warning: no PSP thread stack unwinding supported.
pulFaultStackAddress=0x20010430 <xIPTaskStack.2+39696>) at init/startup.c:96
96	    for( ; ; )

```

gdb でステップ実行すると発生しない。

日立の嫌がらせでした。

```
sudo qemu-system-arm -machine mps2-an385 -monitor null -semihosting --semihosting-config enable=on,target=native -kernel ./build/RTOSDemo.axf -serial stdio -nographic -gdb tcp::12345 -S
[0000] NetworkInterface.c(132) pxFillInterfaceDescriptor mac:0 fr:0x5763 
[1d48] NetworkInterface.c(191) ether_task  fr:0x281 
[67ac] FreeRTOS_IP.c(1397) xSendEventStructToIPTask et:0 fr:0x5a79 
[2580] app_server.c(14) server_task  fr:0x281 
[2580] app_server.c(31) vCreateTCPServerSocket sock:536948248 fr:0xddd5 
[2580] FreeRTOS_IP.c(1397) xSendEventStructToIPTask et:9 fr:0x9d23 
[2db8] app_client.c(28) client_task  fr:0x281 
[2db8] app_client.c(44) vTCPSend IN fr:0xdcb9 
[2db8] app_client.c(54) vTCPSend socket fr:0xdcb9 
[2db8] FreeRTOS_Sockets.c(3783) FreeRTOS_connect  fr:0xdbbd 
[2db8] FreeRTOS_IP.c(1397) xSendEventStructToIPTask et:9 fr:0x9d23 
[67ac] NetworkInterface.c(106) xApplicationGetRandomNumber  fr:0x8cd3 
[2580] event_groups.c(330) xEventGroupWaitBits  fr:0x9d39 
[2580] event_groups.c(342) xEventGroupWaitBits  fr:0x9d39 
[2580] event_groups.c(345) xEventGroupWaitBits  fr:0x9d39 
[2580] event_groups.c(350) xEventGroupWaitBits  fr:0x9d39 
[2580] event_groups.c(354) xEventGroupWaitBits  fr:0x9d39 
[2580] event_groups.c(369) xEventGroupWaitBits  fr:0x9d39 
[2580] event_groups.c(419) xEventGroupWaitBits  fr:0x9d39 
[2580] event_groups.c(423) xEventGroupWaitBits  fr:0x9d39 
[2580] event_groups.c(492) xEventGroupWaitBits  fr:0x9d39 
[2580] event_groups.c(498) xEventGroupWaitBits  fr:0x9d39 
[2580] app_server.c(45) vCreateTCPServerSocket bind fr:0xddd5 
[2580] app_server.c(48) vCreateTCPServerSocket listen fr:0xddd5 
[2580] event_groups.c(330) xEventGroupWaitBits  fr:0x9957 
[2580] event_groups.c(342) xEventGroupWaitBits  fr:0x9957 
[2580] event_groups.c(345) xEventGroupWaitBits  fr:0x9957 
[2580] event_groups.c(350) xEventGroupWaitBits  fr:0x9957 
[2580] event_groups.c(381) xEventGroupWaitBits  fr:0x9957 
[2580] event_groups.c(404) xEventGroupWaitBits  fr:0x9957 
[2580] event_groups.c(409) xEventGroupWaitBits  fr:0x9957 
[2580] event_groups.c(417) xEventGroupWaitBits  fr:0x9957 
[2580] event_groups.c(419) xEventGroupWaitBits  fr:0x9957 
[2580] event_groups.c(423) xEventGroupWaitBits  fr:0x9957 
[2580] event_groups.c(428) xEventGroupWaitBits  fr:0x9957 
[2db8] event_groups.c(330) xEventGroupWaitBits  fr:0x9d39 
[2db8] event_groups.c(342) xEventGroupWaitBits  fr:0x9d39 
[2db8] event_groups.c(345) xEventGroupWaitBits  fr:0x9d39 
[2db8] event_groups.c(350) xEventGroupWaitBits  fr:0x9d39 
[2db8] event_groups.c(354) xEventGroupWaitBits  fr:0x9d39 
[2db8] event_groups.c(369) xEventGroupWaitBits  fr:0x9d39 
[2db8] event_groups.c(419) xEventGroupWaitBits  fr:0x9d39 
[2db8] event_groups.c(423) xEventGroupWaitBits  fr:0x9d39 
[2db8] event_groups.c(492) xEventGroupWaitBits  fr:0x9d39 
[2db8] event_groups.c(498) xEventGroupWaitBits  fr:0x9d39 
[2db8] FreeRTOS_Sockets.c(3694) prvTCPConnectStart  fr:0xa04b 
[2db8] FreeRTOS_Sockets.c(3701) prvTCPConnectStart fam:2 fr:0xa04b 
[2db8] FreeRTOS_Sockets.c(3717) prvTCPConnectStart FreeRTOS_connect: lp:1024 -> a0a0ac8:10000 fr:0xa04b 
[2db8] FreeRTOS_IP.c(1397) xSendEventStructToIPTask et:6 fr:0x5aef 
[1d48] NetworkInterface.c(220) ether_task send 00 11 22 33 44 55 00 11 22 33 44 55 08 06 00 01
08 00 06 04 00 02 00 11 22 33 44 55 0a 0a 0a c8
00 11 22 33 44 55 0a 0a 0a c8 
 fr:0x281 
[1d48] FreeRTOS_IP.c(1397) xSendEventStructToIPTask et:1 fr:0xd7e1 
[67ac] NetworkInterface.c(169) pfOutput ip:c80a0a0a po:0 bp:0 len:42 data:ff ff ff ff ff ff 00 11 22 33 44 55 08 06 00 01
08 00 06 04 00 01 00 11 22 33 44 55 0a 0a 0a c8
00 00 00 00 00 00 0a 0a 0a c8 
 r:1 fr:0x40e5 
[2db8] FreeRTOS_Sockets.c(3797) FreeRTOS_connect prvTCPConnectStart:0 fr:0xdbbd 
[2db8] event_groups.c(330) xEventGroupWaitBits  fr:0xa0b1 
[2db8] event_groups.c(342) xEventGroupWaitBits  fr:0xa0b1 
[2db8] event_groups.c(345) xEventGroupWaitBits  fr:0xa0b1 
[2db8] event_groups.c(350) xEventGroupWaitBits  fr:0xa0b1 
[2db8] event_groups.c(381) xEventGroupWaitBits  fr:0xa0b1 
[2db8] event_groups.c(404) xEventGroupWaitBits  fr:0xa0b1 
[2db8] event_groups.c(409) xEventGroupWaitBits  fr:0xa0b1 
[2db8] event_groups.c(417) xEventGroupWaitBits  fr:0xa0b1 
[2db8] event_groups.c(419) xEventGroupWaitBits  fr:0xa0b1 
[2db8] event_groups.c(423) xEventGroupWaitBits  fr:0xa0b1 
qemu-system-arm: terminating on signal 2
```

<details>
<summary>gdb.txt</summary>

```
Breakpoint 2 at 0x3790: /home/voyager/workspace/freertos/freertos_cm3/FreeRTOS/Source/event_groups.c:428. (2 locations)
Continuing.

Breakpoint 2, xEventGroupWaitBits (xEventGroup=0x20012fe0, uxBitsToWaitFor=uxBitsToWaitFor@entry=4, xClearOnExit=xClearOnExit@entry=1, xWaitForAllBits=xWaitForAllBits@entry=0, xTicksToWait=4294967295) at /home/voyager/workspace/freertos/freertos_cm3/FreeRTOS/Source/event_groups.c:428
428	d("");
Continuing.

Breakpoint 2, xEventGroupWaitBits (xEventGroup=0x20012fe0, uxBitsToWaitFor=uxBitsToWaitFor@entry=4, xClearOnExit=xClearOnExit@entry=1, xWaitForAllBits=xWaitForAllBits@entry=0, xTicksToWait=4294967295) at /home/voyager/workspace/freertos/freertos_cm3/FreeRTOS/Source/event_groups.c:429
429	            portYIELD_WITHIN_API();
Continuing.

Program received signal SIGINT, Interrupt.
prvGetRegistersFromStack (warning: no PSP thread stack unwinding supported.
pulFaultStackAddress=0x20010430 <xIPTaskStack.2+39696>) at init/startup.c:96
96	    for( ; ; )
91	    lr = pulFaultStackAddress[ 5 ];
92	    pc = pulFaultStackAddress[ 6 ];
93	    psr = pulFaultStackAddress[ 7 ];
94	
95	    /* When the following line is hit, the variables contain the register values. */
96	    for( ; ; )
97	    {
98	    }
99	    /* remove the warning: variable <x> is set but not used */
100	    ( void ) r0;
Detaching from program: /home/voyager/workspace/freertos/freertos_cm3/FreeRTOS/Demo/CORTEX_M3_MPS2_QEMU_GCC/build/RTOSDemo.axf, process 1
Remote communication error.  Target disconnected.: Broken pipe.
319	EventBits_t xEventGroupWaitBits( EventGroupHandle_t xEventGroup,
320	                                 const EventBits_t uxBitsToWaitFor,
321	                                 const BaseType_t xClearOnExit,
322	                                 const BaseType_t xWaitForAllBits,
323	                                 TickType_t xTicksToWait )
324	{
325	    EventGroup_t * pxEventBits = xEventGroup;
326	    EventBits_t uxReturn, uxControlBits = 0;
327	    BaseType_t xWaitConditionMet, xAlreadyYielded;
328	    BaseType_t xTimeoutOccurred = pdFALSE;
Breakpoint 1 at 0x3790: /home/voyager/workspace/freertos/freertos_cm3/FreeRTOS/Source/event_groups.c:428. (2 locations)
Continuing.

Breakpoint 1, xEventGroupWaitBits (xEventGroup=0x20012fe0, uxBitsToWaitFor=uxBitsToWaitFor@entry=4, xClearOnExit=xClearOnExit@entry=1, xWaitForAllBits=xWaitForAllBits@entry=0, xTicksToWait=4294967295) at /home/voyager/workspace/freertos/freertos_cm3/FreeRTOS/Source/event_groups.c:428
428	d("");
Continuing.

Breakpoint 1, xEventGroupWaitBits (xEventGroup=0x20012fe0, uxBitsToWaitFor=uxBitsToWaitFor@entry=4, xClearOnExit=xClearOnExit@entry=1, xWaitForAllBits=xWaitForAllBits@entry=0, xTicksToWait=4294967295) at /home/voyager/workspace/freertos/freertos_cm3/FreeRTOS/Source/event_groups.c:429
429	            portYIELD_WITHIN_API();
Continuing.

Breakpoint 1, xEventGroupWaitBits (xEventGroup=0x200131c8, uxBitsToWaitFor=uxBitsToWaitFor@entry=40, xClearOnExit=xClearOnExit@entry=1, xWaitForAllBits=xWaitForAllBits@entry=0, xTicksToWait=4294967295) at /home/voyager/workspace/freertos/freertos_cm3/FreeRTOS/Source/event_groups.c:428
428	d("");
xTaskGetCurrentTaskHandle () at /home/voyager/workspace/freertos/freertos_cm3/FreeRTOS/Source/tasks.c:4029
4029	        xReturn = pxCurrentTCB;
Dump of assembler code from 0x1a00 to 0x1a0a:
=> 0x00001a00 <xTaskGetCurrentTaskHandle+0>:	ldr	r3, [pc, #4]	; (0x1a08 <xTaskGetCurrentTaskHandle+8>)
   0x00001a02 <xTaskGetCurrentTaskHandle+2>:	ldr.w	r0, [r3, #316]	; 0x13c
   0x00001a06 <xTaskGetCurrentTaskHandle+6>:	bx	lr
   0x00001a08 <xTaskGetCurrentTaskHandle+8>:	str	r4, [r3, #0]
End of assembler dump.
0x00001a02	4029	        xReturn = pxCurrentTCB;
Dump of assembler code from 0x1a02 to 0x1a0c:
=> 0x00001a02 <xTaskGetCurrentTaskHandle+2>:	ldr.w	r0, [r3, #316]	; 0x13c
   0x00001a06 <xTaskGetCurrentTaskHandle+6>:	bx	lr
   0x00001a08 <xTaskGetCurrentTaskHandle+8>:	str	r4, [r3, #0]
   0x00001a0a <xTaskGetCurrentTaskHandle+10>:	movs	r0, #0
End of assembler dump.
4031	        return xReturn;
Dump of assembler code from 0x1a06 to 0x1a10:
=> 0x00001a06 <xTaskGetCurrentTaskHandle+6>:	bx	lr
   0x00001a08 <xTaskGetCurrentTaskHandle+8>:	str	r4, [r3, #0]
   0x00001a0a <xTaskGetCurrentTaskHandle+10>:	movs	r0, #0
   0x00001a0c <xTaskGetSchedulerState+0>:	ldr	r3, [pc, #24]	; (0x1a28 <xTaskGetSchedulerState+28>)
   0x00001a0e <xTaskGetSchedulerState+2>:	ldr.w	r3, [r3, #320]	; 0x140
End of assembler dump.
xEventGroupWaitBits (xEventGroup=0x200131c8, uxBitsToWaitFor=uxBitsToWaitFor@entry=40, xClearOnExit=xClearOnExit@entry=1, xWaitForAllBits=xWaitForAllBits@entry=0, xTicksToWait=4294967295) at /home/voyager/workspace/freertos/freertos_cm3/FreeRTOS/Source/event_groups.c:428
428	d("");
Dump of assembler code from 0x3794 to 0x379e:
=> 0x00003794 <xEventGroupWaitBits+302>:	str	r4, [sp, #4]
   0x00003796 <xEventGroupWaitBits+304>:	str.w	r11, [sp]
   0x0000379a <xEventGroupWaitBits+308>:	mov.w	r3, #428	; 0x1ac
End of assembler dump.
0x00003796	428	d("");
Dump of assembler code from 0x3796 to 0x37a0:
=> 0x00003796 <xEventGroupWaitBits+304>:	str.w	r11, [sp]
   0x0000379a <xEventGroupWaitBits+308>:	mov.w	r3, #428	; 0x1ac
   0x0000379e <xEventGroupWaitBits+312>:	mov	r2, r10
End of assembler dump.
0x0000379a	428	d("");
Dump of assembler code from 0x379a to 0x37a4:
=> 0x0000379a <xEventGroupWaitBits+308>:	mov.w	r3, #428	; 0x1ac
   0x0000379e <xEventGroupWaitBits+312>:	mov	r2, r10
   0x000037a0 <xEventGroupWaitBits+314>:	uxth	r1, r0
   0x000037a2 <xEventGroupWaitBits+316>:	mov	r0, r9
End of assembler dump.
0x0000379e	428	d("");
Dump of assembler code from 0x379e to 0x37a8:
=> 0x0000379e <xEventGroupWaitBits+312>:	mov	r2, r10
   0x000037a0 <xEventGroupWaitBits+314>:	uxth	r1, r0
   0x000037a2 <xEventGroupWaitBits+316>:	mov	r0, r9
   0x000037a4 <xEventGroupWaitBits+318>:	bl	0xe344 <printf>
End of assembler dump.
0x000037a0	428	d("");
Dump of assembler code from 0x37a0 to 0x37aa:
=> 0x000037a0 <xEventGroupWaitBits+314>:	uxth	r1, r0
   0x000037a2 <xEventGroupWaitBits+316>:	mov	r0, r9
   0x000037a4 <xEventGroupWaitBits+318>:	bl	0xe344 <printf>
   0x000037a8 <xEventGroupWaitBits+322>:	mov.w	r3, #3758153728	; 0xe000e000
End of assembler dump.
0x000037a2	428	d("");
Dump of assembler code from 0x37a2 to 0x37ac:
=> 0x000037a2 <xEventGroupWaitBits+316>:	mov	r0, r9
   0x000037a4 <xEventGroupWaitBits+318>:	bl	0xe344 <printf>
   0x000037a8 <xEventGroupWaitBits+322>:	mov.w	r3, #3758153728	; 0xe000e000
End of assembler dump.
0x000037a4	428	d("");
Dump of assembler code from 0x37a4 to 0x37ae:
=> 0x000037a4 <xEventGroupWaitBits+318>:	bl	0xe344 <printf>
   0x000037a8 <xEventGroupWaitBits+322>:	mov.w	r3, #3758153728	; 0xe000e000
   0x000037ac <xEventGroupWaitBits+326>:	mov.w	r2, #268435456	; 0x10000000
End of assembler dump.
printf (fmt=0x10d40 "[%04x] %s(%d) %s  fr:%p \n") at ../../../../../../../../newlib/libc/stdio/printf.c:52
52	../../../../../../../../newlib/libc/stdio/printf.c: No such file or directory.
Dump of assembler code from 0xe344 to 0xe34e:
=> 0x0000e344 <printf+0>:	push	{r0, r1, r2, r3}
   0x0000e346 <printf+2>:	push	{r4, lr}
   0x0000e348 <printf+4>:	ldr	r3, [pc, #40]	; (0xe374 <printf+48>)
   0x0000e34a <printf+6>:	sub	sp, #8
   0x0000e34c <printf+8>:	ldr	r4, [r3, #0]
End of assembler dump.
0x0000e346	52	in ../../../../../../../../newlib/libc/stdio/printf.c
Dump of assembler code from 0xe346 to 0xe350:
=> 0x0000e346 <printf+2>:	push	{r4, lr}
   0x0000e348 <printf+4>:	ldr	r3, [pc, #40]	; (0xe374 <printf+48>)
   0x0000e34a <printf+6>:	sub	sp, #8
   0x0000e34c <printf+8>:	ldr	r4, [r3, #0]
   0x0000e34e <printf+10>:	cbz	r4, 0xe354 <printf+16>
End of assembler dump.
0x0000e348	52	in ../../../../../../../../newlib/libc/stdio/printf.c
Dump of assembler code from 0xe348 to 0xe352:
=> 0x0000e348 <printf+4>:	ldr	r3, [pc, #40]	; (0xe374 <printf+48>)
   0x0000e34a <printf+6>:	sub	sp, #8
   0x0000e34c <printf+8>:	ldr	r4, [r3, #0]
   0x0000e34e <printf+10>:	cbz	r4, 0xe354 <printf+16>
   0x0000e350 <printf+12>:	ldr	r3, [r4, #24]
End of assembler dump.
0x0000e34a	49	in ../../../../../../../../newlib/libc/stdio/printf.c
Dump of assembler code from 0xe34a to 0xe354:
=> 0x0000e34a <printf+6>:	sub	sp, #8
   0x0000e34c <printf+8>:	ldr	r4, [r3, #0]
   0x0000e34e <printf+10>:	cbz	r4, 0xe354 <printf+16>
   0x0000e350 <printf+12>:	ldr	r3, [r4, #24]
   0x0000e352 <printf+14>:	cbz	r3, 0xe36c <printf+40>
End of assembler dump.
0x0000e34c	52	in ../../../../../../../../newlib/libc/stdio/printf.c
Dump of assembler code from 0xe34c to 0xe356:
=> 0x0000e34c <printf+8>:	ldr	r4, [r3, #0]
   0x0000e34e <printf+10>:	cbz	r4, 0xe354 <printf+16>
   0x0000e350 <printf+12>:	ldr	r3, [r4, #24]
   0x0000e352 <printf+14>:	cbz	r3, 0xe36c <printf+40>
   0x0000e354 <printf+16>:	add	r3, sp, #20
End of assembler dump.
54	in ../../../../../../../../newlib/libc/stdio/printf.c
Dump of assembler code from 0xe34e to 0xe358:
=> 0x0000e34e <printf+10>:	cbz	r4, 0xe354 <printf+16>
   0x0000e350 <printf+12>:	ldr	r3, [r4, #24]
   0x0000e352 <printf+14>:	cbz	r3, 0xe36c <printf+40>
   0x0000e354 <printf+16>:	add	r3, sp, #20
   0x0000e356 <printf+18>:	mov	r0, r4
End of assembler dump.
0x0000e350	54	in ../../../../../../../../newlib/libc/stdio/printf.c
Dump of assembler code from 0xe350 to 0xe35a:
=> 0x0000e350 <printf+12>:	ldr	r3, [r4, #24]
   0x0000e352 <printf+14>:	cbz	r3, 0xe36c <printf+40>
   0x0000e354 <printf+16>:	add	r3, sp, #20
   0x0000e356 <printf+18>:	mov	r0, r4
   0x0000e358 <printf+20>:	ldr	r2, [sp, #16]
End of assembler dump.
0x0000e352	54	in ../../../../../../../../newlib/libc/stdio/printf.c
Dump of assembler code from 0xe352 to 0xe35c:
=> 0x0000e352 <printf+14>:	cbz	r3, 0xe36c <printf+40>
   0x0000e354 <printf+16>:	add	r3, sp, #20
   0x0000e356 <printf+18>:	mov	r0, r4
   0x0000e358 <printf+20>:	ldr	r2, [sp, #16]
   0x0000e35a <printf+22>:	ldr	r1, [r4, #8]
End of assembler dump.
55	in ../../../../../../../../newlib/libc/stdio/printf.c
Dump of assembler code from 0xe354 to 0xe35e:
=> 0x0000e354 <printf+16>:	add	r3, sp, #20
   0x0000e356 <printf+18>:	mov	r0, r4
   0x0000e358 <printf+20>:	ldr	r2, [sp, #16]
   0x0000e35a <printf+22>:	ldr	r1, [r4, #8]
   0x0000e35c <printf+24>:	str	r3, [sp, #4]
End of assembler dump.
0x0000e356	56	in ../../../../../../../../newlib/libc/stdio/printf.c
Dump of assembler code from 0xe356 to 0xe360:
=> 0x0000e356 <printf+18>:	mov	r0, r4
   0x0000e358 <printf+20>:	ldr	r2, [sp, #16]
   0x0000e35a <printf+22>:	ldr	r1, [r4, #8]
   0x0000e35c <printf+24>:	str	r3, [sp, #4]
   0x0000e35e <printf+26>:	bl	0xf5bc <_vfprintf_r>
End of assembler dump.
0x0000e358	56	in ../../../../../../../../newlib/libc/stdio/printf.c
Dump of assembler code from 0xe358 to 0xe362:
=> 0x0000e358 <printf+20>:	ldr	r2, [sp, #16]
   0x0000e35a <printf+22>:	ldr	r1, [r4, #8]
   0x0000e35c <printf+24>:	str	r3, [sp, #4]
   0x0000e35e <printf+26>:	bl	0xf5bc <_vfprintf_r>
End of assembler dump.
0x0000e35a	56	in ../../../../../../../../newlib/libc/stdio/printf.c
Dump of assembler code from 0xe35a to 0xe364:
=> 0x0000e35a <printf+22>:	ldr	r1, [r4, #8]
   0x0000e35c <printf+24>:	str	r3, [sp, #4]
   0x0000e35e <printf+26>:	bl	0xf5bc <_vfprintf_r>
   0x0000e362 <printf+30>:	add	sp, #8
End of assembler dump.
0x0000e35c	55	in ../../../../../../../../newlib/libc/stdio/printf.c
Dump of assembler code from 0xe35c to 0xe366:
=> 0x0000e35c <printf+24>:	str	r3, [sp, #4]
   0x0000e35e <printf+26>:	bl	0xf5bc <_vfprintf_r>
   0x0000e362 <printf+30>:	add	sp, #8
   0x0000e364 <printf+32>:	ldmia.w	sp!, {r4, lr}
End of assembler dump.
56	in ../../../../../../../../newlib/libc/stdio/printf.c
Dump of assembler code from 0xe35e to 0xe368:
=> 0x0000e35e <printf+26>:	bl	0xf5bc <_vfprintf_r>
   0x0000e362 <printf+30>:	add	sp, #8
   0x0000e364 <printf+32>:	ldmia.w	sp!, {r4, lr}
End of assembler dump.
_vfprintf_r (data=data@entry=0x20000134 <impure_data>, fp=0x2001166c, fmt0=fmt0@entry=0x10d40 "[%04x] %s(%d) %s  fr:%p \n", ap=..., ap@entry=...) at ../../../../../../../../newlib/libc/stdio/nano-vfprintf.c:472
472	../../../../../../../../newlib/libc/stdio/nano-vfprintf.c: No such file or directory.
Dump of assembler code from 0xf5bc to 0xf5c6:
=> 0x0000f5bc <_vfprintf_r+0>:	stmdb	sp!, {r4, r5, r6, r7, r8, r9, r10, r11, lr}
   0x0000f5c0 <_vfprintf_r+4>:	mov	r6, r1
   0x0000f5c2 <_vfprintf_r+6>:	mov	r10, r2
   0x0000f5c4 <_vfprintf_r+8>:	mov	r4, r3
End of assembler dump.
0x0000f5c0	472	in ../../../../../../../../newlib/libc/stdio/nano-vfprintf.c
Dump of assembler code from 0xf5c0 to 0xf5ca:
=> 0x0000f5c0 <_vfprintf_r+4>:	mov	r6, r1
   0x0000f5c2 <_vfprintf_r+6>:	mov	r10, r2
   0x0000f5c4 <_vfprintf_r+8>:	mov	r4, r3
   0x0000f5c6 <_vfprintf_r+10>:	mov	r7, r0
   0x0000f5c8 <_vfprintf_r+12>:	sub	sp, #124	; 0x7c
End of assembler dump.
487	in ../../../../../../../../newlib/libc/stdio/nano-vfprintf.c
Dump of assembler code from 0xf5c2 to 0xf5cc:
=> 0x0000f5c2 <_vfprintf_r+6>:	mov	r10, r2
   0x0000f5c4 <_vfprintf_r+8>:	mov	r4, r3
   0x0000f5c6 <_vfprintf_r+10>:	mov	r7, r0
   0x0000f5c8 <_vfprintf_r+12>:	sub	sp, #124	; 0x7c
   0x0000f5ca <_vfprintf_r+14>:	cbz	r0, 0xf5d4 <_vfprintf_r+24>
End of assembler dump.
0x0000f5c4	487	in ../../../../../../../../newlib/libc/stdio/nano-vfprintf.c
Dump of assembler code from 0xf5c4 to 0xf5ce:
=> 0x0000f5c4 <_vfprintf_r+8>:	mov	r4, r3
   0x0000f5c6 <_vfprintf_r+10>:	mov	r7, r0
   0x0000f5c8 <_vfprintf_r+12>:	sub	sp, #124	; 0x7c
   0x0000f5ca <_vfprintf_r+14>:	cbz	r0, 0xf5d4 <_vfprintf_r+24>
   0x0000f5cc <_vfprintf_r+16>:	ldr	r3, [r0, #24]
End of assembler dump.
0x0000f5c6	487	in ../../../../../../../../newlib/libc/stdio/nano-vfprintf.c
Dump of assembler code from 0xf5c6 to 0xf5d0:
=> 0x0000f5c6 <_vfprintf_r+10>:	mov	r7, r0
   0x0000f5c8 <_vfprintf_r+12>:	sub	sp, #124	; 0x7c
   0x0000f5ca <_vfprintf_r+14>:	cbz	r0, 0xf5d4 <_vfprintf_r+24>
   0x0000f5cc <_vfprintf_r+16>:	ldr	r3, [r0, #24]
   0x0000f5ce <_vfprintf_r+18>:	cmp	r3, #0
End of assembler dump.
0x0000f5c8	472	in ../../../../../../../../newlib/libc/stdio/nano-vfprintf.c
Dump of assembler code from 0xf5c8 to 0xf5d2:
=> 0x0000f5c8 <_vfprintf_r+12>:	sub	sp, #124	; 0x7c
   0x0000f5ca <_vfprintf_r+14>:	cbz	r0, 0xf5d4 <_vfprintf_r+24>
   0x0000f5cc <_vfprintf_r+16>:	ldr	r3, [r0, #24]
   0x0000f5ce <_vfprintf_r+18>:	cmp	r3, #0
   0x0000f5d0 <_vfprintf_r+20>:	beq.w	0xf724 <_vfprintf_r+360>
End of assembler dump.
0x0000f5ca	487	in ../../../../../../../../newlib/libc/stdio/nano-vfprintf.c
Dump of assembler code from 0xf5ca to 0xf5d4:
=> 0x0000f5ca <_vfprintf_r+14>:	cbz	r0, 0xf5d4 <_vfprintf_r+24>
   0x0000f5cc <_vfprintf_r+16>:	ldr	r3, [r0, #24]
   0x0000f5ce <_vfprintf_r+18>:	cmp	r3, #0
   0x0000f5d0 <_vfprintf_r+20>:	beq.w	0xf724 <_vfprintf_r+360>
End of assembler dump.
0x0000f5cc	487	in ../../../../../../../../newlib/libc/stdio/nano-vfprintf.c
Dump of assembler code from 0xf5cc to 0xf5d6:
=> 0x0000f5cc <_vfprintf_r+16>:	ldr	r3, [r0, #24]
   0x0000f5ce <_vfprintf_r+18>:	cmp	r3, #0
   0x0000f5d0 <_vfprintf_r+20>:	beq.w	0xf724 <_vfprintf_r+360>
   0x0000f5d4 <_vfprintf_r+24>:	ldr	r3, [pc, #596]	; (0xf82c <_vfprintf_r+624>)
End of assembler dump.
0x0000f5ce	487	in ../../../../../../../../newlib/libc/stdio/nano-vfprintf.c
Dump of assembler code from 0xf5ce to 0xf5d8:
=> 0x0000f5ce <_vfprintf_r+18>:	cmp	r3, #0
   0x0000f5d0 <_vfprintf_r+20>:	beq.w	0xf724 <_vfprintf_r+360>
   0x0000f5d4 <_vfprintf_r+24>:	ldr	r3, [pc, #596]	; (0xf82c <_vfprintf_r+624>)
   0x0000f5d6 <_vfprintf_r+26>:	cmp	r6, r3
End of assembler dump.
0x0000f5d0	487	in ../../../../../../../../newlib/libc/stdio/nano-vfprintf.c
Dump of assembler code from 0xf5d0 to 0xf5da:
=> 0x0000f5d0 <_vfprintf_r+20>:	beq.w	0xf724 <_vfprintf_r+360>
   0x0000f5d4 <_vfprintf_r+24>:	ldr	r3, [pc, #596]	; (0xf82c <_vfprintf_r+624>)
   0x0000f5d6 <_vfprintf_r+26>:	cmp	r6, r3
   0x0000f5d8 <_vfprintf_r+28>:	beq.w	0xf730 <_vfprintf_r+372>
End of assembler dump.
0x0000f5d4	487	in ../../../../../../../../newlib/libc/stdio/nano-vfprintf.c
Dump of assembler code from 0xf5d4 to 0xf5de:
=> 0x0000f5d4 <_vfprintf_r+24>:	ldr	r3, [pc, #596]	; (0xf82c <_vfprintf_r+624>)
   0x0000f5d6 <_vfprintf_r+26>:	cmp	r6, r3
   0x0000f5d8 <_vfprintf_r+28>:	beq.w	0xf730 <_vfprintf_r+372>
   0x0000f5dc <_vfprintf_r+32>:	ldr	r3, [pc, #592]	; (0xf830 <_vfprintf_r+628>)
End of assembler dump.
0x0000f5d6	487	in ../../../../../../../../newlib/libc/stdio/nano-vfprintf.c
Dump of assembler code from 0xf5d6 to 0xf5e0:
=> 0x0000f5d6 <_vfprintf_r+26>:	cmp	r6, r3
   0x0000f5d8 <_vfprintf_r+28>:	beq.w	0xf730 <_vfprintf_r+372>
   0x0000f5dc <_vfprintf_r+32>:	ldr	r3, [pc, #592]	; (0xf830 <_vfprintf_r+628>)
   0x0000f5de <_vfprintf_r+34>:	cmp	r6, r3
End of assembler dump.
0x0000f5d8	487	in ../../../../../../../../newlib/libc/stdio/nano-vfprintf.c
Dump of assembler code from 0xf5d8 to 0xf5e2:
=> 0x0000f5d8 <_vfprintf_r+28>:	beq.w	0xf730 <_vfprintf_r+372>
   0x0000f5dc <_vfprintf_r+32>:	ldr	r3, [pc, #592]	; (0xf830 <_vfprintf_r+628>)
   0x0000f5de <_vfprintf_r+34>:	cmp	r6, r3
   0x0000f5e0 <_vfprintf_r+36>:	beq.w	0xf74e <_vfprintf_r+402>
End of assembler dump.
0x0000f5dc	487	in ../../../../../../../../newlib/libc/stdio/nano-vfprintf.c
Dump of assembler code from 0xf5dc to 0xf5e6:
=> 0x0000f5dc <_vfprintf_r+32>:	ldr	r3, [pc, #592]	; (0xf830 <_vfprintf_r+628>)
   0x0000f5de <_vfprintf_r+34>:	cmp	r6, r3
   0x0000f5e0 <_vfprintf_r+36>:	beq.w	0xf74e <_vfprintf_r+402>
   0x0000f5e4 <_vfprintf_r+40>:	ldr	r3, [pc, #588]	; (0xf834 <_vfprintf_r+632>)
End of assembler dump.
0x0000f5de	487	in ../../../../../../../../newlib/libc/stdio/nano-vfprintf.c
Dump of assembler code from 0xf5de to 0xf5e8:
=> 0x0000f5de <_vfprintf_r+34>:	cmp	r6, r3
   0x0000f5e0 <_vfprintf_r+36>:	beq.w	0xf74e <_vfprintf_r+402>
   0x0000f5e4 <_vfprintf_r+40>:	ldr	r3, [pc, #588]	; (0xf834 <_vfprintf_r+632>)
   0x0000f5e6 <_vfprintf_r+42>:	cmp	r6, r3
End of assembler dump.
0x0000f5e0	487	in ../../../../../../../../newlib/libc/stdio/nano-vfprintf.c
Dump of assembler code from 0xf5e0 to 0xf5ea:
=> 0x0000f5e0 <_vfprintf_r+36>:	beq.w	0xf74e <_vfprintf_r+402>
   0x0000f5e4 <_vfprintf_r+40>:	ldr	r3, [pc, #588]	; (0xf834 <_vfprintf_r+632>)
   0x0000f5e6 <_vfprintf_r+42>:	cmp	r6, r3
   0x0000f5e8 <_vfprintf_r+44>:	it	eq
End of assembler dump.
0x0000f5e4	487	in ../../../../../../../../newlib/libc/stdio/nano-vfprintf.c
Dump of assembler code from 0xf5e4 to 0xf5ee:
=> 0x0000f5e4 <_vfprintf_r+40>:	ldr	r3, [pc, #588]	; (0xf834 <_vfprintf_r+632>)
   0x0000f5e6 <_vfprintf_r+42>:	cmpeq	r6, r3
   0x0000f5e8 <_vfprintf_r+44>:	it	eq
   0x0000f5ea <_vfprintf_r+46>:	ldreq	r6, [r7, #12]
   0x0000f5ec <_vfprintf_r+48>:	ldrh	r3, [r6, #12]
End of assembler dump.
0x0000f5e6	487	in ../../../../../../../../newlib/libc/stdio/nano-vfprintf.c
Dump of assembler code from 0xf5e6 to 0xf5f0:
=> 0x0000f5e6 <_vfprintf_r+42>:	cmp	r6, r3
   0x0000f5e8 <_vfprintf_r+44>:	it	eq
   0x0000f5ea <_vfprintf_r+46>:	ldreq	r6, [r7, #12]
   0x0000f5ec <_vfprintf_r+48>:	ldrh	r3, [r6, #12]
   0x0000f5ee <_vfprintf_r+50>:	lsls	r0, r3, #28
End of assembler dump.
0x0000f5e8	487	in ../../../../../../../../newlib/libc/stdio/nano-vfprintf.c
Dump of assembler code from 0xf5e8 to 0xf5f2:
=> 0x0000f5e8 <_vfprintf_r+44>:	it	eq
   0x0000f5ea <_vfprintf_r+46>:	ldreq	r6, [r7, #12]
   0x0000f5ec <_vfprintf_r+48>:	ldrh	r3, [r6, #12]
   0x0000f5ee <_vfprintf_r+50>:	lsls	r0, r3, #28
   0x0000f5f0 <_vfprintf_r+52>:	bpl.w	0xf73a <_vfprintf_r+382>
End of assembler dump.
0x0000f5ea	487	in ../../../../../../../../newlib/libc/stdio/nano-vfprintf.c


Fatal signal: Segmentation fault
----- Backtrace -----
Backtrace unavailable
---------------------
A fatal error internal to GDB has been detected, further
debugging is not possible.  GDB will now terminate.

This is a bug, please report it.  For instructions, see:
<https://www.gnu.org/software/gdb/bugs/>.

Dump of assembler code from 0xf5ea to 0xf5f4:
=> 0x0000f5ea <_vfprintf_r+46>:	
```

</details>