Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use DEBUG_VERBOSE to build micropython? #3732

Closed
eminarcissus opened this issue Apr 20, 2018 · 5 comments
Closed

How to use DEBUG_VERBOSE to build micropython? #3732

eminarcissus opened this issue Apr 20, 2018 · 5 comments

Comments

@eminarcissus
Copy link

Hi,

I've written a C based python module for esp32, and after I have it compiled in the firmware, it said cannot find module. I did check there's module.o in application.map, and I've checked builtinimport there's a debug arguments named MICROPY_DEBUG_VERBOSE in the code. So I added -DMICROPY_DEBUG_VERBOSE in the makefile, but it failed to compile with error
malloc.c:(.text.m_malloc_maybe+0x18): undefined reference to DEBUG_printf' build/py/malloc.o:malloc.c:(.text.m_malloc_with_finaliser+0x1f): more undefined references to DEBUG_printf' follow
Makefile:844: recipe for target 'build/application.elf' failed

So I'm wondering how to use this DEBUG VERBOSE flag?

@stinos
Copy link
Contributor

stinos commented Apr 20, 2018

lib/util/printf.c has a definition of DEBUG_printf if MICROPY_DEBUG_PRINTERS is 1, but there are probably other ways, I assume -DDEBUG_printf=printf or so might also do the trick, not tested though

@eminarcissus
Copy link
Author

eminarcissus commented Apr 20, 2018 via email

@dpgeorge
Copy link
Member

The esp32 port doesn't use the internal (uPy-provided) printf code because it has its own printf that it needs to use. You might need to add your own implementation of DEBUG_printf, just copy that in lib/utils/printf.c

Note that you can do help('modules') at the REPL to list known built-in modules. And you must put your custom C modules in mpconfigport.h, in MICROPY_PORT_BUILTIN_MODULES

@eminarcissus
Copy link
Author

Got it working right now, that really helps, thx very much for the help :)

@MichaelAkhnoukh
Copy link

Got it working right now, that really helps, thx very much for the help :)

could you please tell me how
i've tried enabling MICROPY_DEBUG_PRINTERS to get DEBUG_printf but i always get bootloop

jgillick pushed a commit to jgillick/micropython that referenced this issue Nov 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants