[TM4C123] how to disable debugging info in REPL

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
Post Reply
ExXec
Posts: 72
Joined: Sat Oct 20, 2018 4:02 pm

[TM4C123] how to disable debugging info in REPL

Post by ExXec » Sun Mar 31, 2019 4:48 pm

Hi,

After every command in the REPL i get this GC info:

Code: Select all

>>> a = 1
took 0 ms
qstr:
  n_pool=1
  n_qstr=1
  n_str_data_bytes=4
  n_total_bytes=100
GC: total: 16128, used: 416, free: 15712
 No. of 1-blocks: 6, 2-blocks: 3, max blk sz: 8, max free sz: 923
Even though I disabled it in the gccollect.c:

Code: Select all

void gc_collect(void) {
    // get current time, in case we want to time the GC
    #if 0
    uint32_t start = mp_hal_ticks_us();
    #endif

    // start the GC
    gc_collect_start();

    // get the registers and the sp
    mp_uint_t regs[10];
    mp_uint_t sp = gc_helper_get_regs_and_sp(regs);

    // trace the stack, including the registers (since they live on the stack in this function)
    #if MICROPY_PY_THREAD
    gc_collect_root((void**)sp, ((uint32_t)MP_STATE_THREAD(stack_top) - sp) / sizeof(uint32_t));
    #else
    gc_collect_root((void**)sp, ((uint32_t)&_ram_end - sp) / sizeof(uint32_t));
    #endif

    // trace root pointers from any threads
    #if MICROPY_PY_THREAD
    mp_thread_gc_others();
    #endif

    // end the GC
    gc_collect_end();

    #if 0
    // print GC info
//    uint32_t ticks = mp_hal_ticks_us() - start;
    gc_info_t info;
    gc_info(&info);
    printf("GC");
    printf(" " UINT_FMT " total\n", info.total);
    printf(" " UINT_FMT " : " UINT_FMT "\n", info.used, info.free);
    printf(" 1=" UINT_FMT " 2=" UINT_FMT " m=" UINT_FMT "\n", info.num_1block, info.num_2block, info.max_block);
    #endif
}

Where else can this be coming from?

Thanks
-ExXec
Last edited by ExXec on Mon Apr 15, 2019 2:23 pm, edited 1 time in total.

jickster
Posts: 629
Joined: Thu Sep 07, 2017 8:57 pm

Re: [TM4C123] gc info disabled in gccollect.c but still displaying in repl?

Post by jickster » Sun Mar 31, 2019 9:03 pm

What you disabled doesn’t even contain “n_pool”.

It’s in pyexec.c, 127


Sent from my iPhone using Tapatalk Pro

ExXec
Posts: 72
Joined: Sat Oct 20, 2018 4:02 pm

Re: [TM4C123] gc info disabled in gccollect.c but still displaying in repl?

Post by ExXec » Tue Apr 02, 2019 9:35 pm

can I switch this off with a define in the mpconfigport or by doing some settings in the main() ?

jickster
Posts: 629
Joined: Thu Sep 07, 2017 8:57 pm

Re: [TM4C123] gc info disabled in gccollect.c but still displaying in repl?

Post by jickster » Sat Apr 06, 2019 2:23 am

I gave you the code that does this and the macro you have to switch off.


Sent from my iPhone using Tapatalk Pro

ExXec
Posts: 72
Joined: Sat Oct 20, 2018 4:02 pm

Re: [TM4C123] gc info disabled in gccollect.c but still displaying in repl?

Post by ExXec » Sat Apr 13, 2019 7:38 pm

Yes, I saw that.

It happens, because the repl_display_debugging_info is set to 1 in the pyexec.c

But I don't know where it gets set.
It is initialized as 0 and it does not appear anywhere in my code again (except in function where this option can be set via python).
And I don't have a boot.py or main.py or frozencode.

Why is this 1 if I didn't set it?

Post Reply