blackmagic-espidf
blackmagic-espidf copied to clipboard
Error when compiling the bootloader.bin
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
- Type
makeagain it will compile the rest of the firmware - overwrite the bad
bootloader.binwith a good one you can get from the binaries you can find in this page: https://www.visualmicro.com/page/Create-a-WiFi-Black-Magic-GDB-Probe-from-ESP8266.aspx
P.D: Many thanks for this awesome project, this tool is fantastic!!
If you use python2.7, make will succeed
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.



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.
Hi, The problem is newer version of STM32CubeIDE. you can see : https://github.com/walmis/blackmagic-espidf/issues/8
Got it, So which versions does it support? Or how can I get it to run with the current Cube ide.
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