cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeProgrammer cannot verify after programming with an external loader that has Read()

NNish
Associate

Hi,

I've developed an external loader for an external SPI flash.

My external loader has a Read() function.

In STM32 Cube Programmer version 1.4.0, I found that initializing of

the loader and reading of data are eternally repeated when verification

after programming. The log (verbosity level = 2) is as follows:

16:59:01:640 : Memory Programming ...

16:59:01:640 : Opening and parsing file: flash.axf

16:59:01:661 : File : flash.axf

16:59:01:661 : Size : 1016700 Bytes

16:59:01:661 : Address : 0x90000000

16:59:01:661 : Erasing memory corresponding to segment 0:

16:59:01:661 : Memory erase...

16:59:01:740 : Erasing external memory sectors [0 15]

16:59:01:740 : Init flashloader...

16:59:01:794 : Loader sector erase...

16:59:06:050 : Download in Progress:

16:59:06:050 : Size : 1016700 Bytes

16:59:06:050 : Address : 0x90000000

16:59:06:050 : Buffer program...

16:59:06:126 : Loader write range...

16:59:07:018 : Init flashloader...

16:59:13:878 : Segment[0] downloaded successfully

16:59:13:878 : File download complete

16:59:13:900 : Time elapsed during download operation: 00:00:12.217

16:59:13:901 : Verifying ...

16:59:13:903 : Read progress:

16:59:13:903 : Reading data...

16:59:13:955 : Loader read...

16:59:13:955 : Init flashloader...

16:59:14:026 : Reading data...

16:59:14:104 : Loader read...

16:59:14:104 : Init flashloader...

16:59:14:179 : Reading data...

16:59:14:260 : Loader read...

16:59:14:260 : Init flashloader...

16:59:14:336 : Reading data...

16:59:14:414 : Loader read...

16:59:14:415 : Init flashloader...

16:59:14:486 : Reading data...

16:59:14:564 : Loader read...

16:59:14:564 : Init flashloader...

16:59:14:637 : Reading data...

16:59:14:713 : Loader read...

16:59:14:713 : Init flashloader...

16:59:14:784 : Reading data...

...

When verbosity = 3, the log reports:

...

17:03:58:246 : Segment[0] downloaded successfully

17:03:58:246 : File download complete

17:03:58:267 : Time elapsed during download operation: 00:00:12.132

17:03:58:267 : Verifying ...

17:03:58:270 : Read progress:

17:03:58:270 : Reading data...

17:03:58:270 : reset ap 0

17:03:58:270 : run ap 0

17:03:58:270 : halt ap 0

17:03:58:270 : w ap 0 reg 15 (0x20000000)

17:03:58:270 : w ap 0 reg 17 (0x20000500)

17:03:58:270 : w ap 0 reg 16 (0x01000000)

17:03:58:270 : w ap 0 @0x20002BE0 0x00000200 bytes

17:03:58:270 : w ap 0 @0x20000000 0x00000004 bytes

17:03:58:270 : w ap 0 @0x20000004 0x000027A4 bytes

17:03:58:270 : Loader read...

17:03:58:270 : Init flashloader...

17:03:58:270 : halt ap 0

17:03:58:271 : w ap 0 reg 0 0x00000000

17:03:58:271 : w ap 0 reg 1 0x00000000

17:03:58:271 : w ap 0 reg 2 0x00000000

17:03:58:271 : w ap 0 reg 3 0x00000000

17:03:58:271 : w ap 0 reg 4 0x00000000

17:03:58:271 : w ap 0 reg 5 0x00000000

17:03:58:271 : w ap 0 reg 6 0x00000000

17:03:58:271 : w ap 0 reg 7 0x00000000

17:03:58:271 : w ap 0 reg 8 0x00000000

17:03:58:271 : w ap 0 reg 9 0x00000000

17:03:58:271 : w ap 0 reg 10 0x00000000

17:03:58:271 : w ap 0 reg 11 0x00000000

17:03:58:271 : w ap 0 reg 12 0x00000000

17:03:58:271 : w ap 0 reg 13 0x00000000

17:03:58:271 : w ap 0 reg 14 0x20000001

17:03:58:271 : w ap 0 reg 15 0x20000005

17:03:58:271 : w ap 0 reg 16 0x01000000

17:03:58:271 : w ap 0 reg 17 0x20002BA4

17:03:58:271 : w ap 0 reg 18 0x00000000

17:03:58:271 : run ap 0

17:03:58:558 : halt ap 0

17:03:58:558 : r ap 0 reg 0 0x00000001

17:03:58:558 : w ap 0 reg 0 0x90000000

17:03:58:558 : w ap 0 reg 1 0x00000400

17:03:58:558 : w ap 0 reg 2 0x20002BE0

17:03:58:558 : w ap 0 reg 3 0x00000000

17:03:58:558 : w ap 0 reg 4 0x00000000

17:03:58:558 : w ap 0 reg 5 0x00000000

17:03:58:558 : w ap 0 reg 6 0x00000000

17:03:58:558 : w ap 0 reg 7 0x00000000

17:03:58:558 : w ap 0 reg 8 0x00000000

17:03:58:558 : w ap 0 reg 9 0x00000000

17:03:58:558 : w ap 0 reg 10 0x00000000

17:03:58:558 : w ap 0 reg 11 0x00000000

