aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Wild <ewild@sysmocom.de>2019-10-17 19:52:25 +0200
committerEric Wild <ewild@sysmocom.de>2019-10-17 19:55:36 +0200
commitbd0d4b4252c5254d826bbbcae87e644c5159f45d (patch)
treef48e90d70a6b3371dc801c8c1d4cfcf76dd2997e
parent8049d6699367719c885fdc018d83c9ac9773eedf (diff)
debug error handling, sim-atr 0 vty command results in parity errorshoernchen/atr_parity_old
-rw-r--r--sysmoOCTSIM/main.c5
-rw-r--r--sysmoOCTSIM/talloc.c3
2 files changed, 8 insertions, 0 deletions
diff --git a/sysmoOCTSIM/main.c b/sysmoOCTSIM/main.c
index 6381a80..db42240 100644
--- a/sysmoOCTSIM/main.c
+++ b/sysmoOCTSIM/main.c
@@ -75,6 +75,10 @@ static const double sercom_glck_freqs[] = {100E6 / CONF_GCLK_GEN_2_DIV, 100E6 /
*/
static const uint8_t SIM_peripheral_GCLK_ID[] = {SERCOM0_GCLK_ID_CORE, SERCOM1_GCLK_ID_CORE, SERCOM2_GCLK_ID_CORE, SERCOM3_GCLK_ID_CORE, SERCOM4_GCLK_ID_CORE, SERCOM5_GCLK_ID_CORE, SERCOM6_GCLK_ID_CORE, SERCOM7_GCLK_ID_CORE};
+static void _SIM_error_cb(const struct usart_async_descriptor *const descr){
+ while(1){ asm("nop");}
+}
+
static void board_init()
{
int i;
@@ -99,6 +103,7 @@ static void board_init()
}
usart_async_register_callback(SIM_peripheral_descriptors[i], USART_ASYNC_RXC_CB, SIM_rx_cb); // required for RX to work, even if the callback does nothing
usart_async_register_callback(SIM_peripheral_descriptors[i], USART_ASYNC_TXC_CB, SIM_tx_cb); // to count the number of bytes transmitted since we are using it asynchronously
+ usart_async_register_callback(SIM_peripheral_descriptors[i], USART_ASYNC_ERROR_CB, _SIM_error_cb);
usart_async_enable(SIM_peripheral_descriptors[i]);
}
}
diff --git a/sysmoOCTSIM/talloc.c b/sysmoOCTSIM/talloc.c
index c5c9062..ed6ea0c 100644
--- a/sysmoOCTSIM/talloc.c
+++ b/sysmoOCTSIM/talloc.c
@@ -30,6 +30,7 @@
inspired by http://swapped.cc/halloc/
*/
+#include <parts.h>
#include "replace.h"
#include "talloc.h"
@@ -801,6 +802,8 @@ static inline void *__talloc(const void *context,
size_t size,
struct talloc_chunk **tc)
{
+ if( SCB->ICSR & SCB_ICSR_VECTACTIVE_Msk)
+ while(1) { asm("nop");};
return __talloc_with_prefix(context, size, 0, tc);
}