ESP32 ulp - can mos compile .S assembler files?

I am not sure how to export everythink into libulp.a . I found one part of the missing symbols in the following ESP-IDF file ulp_main.ld:

/* Variable definitions for ESP32ULP linker
*This file is generated automatically by esp32ulp_mapgen.py utility.
*/

PROVIDE ( ulp_changed = 0x50000054 );
PROVIDE ( ulp_debounce_counter = 0x500000d0 );
PROVIDE ( ulp_debounce_max_count = 0x500000d4 );
PROVIDE ( ulp_edge_count = 0x500000d8 );
PROVIDE ( ulp_edge_count_to_wake_up = 0x500000dc );
PROVIDE ( ulp_edge_detected = 0x50000070 );
PROVIDE ( ulp_entry = 0x50000000 );
PROVIDE ( ulp_io_number = 0x500000e0 );
PROVIDE ( ulp_next_edge = 0x500000cc );
PROVIDE ( ulp_wake_up = 0x500000b8 );

And the other part of it in ulp-example.map:

.rodata.embedded
                0x3f402d65       0xd8 C:/msys32/home/name/esp/ulp/build/main\libmain.a(ulp_main.bin.bin.o)
                0x3f402d65                _binary_ulp_main_bin_start
                0x3f402e3d                _binary_ulp_main_bin_end

OK, so the linker script provides the missing symbols.
Since mongoose os build command does not use that linker script, you need to move those symbols manually into your .c file. Example:

uint32_t *ulp_debounce_counter_pointer = (uint32_t *) 0x500000d0;
...

So instead of only declaring them, define the pointers, and use pointers in your code. Maybe there is a cleaner way without the pointers, but that’s something that first comes to mind.