Open Papadoma opened 4 years ago
Can you give me link to your fixes?
I haven't worked on it for a while I will give it another look this week and come back to you
i have this problem in windows 10, how can it be solved?
Traceback (most recent call last):l\Arduino15\packages\esp32\tools\ulptool\src/esp32ulp_mapgen.py -s ulp_main.sym -o ulp_main
File "C:\Users\jotas\AppData\Local\Arduino15\packages\esp32\tools\ulptool\src/esp32ulp_mapgen.py", line 54, in
exit status 1 Error compiling for board ESP32 Dev Module.
Here in Sept-2022 this problem also occurred for me when attempting to build any of the example code I've found.
Environment:
The steps I took to get here (not sure of the order)...
# python -2
to the top of both esp32ulp_build_recipe.py and esp32ulp_mapgen.py, to force the use of Python v2.xAt that point I was left with the "ValueError: not enough values to unpack" issue. I tracked that down to the generation of the symbol "ulp_main.sym" file performed in esp32ulp_buildrecipe.py using [nm](https://en.wikipedia.org/wiki/Nm(Unix)) resulting in extra empty lines. When esp32ulp_mapgen.py attempts to parse the line and split it using space as a delimiter, it doesn't know what to do with the empty lines and errors out.
I hacked together a fix for esp32ulp_build_recipe.py using this StackOverflow post as guidance.
Original Code
## Generate list of global symbols
cmd = gen_binutils_nm_cmd(PATHS)
proc = subprocess.Popen(cmd[1],stdout=subprocess.PIPE,stderr=subprocess.PIPE,shell=False)
(out, err) = proc.communicate()
if err:
error_string = cmd[0] + '\r' + err
sys.exit(error_string)
else:
file_names_constant = gen_file_names_constant()
with open(file_names_constant['sym'],"w") as fsym:
fsym.write(out.decode('utf-8'))
console_string += cmd[0] + '\r'
Revised Code
## Generate list of global symbols
cmd = gen_binutils_nm_cmd(PATHS)
proc = subprocess.Popen(cmd[1],stdout=subprocess.PIPE,stderr=subprocess.PIPE,shell=False)
(out, err) = proc.communicate()
if err:
error_string = cmd[0] + '\r' + err.decode('utf-8')
sys.exit(error_string)
else:
file_names_constant = gen_file_names_constant()
with open(file_names_constant['sym'],"w") as fsym:
fsym.write(out.decode('utf-8'))
with open(file_names_constant['sym']) as filehandle:
lines = filehandle.readlines()
with open(file_names_constant['sym'], 'w') as filehandle:
lines = filter(lambda x: x.strip(), lines)
filehandle.writelines(lines)
console_string += cmd[0] + '\r'
I've successfully compiled and run the readme example, and compiled a handful of the other ulptool examples (haven't tried flashing them yet, but they compile).
Hopefully someone finds this helpful :)
(edited for formatting)
ESP32 1.0.4 Latest ulptool
I've fixed some errors on the recipe.py, mostly to do with casting bytes to strings
Now I get `python C:\Users\Papadoma\AppData\Local\Arduino15\packages\esp32\tools\ulptool\src/esp32ulp_mapgen.py -s ulp_main.sym -o ulp_main Traceback (most recent call last):
File "C:\Users\Papadoma\AppData\Local\Arduino15\packages\esp32\tools\ulptool\src/esp32ulp_mapgen.py", line 54, in
File "C:\Users\Papadoma\AppData\Local\Arduino15\packages\esp32\tools\ulptool\src/esp32ulp_mapgen.py", line 49, in main
File "C:\Users\Papadoma\AppData\Local\Arduino15\packages\esp32\tools\ulptool\src/esp32ulp_mapgen.py", line 22, in gen_ld_h_from_sym
ValueError: not enough values to unpack (expected 3, got 0)`