Getting Unknown Exception thrown but no traceback
Posted: Mon Feb 27, 2017 8:54 pm
I'm using the minimal build of mp running on an ATMEL ATSAME70Q21. At the initialization of mp (and my firmware in general) I load several (around 70+) py scripts using the following code:
About halfway through the scripts being loaded I start getting Uncaught Exception errors but no lexer errors. I also don't get a traceback. At first I thought it could be because of my heap size being too small, but doubling the heap size didn't help.
Is there anywhere else I should be looking? I know the scripts are sound because they were each tested individually before trying to load all of them.
Code: Select all
void add_script(const char *src)
{
debugf(src);
mp_lexer_t *lex = mp_lexer_new_from_str_len(MP_QSTR__lt_stdin_gt_, src, strlen(src), 0);
if (lex == NULL) {
debugf("MPY ** MemoryError: lexer could not allocate **");
return;
}
nlr_buf_t nlr;
if (nlr_push(&nlr) == 0)
{
qstr source_name = lex->source_name;
mp_parse_tree_t parse_tree = mp_parse(lex, MP_PARSE_FILE_INPUT);
mp_obj_t module_fun = mp_compile(&parse_tree, source_name, MP_EMIT_OPT_NONE, true);
mp_call_function_0(module_fun);
nlr_pop();
} else {
// uncaught exception
debugf("MPY ** Uncaught Exception **");
mp_obj_print_exception(&mp_plat_print, (mp_obj_t)nlr.ret_val);
}
}
Is there anywhere else I should be looking? I know the scripts are sound because they were each tested individually before trying to load all of them.