How can I solve the error "Failed to parse flash type or unrecognized flash type" on STM32 board? - stm32

I tried to run the benchmarking code at here
When I try to flash the binary like st-flash write benchmark-kindi256342.bin 0x8000000, an error occurs as following.
st-flash 1.7.0-233-gc7bcb52
Failed to parse flash type or unrecognized flash type
2023-01-06T14:53:14 INFO common.c: STM32F4x5_F4x7: 192 KiB SRAM, 8193 KiB flash in at least 16 KiB pages.
file benchmark-kindi256342.bin md5 checksum: 3fa07ff1b92e1f518836528be256b098, stlink checksum: 0x00be4029
2023-01-06T14:53:14 INFO common_flash.c: Attempting to write 98588 (0x1811c) bytes to stm32 address: 134217728 (0x8000000)
EraseFlash - Sector:0x0 Size:0x4000 -> Flash page at 0x8000000 erased (size: 0x4000)
EraseFlash - Sector:0x1 Size:0x4000 -> Flash page at 0x8004000 erased (size: 0x4000)
EraseFlash - Sector:0x2 Size:0x4000 -> Flash page at 0x8008000 erased (size: 0x4000)
EraseFlash - Sector:0x3 Size:0x4000 -> Flash page at 0x800c000 erased (size: 0x4000)
EraseFlash - Sector:0x4 Size:0x10000 -> Flash page at 0x8010000 erased (size: 0x10000)
2023-01-06T14:53:17 INFO flashloader.c: Starting Flash write for F2/F4/F7/L4
2023-01-06T14:53:17 INFO flash_loader.c: Successfully loaded flash loader in sram
2023-01-06T14:53:17 INFO flash_loader.c: Clear DFSR
2023-01-06T14:53:17 INFO flash_loader.c: Clear CFSR
2023-01-06T14:53:17 INFO flash_loader.c: Clear HFSR
2023-01-06T14:53:17 INFO flashloader.c: enabling 32-bit flash writes
2023-01-06T14:53:19 INFO common_flash.c: Starting verification of write complete
2023-01-06T14:53:19 ERROR common_flash.c: Verification of flash failed at offset: 0
stlink_fwrite_flash() == -1
The first error is Failed to parse flash type or unrecognized flash type and the second is ERROR common_flash.c: Verification of flash failed at offset: 0.
How can I solve this error?
I use STM32F407G board and linux using VMWare.
I tried
st-flash --connect-under-reset --reset write build/h7a3zi_test.bin 0x08000000,
but it doesn't work.
Also I tried re-plug all the cables and it doesn't work too.

Related

ESP32-CAM - A fatal error occurred: Packet content transfer stopped (received 8 bytes)

I was trying to program my ESP32_CAM module, but every time I got this error:
Serial port COM4
Connecting.................................
Chip is ESP32-D0WD-V3 (revision 3)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 30:c6:f7:51:82:d4
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Flash will be erased from 0x00001000 to 0x00005fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x0016efff...
Compressed 18528 bytes to 12759...
A fatal error occurred: Packet content transfer stopped (received 8 bytes)
A fatal error occurred: Packet content transfer stopped (received 8 bytes)
Has anyone had a similar problem?
This link says it means there is something wrong with the esp file system rendering it "broken"... Not sure if there is a way to fix the issue though.
EDIT:
I found that if I disconnected some of my peripherals from esp32, the error went away. Perhaps too much power was being drawn.

ESP32 JTAG Programming fails at Verification

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

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.

Anyone booted ecos with u-boot?

I need to port ecos on new platform board with u-boot.
Everywhere I am able to find Porting guide for ecos with redboot.
Did anyone booted ecos with u-boot?
I got some link which tells it's possible to boot ecos with u-boot?
https://sourceware.org/ml/ecos-discuss/2010-06/msg00038.html
But I am not able to find any document regarding that.
I tried following following procedure to boot ecos with u-boot
compiled ecos 3.0
ecosconfig new
ecosconfig tree
make
cross compiled and generated sample hello_world elf linking library
generated in previous make.
Powered on the board and stopped at u-boot(prebuilt u-boot already in
flash)
Transferred hello_world to a load_addr(entry point address of RAM) through tftp
bootelf load_addr
But it got hanged as follows,
bootelf 0x820000bc
Loading .rom_vectors # 0x82000000 (204 bytes)
Loading .text # 0x820000cc (224132 bytes)
EDIT :
When I try loading at address 0x81000000 It proceed further as follows,
bootelf 0x81000000
Loading .rom_vectors # 0x82000000 (204 bytes)
Loading .text # 0x820000cc (207960 bytes)
Loading .rodata # 0x82032d28 (7296 bytes)
Loading .data # 0x820349a8 (2544 bytes)
Loading .ctors # 0x82035398 (80 bytes)
Loading .dtors # 0x820353e8 (56 bytes)
Loading .devtab # 0x82035420 (608 bytes)
Clearing .sbss # 0x82035680 (276 bytes)
Clearing .bss # 0x82035798 (313052 bytes)
## Starting application at 0x820000bc ...
But hangs after the above line. My ELF file size is around 1.9 MB. Will it make a problem?
Note: RAM size - 8 MB (0x80000000 - 0x88000000)
It shouldn't be hard. If you have an ELF file, bootelf will boot it.

“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.