17:03:58:559 : w ap 0 reg 12 0x00000000

17:03:58:559 : w ap 0 reg 13 0x00000000

17:03:58:559 : w ap 0 reg 14 0x20000001

17:03:58:559 : w ap 0 reg 15 0x2000193D

17:03:58:559 : w ap 0 reg 16 0x01000000

17:03:58:559 : w ap 0 reg 17 0x20002BA4

17:03:58:559 : w ap 0 reg 18 0x00000000

17:03:58:559 : run ap 0

17:03:58:559 : halt ap 0

17:03:58:570 : r ap 0 reg 0 0x00000001

17:03:58:960 : r ap 0 @0x20002BE0 0x00000400 bytes

17:03:58:960 : Reading data...

17:03:58:961 : reset ap 0

17:03:58:961 : run ap 0

17:03:58:961 : halt ap 0

17:03:58:961 : w ap 0 reg 15 (0x20000000)

17:03:58:961 : w ap 0 reg 17 (0x20000500)

17:03:58:961 : w ap 0 reg 16 (0x01000000)

17:03:58:961 : w ap 0 @0x20002BE0 0x00000200 bytes

17:03:58:961 : w ap 0 @0x20000000 0x00000004 bytes

17:03:58:961 : w ap 0 @0x20000004 0x000027A4 bytes

17:03:58:961 : Loader read...

17:03:58:961 : Init flashloader...

17:03:58:961 : halt ap 0

17:03:58:961 : w ap 0 reg 0 0x00000000

17:03:58:961 : w ap 0 reg 1 0x00000000

17:03:58:961 : w ap 0 reg 2 0x00000000

17:03:58:961 : w ap 0 reg 3 0x00000000

17:03:58:961 : w ap 0 reg 4 0x00000000

17:03:58:961 : w ap 0 reg 5 0x00000000

17:03:58:961 : w ap 0 reg 6 0x00000000

17:03:58:961 : w ap 0 reg 7 0x00000000

17:03:58:961 : w ap 0 reg 8 0x00000000

17:03:58:961 : w ap 0 reg 9 0x00000000

17:03:58:961 : w ap 0 reg 10 0x00000000

17:03:58:961 : w ap 0 reg 11 0x00000000

17:03:58:961 : w ap 0 reg 12 0x00000000

17:03:58:962 : w ap 0 reg 13 0x00000000

17:03:58:962 : w ap 0 reg 14 0x20000001

17:03:58:962 : w ap 0 reg 15 0x20000005

17:03:58:962 : w ap 0 reg 16 0x01000000

17:03:58:962 : w ap 0 reg 17 0x20002BA4

17:03:58:962 : w ap 0 reg 18 0x00000000

17:03:58:962 : run ap 0

17:03:58:962 : halt ap 0

17:03:58:962 : r ap 0 reg 0 0x00000001

17:03:58:962 : w ap 0 reg 0 0x90000000

17:03:58:962 : w ap 0 reg 1 0x00000400

17:03:58:962 : w ap 0 reg 2 0x20002BE0

17:03:58:962 : w ap 0 reg 3 0x00000000

17:03:58:962 : w ap 0 reg 4 0x00000000

17:03:58:962 : w ap 0 reg 5 0x00000000

17:03:58:962 : w ap 0 reg 6 0x00000000

17:03:58:962 : w ap 0 reg 7 0x00000000

17:03:58:962 : w ap 0 reg 8 0x00000000

17:03:58:962 : w ap 0 reg 9 0x00000000

17:03:58:962 : w ap 0 reg 10 0x00000000

17:03:58:962 : w ap 0 reg 11 0x00000000

17:03:58:962 : w ap 0 reg 12 0x00000000

17:03:58:962 : w ap 0 reg 13 0x00000000

17:03:58:962 : w ap 0 reg 14 0x20000001

17:03:58:962 : w ap 0 reg 15 0x2000193D

17:03:58:962 : w ap 0 reg 16 0x01000000

17:03:58:962 : w ap 0 reg 17 0x20002BA4

17:03:58:963 : w ap 0 reg 18 0x00000000

17:03:58:963 : run ap 0

17:03:58:963 : halt ap 0

17:03:58:963 : r ap 0 reg 0 0x00000001

17:03:58:963 : r ap 0 @0x20002BE0 0x00000400 bytes

17:03:58:963 : Reading data...

17:03:58:963 : reset ap 0

17:03:58:963 : run ap 0

17:03:58:963 : halt ap 0

17:03:58:963 : w ap 0 reg 15 (0x20000000)

...

where 0x20000005 and 0x2000193D are the addresses of the Init and Read

functions, respectively (I’ve checked the map file of my loader).

It seems that the loader was re-initialized although Read() successfully

returned 1.

I have no problem in ST-Link utility with the same executable of the

loader. In "Memory & File edition" of the STM32 Cube Programmer, I also

have no problem at reading data from the external flash.

I noticed that programming with verification successfully finishes when

the total size of the programing is several tens of bytes.

Thanks,

Nobuyuki

1 REPLY 1
inojosh
Associate II

I would like to chime in to say I have also run into this exact same problem.

Verify did work in STM32CubeProgrammer version 1.0.0 with the exact same external flash loader (.stldr).

So something changed after 1.0.0 which causes verify to no longer work. It would be nice if this was fixed, it isn't possible to program+verify with the command line because of this.