8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6baacf4 commit c0159c5Copy full SHA for c0159c5
atmel-samd/main.c
@@ -513,6 +513,10 @@ safe_mode_t samd21_init(void) {
513
REG_MTB_POSITION = ((uint32_t) (mtb - REG_MTB_BASE)) & 0xFFFFFFF8;
514
REG_MTB_FLOW = (((uint32_t) mtb - REG_MTB_BASE) + TRACE_BUFFER_SIZE_BYTES) & 0xFFFFFFF8;
515
REG_MTB_MASTER = 0x80000000 + (TRACE_BUFFER_MAGNITUDE_PACKETS - 1);
516
+#else
517
+ // Triple check that the MTB is off. Switching between debug and non-debug
518
+ // builds can leave it set over reset and wreak havok as a result.
519
+ REG_MTB_MASTER = 0x00000000 + 6;
520
#endif
521
522
// On power on start or external reset, set _ezero to the canary word. If it
0 commit comments