New ESP32 Board Bootloader
New ESP32 Board Bootloader
Hi,
I'm throwing myself on the mercy of everyone on the forum!
I've been extremely naïve and ignorant and I have commissioned a new ESP32 board to my basic specification. I want a board that is a lot narrower and more powerful than any of the ones that are on the market at the moment. I got someone on Fiverr to design it for me and it was manufactured in China for me. So, I now have five boards to play with but, what I didn't realise (blindingly obvious to me now...) was that there is a whole piece around creating a bootloader and uploading it to the board.
The designer isn't being very forthcoming and I have no money left to get it sorted by another third party. So, I'm left with figuring this out for myself, with whatever information I can mine from elsewhere (here!).
So, I have a board, which I believe I should be able to connect directly to the the pc to create a new bootloader but, I've been unable to. ( Using ESP-IDF, i got the following error: SerialException: could not open port '(3)': FileNotFoundError(2, 'The system cannot find the file specified.', None, 2)). I'm sure that it is on COM3, as there is only one port and it disappears when I disconnect the board.
Also, the designer tells me that I need a serial communication interface module to allow the connection but from what I understand of the components on the board, I don't think I do. I think that this is what the component FT232RL is doing (see schematic below). Can anyone tell me which is correct and how I resolve the connectivity issue?
I'm sure there will be many issues in trying to figure this out but can you help me get started? Please fire questions at me and I will do my best to answer.
Many thanks,
I'm throwing myself on the mercy of everyone on the forum!
I've been extremely naïve and ignorant and I have commissioned a new ESP32 board to my basic specification. I want a board that is a lot narrower and more powerful than any of the ones that are on the market at the moment. I got someone on Fiverr to design it for me and it was manufactured in China for me. So, I now have five boards to play with but, what I didn't realise (blindingly obvious to me now...) was that there is a whole piece around creating a bootloader and uploading it to the board.
The designer isn't being very forthcoming and I have no money left to get it sorted by another third party. So, I'm left with figuring this out for myself, with whatever information I can mine from elsewhere (here!).
So, I have a board, which I believe I should be able to connect directly to the the pc to create a new bootloader but, I've been unable to. ( Using ESP-IDF, i got the following error: SerialException: could not open port '(3)': FileNotFoundError(2, 'The system cannot find the file specified.', None, 2)). I'm sure that it is on COM3, as there is only one port and it disappears when I disconnect the board.
Also, the designer tells me that I need a serial communication interface module to allow the connection but from what I understand of the components on the board, I don't think I do. I think that this is what the component FT232RL is doing (see schematic below). Can anyone tell me which is correct and how I resolve the connectivity issue?
I'm sure there will be many issues in trying to figure this out but can you help me get started? Please fire questions at me and I will do my best to answer.
Many thanks,
- Attachments
-
- USB-TTL.jpg (222.67 KiB) Viewed 6902 times
-
- Posts: 9764
- Joined: Thu Nov 26, 2015 4:08 am
Re: New ESP32 Board Bootloader
Looks good to me. Not sure why ESP-IDF doesn't see the port: does a similar setup work OK with a more conventional devboard?
Re: New ESP32 Board Bootloader
Hmm...
I've tried the new one on my pc (as opposed to my laptop) and I am getting the same result. I have tried a known working board using the pc and still got the same message: C:\Users\cmcil\Desktop\esp-idf-2\examples\get-started\hello_world>idf.py -p 3 -b 115200 flash
Executing action: flash
Running ninja in directory c:\users\cmcil\desktop\esp-idf-2\examples\get-started\hello_world\build
Executing "ninja flash"...
[1/4] Performing build step for 'bootloader'
ninja: no work to do.
[1/2] cmd.exe /C "cd /D C:\Users\cmcil\Desktop\esp-idf-2\c...Desktop/esp-idf-2/components/esptool_py/run_esptool.cmake"
esptool.py --chip esp32 -p 3 -b 115200 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 2MB 0x8000 partition_table/partition-table.bin 0x1000 bootloader/bootloader.bin 0x10000 hello-world.bin
esptool.py v3.0
Serial port 3
Traceback (most recent call last):
File "C:/Users/cmcil/Desktop/esp-idf-2/components/esptool_py/esptool/esptool.py", line 3969, in <module>
_main()
File "C:/Users/cmcil/Desktop/esp-idf-2/components/esptool_py/esptool/esptool.py", line 3962, in _main
main()
File "C:/Users/cmcil/Desktop/esp-idf-2/components/esptool_py/esptool/esptool.py", line 3551, in main
esp = chip_class(each_port, initial_baud, args.trace)
File "C:/Users/cmcil/Desktop/esp-idf-2/components/esptool_py/esptool/esptool.py", line 271, in __init__
self._port = serial.serial_for_url(port)
File "C:\Users\cmcil\.espressif\python_env\idf4.2_py3.8_env\lib\site-packages\serial\__init__.py", line 90, in serial_for_url
instance.open()
File "C:\Users\cmcil\.espressif\python_env\idf4.2_py3.8_env\lib\site-packages\serial\serialwin32.py", line 64, in open
raise SerialException("could not open port {!r}: {!r}".format(self.portstr, ctypes.WinError()))
serial.serialutil.SerialException: could not open port '3': FileNotFoundError(2, 'The system cannot find the file specified.', None, 2)
CMake Error at run_cmd.cmake:14 (message):
esptool.py failed
Call Stack (most recent call first):
run_esptool.cmake:21 (include)
FAILED: CMakeFiles/flash
cmd.exe /C "cd /D C:\Users\cmcil\Desktop\esp-idf-2\components\esptool_py && C:\Users\cmcil\.espressif\tools\cmake\3.16.4\bin\cmake.exe -D IDF_PATH="C:/Users/cmcil/Desktop/esp-idf-2" -D ESPTOOLPY="C:\Users\cmcil\.espressif\python_env\idf4.2_py3.8_env\Scripts\python.exe C:/Users/cmcil/Desktop/esp-idf-2/components/esptool_py/esptool/esptool.py --chip esp32" -D ESPTOOL_ARGS="--before=default_reset --after=hard_reset write_flash @flash_args" -D WORKING_DIRECTORY="C:/Users/cmcil/Desktop/esp-idf-2/examples/get-started/hello_world/build" -P C:/Users/cmcil/Desktop/esp-idf-2/components/esptool_py/run_esptool.cmake"
ninja: build stopped: subcommand failed.
ninja failed with exit code 1
Could it be a permissions issue?. The last result is from running the command line as administrator, though.
I've tried the new one on my pc (as opposed to my laptop) and I am getting the same result. I have tried a known working board using the pc and still got the same message: C:\Users\cmcil\Desktop\esp-idf-2\examples\get-started\hello_world>idf.py -p 3 -b 115200 flash
Executing action: flash
Running ninja in directory c:\users\cmcil\desktop\esp-idf-2\examples\get-started\hello_world\build
Executing "ninja flash"...
[1/4] Performing build step for 'bootloader'
ninja: no work to do.
[1/2] cmd.exe /C "cd /D C:\Users\cmcil\Desktop\esp-idf-2\c...Desktop/esp-idf-2/components/esptool_py/run_esptool.cmake"
esptool.py --chip esp32 -p 3 -b 115200 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 2MB 0x8000 partition_table/partition-table.bin 0x1000 bootloader/bootloader.bin 0x10000 hello-world.bin
esptool.py v3.0
Serial port 3
Traceback (most recent call last):
File "C:/Users/cmcil/Desktop/esp-idf-2/components/esptool_py/esptool/esptool.py", line 3969, in <module>
_main()
File "C:/Users/cmcil/Desktop/esp-idf-2/components/esptool_py/esptool/esptool.py", line 3962, in _main
main()
File "C:/Users/cmcil/Desktop/esp-idf-2/components/esptool_py/esptool/esptool.py", line 3551, in main
esp = chip_class(each_port, initial_baud, args.trace)
File "C:/Users/cmcil/Desktop/esp-idf-2/components/esptool_py/esptool/esptool.py", line 271, in __init__
self._port = serial.serial_for_url(port)
File "C:\Users\cmcil\.espressif\python_env\idf4.2_py3.8_env\lib\site-packages\serial\__init__.py", line 90, in serial_for_url
instance.open()
File "C:\Users\cmcil\.espressif\python_env\idf4.2_py3.8_env\lib\site-packages\serial\serialwin32.py", line 64, in open
raise SerialException("could not open port {!r}: {!r}".format(self.portstr, ctypes.WinError()))
serial.serialutil.SerialException: could not open port '3': FileNotFoundError(2, 'The system cannot find the file specified.', None, 2)
CMake Error at run_cmd.cmake:14 (message):
esptool.py failed
Call Stack (most recent call first):
run_esptool.cmake:21 (include)
FAILED: CMakeFiles/flash
cmd.exe /C "cd /D C:\Users\cmcil\Desktop\esp-idf-2\components\esptool_py && C:\Users\cmcil\.espressif\tools\cmake\3.16.4\bin\cmake.exe -D IDF_PATH="C:/Users/cmcil/Desktop/esp-idf-2" -D ESPTOOLPY="C:\Users\cmcil\.espressif\python_env\idf4.2_py3.8_env\Scripts\python.exe C:/Users/cmcil/Desktop/esp-idf-2/components/esptool_py/esptool/esptool.py --chip esp32" -D ESPTOOL_ARGS="--before=default_reset --after=hard_reset write_flash @flash_args" -D WORKING_DIRECTORY="C:/Users/cmcil/Desktop/esp-idf-2/examples/get-started/hello_world/build" -P C:/Users/cmcil/Desktop/esp-idf-2/components/esptool_py/run_esptool.cmake"
ninja: build stopped: subcommand failed.
ninja failed with exit code 1
Could it be a permissions issue?. The last result is from running the command line as administrator, though.
-
- Posts: 9764
- Joined: Thu Nov 26, 2015 4:08 am
Re: New ESP32 Board Bootloader
I see that you didn't specify a serial port this time, perhaps you need to do that? (Either using menuconfig or the -p switch for idf.py flash)
Re: New ESP32 Board Bootloader
Is your port set to "COM3" or just "3"
Re: New ESP32 Board Bootloader
Ahh! That makes a difference! It still doesn't work but it doesn't work differently, now. I never thought of putting in 'COM'. Thanks
So, now it is timing out for the new board but IS connecting for the working board.
Serial port COM3
Connecting........_____....._____....._____....._____....._____....._____....._____
Serial port COM4
Connecting....
Chip is ESP32-D0WDQ6 (revision 1)
I read somewhere that, for a new blank board, a new bootloader needs to be burned first and they used more hardware to create that first bootloader. That was what the designer seemed to be saying, also. The new board needs to be 3.3v, so do I need to connect an Arduino Nano (or whatever) to provide the 3.3v and the first bootloader? If so, how do I do that?
Thanks
So, now it is timing out for the new board but IS connecting for the working board.
Serial port COM3
Connecting........_____....._____....._____....._____....._____....._____....._____
Serial port COM4
Connecting....
Chip is ESP32-D0WDQ6 (revision 1)
I read somewhere that, for a new blank board, a new bootloader needs to be burned first and they used more hardware to create that first bootloader. That was what the designer seemed to be saying, also. The new board needs to be 3.3v, so do I need to connect an Arduino Nano (or whatever) to provide the 3.3v and the first bootloader? If so, how do I do that?
Thanks
Re: New ESP32 Board Bootloader
Check out the circuit used on the Node32 board as an example. I use this on my boards and it works.
https://forum.arduino.cc/index.php?topic=566250.0
https://forum.arduino.cc/index.php?topic=566250.0
Re: New ESP32 Board Bootloader
You can also use a stand alone programmer to install the bootloader and your own code before you solder it to your board.
https://www.ebay.com.au/itm/New-ESP32-P ... 3204856757
https://www.ebay.com.au/itm/New-ESP32-P ... 3204856757
-
- Posts: 9764
- Joined: Thu Nov 26, 2015 4:08 am
Re: New ESP32 Board Bootloader
If you're referring to burning a bootloader to be able to program them via a serial port: This is true for classic Arduino boards: in order to be able to program the ATMega chip they have via serial, you need to upload a bootloader using ISP programming. For an ESP32 this is not true, it always has a bootloader in ROM from the factory that allows you to talk to the chip over the serial port. (Actually, that ROM is the thing telling you that the 'Chip is ESP32-D0WDQ6 (revision 1)'.)lannocm wrote: ↑Sun Feb 07, 2021 11:03 amI read somewhere that, for a new blank board, a new bootloader needs to be burned first and they used more hardware to create that first bootloader. That was what the designer seemed to be saying, also. The new board needs to be 3.3v, so do I need to connect an Arduino Nano (or whatever) to provide the 3.3v and the first bootloader? If so, how do I do that?
Re: New ESP32 Board Bootloader
Most likely you are not booting into flash mode using strapping pins
Who is online
Users browsing this forum: Google [Bot] and 276 guests