ESP32 JTAG Programming fails at Verification - visual-studio-code

The code is working. I can build it and to mention. it was working, i could upload it to my custom made ESP32 board. From all of a sudden it stopped working. Tried with different PCB boards also different cables.
I somehow resolved my problem so i can program it, but now i get a verification error after Programming Finished
Here is my complete log from terminal.
Processing esp32dev (platform: espressif32; board: esp32dev; framework: espidf)
-----------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (3.4.0) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
- framework-espidf 3.40301.0 (4.3.1)
- tool-cmake 3.16.4
- tool-esptoolpy 1.30100.210531 (3.1.0)
- tool-mkspiffs 2.230.0 (2.30)
- tool-ninja 1.9.0
- tool-openocd-esp32 2.1000.20210721 (10.0)
- toolchain-esp32ulp 1.22851.191205 (2.28.51)
- toolchain-riscv32-esp 8.4.0+2021r1
- toolchain-xtensa-esp32 8.4.0+2021r1
- toolchain-xtensa-esp32s2 8.4.0+2021r1
Reading CMake configuration...
LDF: Library Dependency Finder ->
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 0 compatible libraries
Scanning dependencies...
No dependencies
Building in debug mode
Retrieving maximum program size .pio/build/esp32dev/firmware.elf
Checking size .pio/build/esp32dev/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [= ] 10.1% (used 32992 bytes from 327680 bytes)
Flash: [======== ] 75.7% (used 794197 bytes from 1048576 bytes)
Configuring upload protocol...
AVAILABLE: esp-prog, espota, esptool, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa
CURRENT: upload_protocol = esp-prog
Uploading .pio/build/esp32dev/firmware.bin
Open On-Chip Debugger v0.10.0-esp32-20210721 (2021-07-21-13:34)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
debug_level: 1
adapter speed: 20000 kHz
WARNING: boards/esp-wroom-32.cfg is deprecated, and may be removed in a future release.
adapter speed: 2000 kHz
** Programming Started **
** Programming Finished **
** Verify Started **
Error: **** Verification failure! ****
Error: target_hash cbc6a9...992065
Error: file_hash: 773d62...93803f
embedded:startup.tcl:449: Error: ** Verify Failed **
in procedure 'program_esp'
in procedure 'program_error' called at file "/Users/USER/.platformio/packages/tool-openocd-esp32/share/openocd/scripts/target/esp_common.cfg", line 135
at file "embedded:startup.tcl", line 449
*** [upload] Error 1

Related

HandBrake CLI not working on Linux server using Flatpack - hb_stream_open PATH_TO_FILE failed

Running HandBrakeCLI through flatpack - unable to open any file.
flatpak run --filesystem=host --command=HandBrakeCLI fr.handbrake.ghb -i "/var/www/html/mit4mit.co.il/httpdocs/vimeo/drop.avi" -o "/var/www/html/mit4mit.co.il/vimeo/converted.mp4"
Cannot load libnvidia-encode.so.1
[09:47:25] hb_init: starting libhb thread
[09:47:25] thread 7f4d70c25700 started ("libhb")
HandBrake 1.3.1 (2020020500) - Linux x86_64 - https://handbrake.fr
2 CPUs detected
Opening /var/www/html/mit4mit.co.il/httpdocs/vimeo/drop.avi...
[09:47:25] CPU: Intel(R) Xeon(R) CPU E5-2686 v4 # 2.30GHz
[09:47:25] - Intel microarchitecture Broadwell
[09:47:25] - logical processor count: 2
[09:47:25] hb_scan: path=/var/www/html/mit4mit.co.il/httpdocs/vimeo/drop.avi, title_index=1
disc.c:323: failed opening UDF image /var/www/html/mit4mit.co.il/httpdocs/vimeo/drop.avi
disc.c:424: error opening file BDMV/index.bdmv
disc.c:424: error opening file BDMV/BACKUP/index.bdmv
bluray.c:2585: nav_get_title_list(/var/www/html/mit4mit.co.il/httpdocs/vimeo/drop.avi/) failed
[09:47:25] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 6.0.1
libdvdread: Encrypted DVD support unavailable.
libdvdread: Can't stat /var/www/html/mit4mit.co.il/httpdocs/vimeo/drop.avi
No such file or directory
libdvdread: Could not open /var/www/html/mit4mit.co.il/httpdocs/vimeo/drop.avi
libdvdnav: vm: failed to open/read the DVD
[09:47:25] dvd: not a dvd - trying as a stream/file instead
[09:47:25] hb_stream_open: open /var/www/html/mit4mit.co.il/httpdocs/vimeo/drop.avi failed
[09:47:25] scan: unrecognized file type
[09:47:25] libhb: scan thread found 0 valid title(s)
No title found.
No matter what I do I cannot make HandBrakeCLI find the input file. I've seen online that the important line here is hb_stream_open - all the failures above it are ok.
This is because flatpack is sandboxing it's apps -
Flatpak docs on sandbox-permissions#filesystem-access

