walmis / blackmagic-espidf

Blackmagic Wireless SWD Debug probe hosted on esp-idf SDK (for ESP8266) with UART on Telnet port and HTTP using xterm.js
249 stars 48 forks source link

Error when compiling the bootloader.bin #12

Open aguaviva opened 1 year ago

aguaviva commented 1 year ago

This is what I got:

CC build/bootloader/esp8266/source/esp_fast_boot.o
AR build/bootloader/esp8266/libesp8266.a
LD build/bootloader/bootloader.elf
esptool.py v2.4.0
Traceback (most recent call last):
  File "/home/me/blackmagic-espidf/ESP8266_RTOS_SDK/components/esptool_py/esptool/esptool.py", line 3034, in <module>
    _main()
  File "/home/me/blackmagic-espidf/ESP8266_RTOS_SDK/components/esptool_py/esptool/esptool.py", line 3027, in _main
    main()
  File "/home/me/blackmagic-espidf/ESP8266_RTOS_SDK/components/esptool_py/esptool/esptool.py", line 2800, in main
    operation_func(args)
  File "/home/me/blackmagic-espidf/ESP8266_RTOS_SDK/components/esptool_py/esptool/esptool.py", line 2369, in elf2image
    image.save(args.output)
  File "/home/me/blackmagic-espidf/ESP8266_RTOS_SDK/components/esptool_py/esptool/esptool.py", line 1380, in save
    checksum = self.save_segment(f, segment, checksum)
  File "/home/me/blackmagic-espidf/ESP8266_RTOS_SDK/components/esptool_py/esptool/esptool.py", line 1290, in save_segment
    f.write(segment.data)
TypeError: a bytes-like object is required, not 'str'
make[1]: *** [/home/me/blackmagic-espidf/ESP8266_RTOS_SDK/components/esptool_py/Makefile.projbuild:72: /home/me/blackmagic-espidf/build/bootloader/bootloader.bin] Error 1
make: *** [/home/me/blackmagic-espidf/ESP8266_RTOS_SDK/components/bootloader/Makefile.projbuild:40: /home/me/blackmagic-espidf/build/bootloader/bootloader.bin] Error 2

If we inspect the bootloader.bin well notice that it is 16 bytes, that is wrong, don't use it!

A workaround

P.D: Many thanks for this awesome project, this tool is fantastic!!

JasonN3 commented 1 year ago

If you use python2.7, make will succeed

ethem4161 commented 1 year ago

Hi, I couldn't compile at first either. Then I did the Flash process to Esp8266 through this site. Create a WiFi Black Magic GDB Probe from ESP8266 However, I have a problem. It gives an error when I set GDB Server via StmCubeIDE. What would be the reason. How can i solve this problem.

2023-01-25 131126

2023-01-25 131427

2023-01-25 131500

ahmadmn commented 1 year ago

Hi, I couldn't compile at first either. Then I did the Flash process to Esp8266 through this site. Create a WiFi Black Magic GDB Probe from ESP8266 However, I have a problem. It gives an error when I set GDB Server via StmCubeIDE. What would be the reason. How can i solve this problem.

2023-01-25 131126

2023-01-25 131427

2023-01-25 131500

Hi, The problem is newer version of STM32CubeIDE. you can see : https://github.com/walmis/blackmagic-espidf/issues/8

ethem4161 commented 1 year ago

Got it, So which versions does it support? Or how can I get it to run with the current Cube ide.

ahmadmn commented 1 year ago

You can run GDB commands outside of the CubeIDE. The ide generate .elf file and you can upload this file to your mcu. e.g. on Windows command lines type below commands to program .elf file :

C:\ST\STM32CubeIDE_1.11.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.win32_1.0.100.202210260954\tools\bin arm-none-eabi-gdb.exe

(gdb) target extended-remote 192.168.4.1:2022 (gdb) monitor swdp_scan (gdb) file C:/Users/ahmad/STM32CubeIDE/workspace_1.1.0/Drive4QD_BMPtester/Debug/Drive4QD_BMPtester.elf (gdb) att 1 (gdb) load (gdb) q