I am trying to make use of the ultra low power (ulp) feature on the ESP32. I am getting unresolved externals (for example “_binary_ulp_main_bin_start”) which are defined in a .S assembler file.
Is it possible for the mos tool to build assembler (.S) files?
just to follow up with this: I have built a library (.a) using both the ESP IDF and with the Arduino ULP port but both are unable to find the ulp_entry variable:
(.literal._Z17start_ulp_programv+0x0): undefined reference to ‘ulp_entry’.
So other ulp_ variables are being recognized just not that one variable- the entry point into the assembler code.
I see ulp_entry (and ulp_exit) in the .ld file:
PROVIDE (ulp_entry = 0x50000190 );
so I think it is linked into the object file and in the .a library.
I added the library to my mos.yml using:
binary_libs:
@ted@cpq did anyone had success comiling .S file with mos? My project heavily depends on ulp use, if there is no option for it, we have to move away from mongoose os
I gave up after a while- I got almost everything working except the one function in main which was an unresolved variable linker error. But I was able to get everything working in the Expressa IDF.
@cpq@ted thanks for your help. I compiled an .S file with ESP-IDF into an lib.a file, but after adding it to binary_libs I am getting the same errors ted described in the beginning: “unresolved externals (for example “_binary_ulp_main_bin_start”)”. How can this be solved?
@cpq I created a dedicated project to test it. So I cloned the mos empty example (GitHub - mongoose-os-apps/empty) and copied the main content from the espressif ulp pulse counter example (esp-idf/examples/system/ulp at v3.3.1 · espressif/esp-idf · GitHub) into it. I moved app_main() into mgos_app_init() and added build_vars and binary_libs to mos.yml. src dir contains lib dir and it contains libulp_custom.a.
Could you create a sample minimal mos project with the pre-built ULP binary library, please?
If you can pack it and attach the zip file to this thread, that’d be helpful