Info on my elf file:
program headers `readelf -l fw.elf`:
```
Elf file type is EXEC (Executable file)
Entry point 0x8020239
There are 6 program headers, starting at offset 52
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
LOAD 0x010000 0x08000000 0x08000000 0x020c4 0x020c4 R 0x10000
LOAD 0x020000 0x08020000 0x08020000 0x28ad0 0x28ad0 RWE 0x10000
LOAD 0x055538 0x20025538 0x08048ad0 0x00e80 0x00e80 RW 0x10000
LOAD 0x059950 0x08049950 0x08049950 0x00068 0x00068 R 0x10000
LOAD 0x060000 0x20020000 0x20020000 0x00000 0x05538 RW 0x10000
NOTE 0x059990 0x08049990 0x08049990 0x00024 0x00024 R 0x4
Section to Segment mapping:
Segment Sections...
00 .bootldr
01 .vector_table .text .ARM .init_array .fini_array .rodata
02 .data
03 .build_info .note.gnu.build-id .build_info_suffix
04 .bss
05 .note.gnu.build-id
```
`openocd -f board/st_nucleo_f7.cfg -c 'test_image fw.elf 0 elf'`:
```
address 0x08000000 length 0x000020c4
address 0x08020000 length 0x00028ad0
address 0x08048ad0 length 0x00000e80
address 0x08049950 length 0x00000068
verified 178812 bytes in 0.000513s (340392.000 KiB/s)
```
I've done some further testing with the following 2 commands:
A. `a.cfg`: write random 1MB to bank 1, random 1MB to bank2 (`openocd -f
board/st_nucleo_f7.cfg -f a.cfg -c exit`)
B. `b.cfg`: write fw.elf to bank 1, random 1MB to bank 2 (`openocd -f
board/st_nucleo_f7.cfg -f b.cfg -c exit`)
Here's a sequence of executions with `OK`, `ERROR 1`, and `ERROR 2` indicating
the operation which failed (flashing bank 1 or 2)
```
# plug in nucleo-f767zi's stlink to computer
A OK
A OK
B ERROR 2
B ERROR 1
B ERROR 2
B ERROR 1
B ERROR 2
B ERROR 1
A OK
B ERROR 2
A ERROR 1
A OK
B ERROR 2
A ERROR 1
B ERROR 2
A ERROR 1
A OK
A OK
```
So:
- The programming the elf file triggers this issue
- Programming that elf file _appears_ to break the following 2 programming
attempts (at least in the `bank1, bank2, bank1, bank2, ...` programming
sequence I tested here.
Attachments:
-
[a.cfg](https://sourceforge.net/p/openocd/tickets/_discuss/thread/d27603e0/0976/attachment/a.cfg)
(244 Bytes; application/octet-stream)
---
** [tickets:#203] programming st_nucleo_f7 (stm32f767) bank 2 consistently
fails**
**Status:** new
**Milestone:** 0.9.0
**Created:** Mon Aug 20, 2018 09:55 PM UTC by Cody Schafer
**Last Updated:** Wed Aug 22, 2018 03:07 PM UTC
**Owner:** nobody
In the `stm32f767zi` (on the nucleo-f767zi board), there is 2MiB of flash. When
it is configured into dual bank mode (`stm32f2x options_write 0 0xDFC 0x0080
0x0040`, presuming all other options are left at their defaults), using the
`program` command to program the second bank (`bank1_start=0x0810_0000`,
`bank2_start=0x0800_0000`) with the command `flash write_image fw.elf erase
0x100000`, the execution consistently fails with the following output:
`openocd -f board/st_nucleo_f7.cfg`
```
> flash write_image fw.elf 0x100000
Flash write discontinued at 0x081020c4, next section at 0x08120000
timed out while waiting for target halted
target halted due to debug-request, current mode: Handler HardFault
xPSR: 0x00000003 pc: 00000000 msp: 0xffffffe0
error waiting for target flash write algorithm
error writing to flash at address 0x08000000 at offset 0x00100000
```
This is using the embedded `ST-LINK` included on the nucleo. The st-link
firmware version is `V2J31M21`.
`fw.elf` has sections starting in bank1 of flash, which is why the offset is
only the difference between bank1 and bank2.
The banks refered to here are banks in the stm32f7x sense, and are _not_
openocd flash banks.
---
Sent from sourceforge.net because openocd-devel@lists.sourceforge.net is
subscribed to https://sourceforge.net/p/openocd/tickets/
To unsubscribe from further messages, a project admin can change settings at
https://sourceforge.net/p/openocd/admin/tickets/options. Or, if this is a
mailing list, you can unsubscribe from the mailing list.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel