Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when compiling the bootloader.bin #12

Open
aguaviva opened this issue Jan 11, 2023 · 5 comments
Open

Error when compiling the bootloader.bin #12

aguaviva opened this issue Jan 11, 2023 · 5 comments

Comments

@aguaviva
Copy link

aguaviva commented Jan 11, 2023

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
Copy link

JasonN3 commented Jan 24, 2023

If you use python2.7, make will succeed

@ethem4161
Copy link

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
Copy link

ahmadmn commented Jan 27, 2023

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
Copy link

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

@ahmadmn
Copy link

ahmadmn commented Feb 10, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants