[riot-notifications] [RIOT-OS/RIOT] cpu/avr8_common: Clean up cpu_print_last_inscrution() (#16917)

Marian Buschsieweke notifications at github.com
Thu Sep 30 10:55:40 CEST 2021


Output of an ATmega328p (Christmas Tree Edition :-D) with the following patch:

```diff
diff --git a/examples/hello-world/main.c b/examples/hello-world/main.c
index f51bf8c0a0..54b7cd082d 100644
--- a/examples/hello-world/main.c
+++ b/examples/hello-world/main.c
@@ -21,6 +21,8 @@
 
 #include <stdio.h>
 
+#include <assert.h>
+
 int main(void)
 {
     puts("Hello World!");
@@ -28,5 +30,7 @@ int main(void)
     printf("You are running RIOT on a(n) %s board.\n", RIOT_BOARD);
     printf("This board features a(n) %s MCU.\n", RIOT_MCU);
 
+    assert(0);
+
     return 0;
 }
```

##### This PR

```
$ avr-readelf -s bin/atmega328p/hello-world.elf  | rg main_stack
    88: 008002bb   640 OBJECT  LOCAL  DEFAULT    3 main_stack
```

```
2021-09-30 10:47:17,726 # Hello World!
2021-09-30 10:47:17,729 # You are running RIOT on a(n) atmega328p board.
2021-09-30 10:47:17,731 # This board features a(n) atmega328p MCU.
2021-09-30 10:47:17,731 # Stack Pointer: 0x050e
2021-09-30 10:47:17,731 # *** RIOT kernel panic:
2021-09-30 10:47:17,732 # FAILED ASSERTION.
2021-09-30 10:47:17,732 # 
2021-09-30 10:47:17,732 # *** halted.
2021-09-30 10:47:17,732 # 
```

##### `master`

```
$ avr-readelf -s bin/atmega328p/hello-world.elf  | rg main_stack
    88: 008002a3   640 OBJECT  LOCAL  DEFAULT    3 main_stack
```

```
2021-09-30 10:48:50,965 # Hello World!
2021-09-30 10:48:50,968 # You are running RIOT on a(n) atmega328p board.
2021-09-30 10:48:50,970 # This board features a(n) atmega328p MCU.
2021-09-30 10:48:50,971 # Stack Pointer: 0x04f6
2021-09-30 10:48:50,973 # *** RIOT kernel panic:
2021-09-30 10:48:50,974 # FAILED ASSERTION.
2021-09-30 10:48:50,974 # 
2021-09-30 10:48:50,975 # *** halted.
2021-09-30 10:48:50,975 # 
```

And

```python
>>> hex(0x04f6 + (0x008002bb - 0x008002a3))
'0x50e'
```

-- 
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/16917#issuecomment-931075077
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210930/22884b3d/attachment-0001.htm>


More information about the notifications mailing list