PlatformIO:[upload] Error 2 with esp8266 ESP-07 board

I use VSCODE to create project. I create a project and select ESp-07 board and ESP8266 RTOS SDK framework then create a main.c file in src directory and copy content of main.c file of esp8266-rtos-sdk-blink example to my project main.c file. it compile successfully but when i want to upload it to my board following error occur :
Processing esp07 (platform: espressif8266; framework: esp8266-rtos-sdk; board: esp07)
Verbose mode can be enabled via -v, --verbose option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/esp07.html
PLATFORM: Espressif 8266 2.3.2 > Espressif Generic ESP8266 ESP-07
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES: toolchain-xtensa 1.40802.0 (4.8.2), framework-esp8266-rtos-sdk 1.5.0-beta.5, tool-esptool
1.413.0 (4.13), tool-esptoolpy 1.20800.0 (2.8.0), tool-mkspiffs 1.200.0 (2.0)
LDF: Library Dependency Finder -> bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 0 compatible libraries
Scanning dependencies…
No dependencies
Building in release mode
Retrieving maximum program size .pio\build\esp07\firmware.elf
Checking size .pio\build\esp07\firmware.elf
Advanced Memory Usage is available via “PlatformIO Home > Project Inspect”
DATA: [==== ] 36.3% (used 29754 bytes from 81920 bytes)
PROGRAM: [======= ] 73.9% (used 278664 bytes from 376832 bytes)
Configuring upload protocol…
AVAILABLE: espota, esptool
CURRENT: upload_protocol = esptool
Looking for upload port…
Auto-detected: COM3
Uploading .pio\build\esp07\firmware.bin
esptool.py v2.8
Serial port COM3
Connecting…
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: 5c:cf:7f:33:a6:e6
Uploading stub…
Running stub…
Stub running…
Configuring flash size…
Auto-detected Flash size: 1MB
A fatal error occurred: File C:\Users\MrTavakoli.platformio\packages\framework-esp8266-rtos-sdk\bin\esp_init_data_default.bin (length 128) at offset 4177920 will not fit in 1048576 bytes of flash. Use --flash-size argument, or change flashing address.
*** [upload] Error 2
I test my board with Arduino framework successfully.
Thanks you
I use esp01-1M board instead of esp07 board and compile then upload to esp07 board successfully.
again change board to esp07 and add
board_upload.maximum_size = 1048576
to platformio.ini file and compile and upload toesp07` board successfully.
I found 1048576 value from esp01_1m.json file.

Error launching openOCD debugger in Eclipse

I am setting up openOCD and Eclipse on a new operating system, using a Nucleo F030R8 board that debugs fine on another system. When I run the debugger in Eclipse I get "error in final launch sequence":
Error in final launch sequence
Failed to execute MI command:
-target-select remote localhost:3333
Error message from debugger back end:
localhost:3333: No such file or directory.
Failed to execute MI command:
-target-select remote localhost:3333
Error message from debugger back end:
localhost:3333: No such file or directory.
localhost:3333: No such file or directory.
I can run the debugger in terminal with ./openocd -f board/st_nucleo_f0.cfg and get:
*GNU ARM Eclipse 64-bits Open On-Chip Debugger 0.9.0-00073-gdd34716
(2015-05-19-12:55)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : The selected transport took over low-level target control. The results
might differ compared to plain JTAG/SWD
adapter speed: 1000 kHz
adapter_nsrst_delay: 100
none separate
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : clock speed 950 kHz
Info : STLINK v2 JTAG v25 API v2 SWIM v13 VID 0x0483 PID 0x374B
Info : using stlink api v2
Info : Target voltage: 3.257369
Info : stm32f0x.cpu: hardware has 4 breakpoints, 2 watchpoints''*
and the LED LD1 blinks alternatively green and red. Similarly, I can run External Tools in Eclipse just fine, but this doesn't open the debugger. So it seems like I'm close, but something isn't quite right. Let me know if you need any other details of my system.
Using:
Eclipse Mars.2 (4.5.2)
Mac 10.12.1
OpenOCD 0.10.0-201601101000-dev
GNU Tools gcc-arm-none-eabi-5_4-2016q3
Ok so I figured it out with major credit due to http://www.carminenoviello.com. Running this in terminal:
>telnet localhost 3333
localhost: nodename nor servname provided, or not known
showed this wasn't working correctly. checking /etc/hosts, the file was empty. I changed it to:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
And that was that. Can now enter debug mode.

GNU ARM Eclipse: troubles with openocd debug

I'm trying to use Eclipse with GNU ARM plugins to debug my stm32f4-discovery board, however, still no luck. The same board works perfectly in Keil running in the virtual machine, so, it doesn't seem to be hardware problem.
I use Linux Mint 13, I've installed all the prerequisites, I have created templated hello world project, it compiles, and when I try to start debug, it stops at the step "Configuring GDB", and after a couple of seconds it fails with the following:
Error in final launch sequence
Failed to execute MI command:
-target-select remote localhost:3333
Error message from debugger back end:
localhost:3333: Connection timed out.
localhost:3333: Connection timed out.
Then I tried to manually start openocd:
$ openocd -f /usr/local/share/openocd/scripts/board/stm32f4discovery.cfg
Open On-Chip Debugger 0.7.0 (2014-11-08-01:25)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Info : This adapter doesn't support configurable speed
Info : STLINK v2 JTAG v23 API v2 SWIM v0 VID 0x0483 PID 0x3748
Info : Target voltage: 2.918263
Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints
And arm-none-eabi-gdb:
$ arm-none-eabi-gdb ~/projects/test_stm/arm_c_1/Debug/arm_c_1.elf
GNU gdb (GNU Tools for ARM Embedded Processors) 7.6.0.20140731-cvs
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu --target=arm-none-eabi".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/dimon/projects/test_stm/arm_c_1/Debug/arm_c_1.elf...done.
(gdb) target remote localhost:3333
Remote debugging using localhost:3333
0x00000000 in ?? ()
(gdb)
Then, openocd said that connection is accepted:
Info : accepting 'gdb' connection from 3333
Info : stm32f4x errata detected - fixing incorrect MCU_IDCODE
Info : device id = 0x10006413
Info : flash size = 1024kbytes
Warn : acknowledgment received, but no packet pending
undefined debug reason 6 - target needs reset
But, when started by Eclipse, it doesn't work, for some reason.
Well, then I tried to keep openocd started manually and alter my Debug configuration: at the "Debugger" tab, I've unchecked "Start OpenOCD locally". Now, debug session a kind of starts: debug perspective is opened, no meaningful errors are echoed, but debug buttons (resume, suspend, etc) remain inactive. The chip isn't even reprogrammed: previous firmware programmed from inside Keil keeps flashing LEDs.
Here's a screenshot of what Eclipse looks like: http://i.imgur.com/sszA0hr.png
Output of openocd:
$ /usr/local/share/openocd/scripts/board openocd -f ./stm32f4discovery.cfg
Open On-Chip Debugger 0.7.0 (2014-11-08-01:25)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Info : This adapter doesn't support configurable speed
Info : STLINK v2 JTAG v23 API v2 SWIM v0 VID 0x0483 PID 0x3748
Info : Target voltage: 2.919691
Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : accepting 'gdb' connection from 3333
Info : stm32f4x errata detected - fixing incorrect MCU_IDCODE
Info : device id = 0x10006413
Info : flash size = 1024kbytes
Warn : acknowledgment received, but no packet pending
undefined debug reason 6 - target needs reset
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08000154 msp: 0x20030000
semihosting is enabled
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08000154 msp: 0x20030000, semihosting
I even tried to re-install all the Eclipse plugins as well as openocd, nothing helped. What could be the trouble?

“RAM check failed” when using j-Link to erase chip or readback

I closed SWD and JTAG by acident so that I can't download new program into developboard by j-Link.Then I try using j-flash ARM to erase chip, and error comes like this:
Connecting ...
- Connecting via USB to J-Link device 0
- J-Link firmware: V1.20 (J-Link ARM V8 compiled Dec 1 2009 11:42:48)
- JTAG speed: 2000 kHz (Auto)
- Initializing CPU core (Init sequence) ...
- Executing Reset (0, 0 ms)
- Initialized successfully
- JTAG speed: 2000 kHz (Auto)
- Connected successfully
Reading entire flash chip ...
- 64 sectors, 1 range, 0x8000000 - 0x800FFFF
- ERROR: RAM check failed # address 0x20000000.
- ERROR: Write: 0x03020100 07060504
- ERROR: Read: 0xAAAAAAAA AAAAAAAA
- ERROR: (0 bytes of RAM have been checked successfully)
- ERROR: Failed to read back target memory
Disconnecting ...
- Disconnected
I don't know how to use BOOT0 and BOOT1 to get into ISP mode. BOOT0 is connected to GND.
Post some information about your environment.
Are you using IAR EWARM? If you're not, you should download the size-limited trial version. Then, load one of the basic program examples, and try to flash it to your board.
What board are you using? And what do you mean you "closed" SWD and JTAG? I'm not sure what that refers to...jumpers? options window?
Help us out here.