cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeProgrammer - Bug report - External Loaders

JHedges
Associate II

Hello,

Please move this to a more appropriate section if required, or let me know if there is a better way to report bugs.

I have come across a couple of bugs whilst developing an STLDR for external flash access, note the memory arrangement of the flash used is 4096 4K sectors (MX25L12833F 16MB). Bugs:

  • Under 'Erasing & Programming' not all sectors can be listed and individually erased under the 'Erase external memory' tab. When loading this view the following error is shown: External loader sector number is too big, displaying only the first 4000 sectors. The sector list is also corrupt after index 3999 showing invalid adresses and sizes:0693W000000VN9wQAG.png
  • Under 'Erasing & Programming' a 'Full chip erase' only requests 0x1FFFFF to be erased before reporting success, not the full flash size. See log:

12:05:09:859 : MASS ERASE ... 

12:05:09:927 : Flash erase...

12:05:10:003 : halt ap 0 

12:05:10:003 : w ap 0 reg 15 PC (0x20000000) 

12:05:10:004 : w ap 0 reg 17 MSP (0x20000500) 

12:05:10:005 : w ap 0 reg 16 xPSR (0x01000000) 

12:05:10:010 : w ap 0 @0x20002260 0x00000200 bytes

12:05:10:010 : w ap 0 @0x20000000 0x00000004 bytes

12:05:10:060 : w ap 0 @0x20000004 0x00001E30 bytes

12:05:10:061 : Init flashloader...

12:05:10:062 : halt ap 0 

12:05:10:063 : w ap 0 reg 0 R0 0x00000001

12:05:10:063 : w ap 0 reg 1 R1 0x00000000

12:05:10:065 : w ap 0 reg 2 R2 0x00000000

12:05:10:066 : w ap 0 reg 3 R3 0x00000000

12:05:10:066 : w ap 0 reg 4 R4 0x00000000

12:05:10:066 : w ap 0 reg 5 R5 0x00000000

12:05:10:066 : w ap 0 reg 6 R6 0x00000000

12:05:10:066 : w ap 0 reg 7 R7 0x00000000

12:05:10:068 : w ap 0 reg 8 R8 0x00000000

12:05:10:070 : w ap 0 reg 9 R9 0x00000000

12:05:10:073 : w ap 0 reg 10 R10 0x00000000

12:05:10:073 : w ap 0 reg 11 R11 0x00000000

12:05:10:073 : w ap 0 reg 12 R12 0x00000000

12:05:10:074 : w ap 0 reg 13 SP 0x00000000

12:05:10:076 : w ap 0 reg 14 LR 0x20000001

12:05:10:078 : w ap 0 reg 15 PC 0x200001C5

12:05:10:078 : w ap 0 reg 16 xPSR 0x01000000

12:05:10:078 : w ap 0 reg 17 MSP 0x20002230

12:05:10:079 : w ap 0 reg 18 PSP 0x00000000

12:05:10:079 : run ap 0 

12:05:10:080 : halt ap 0 

12:05:10:080 : r ap 0 reg 0 R0 0x00000001

12:05:10:080 : Loader sector erase...

12:05:10:080 : w ap 0 reg 0 R0 0x90000000

12:05:10:081 : w ap 0 reg 1 R1 0x901FFFFF

12:05:10:083 : w ap 0 reg 2 R2 0x00000002

12:05:10:085 : w ap 0 reg 3 R3 0x00000000

12:05:10:085 : w ap 0 reg 4 R4 0x00000000

12:05:10:086 : w ap 0 reg 5 R5 0x00000000

12:05:10:086 : w ap 0 reg 6 R6 0x00000000

12:05:10:086 : w ap 0 reg 7 R7 0x00000000

12:05:10:087 : w ap 0 reg 8 R8 0x00000000

12:05:10:088 : w ap 0 reg 9 R9 0x00000000

12:05:10:089 : w ap 0 reg 10 R10 0x00000000

12:05:10:089 : w ap 0 reg 11 R11 0x00000000

12:05:10:089 : w ap 0 reg 12 R12 0x00000000

12:05:10:089 : w ap 0 reg 13 SP 0x00000000

12:05:10:091 : w ap 0 reg 14 LR 0x20000001

12:05:10:097 : w ap 0 reg 15 PC 0x20000599

12:05:10:098 : w ap 0 reg 16 xPSR 0x01000000

12:05:10:098 : w ap 0 reg 17 MSP 0x20002230

12:05:10:099 : w ap 0 reg 18 PSP 0x00000000

12:05:10:099 : run ap 0 

12:05:20:798 : halt ap 0 

12:05:20:801 : r ap 0 reg 0 R0 0x00000001

12:05:20:801 : Mass erase successfully achieved

Kind regards,

Jack Hedges

6 REPLIES 6

Hi @JHedges​ 

Could you tell me which product ST do you use (name of the Board).

Best regards,

Nesrine

JHedges
Associate II

Hi @Nesrine.JLASSI​ 

The hardware is a custom design not ST, it comprises of a STM32F469NI paired with a single MX25L12833F NOR flash chip on the QSPI bus.

The loader appears to work fine when programming using an elf file through CubeProgrammer and through Rowley CrossStudio IDE as part of a custom RAM loader.

Thanks,

Jack

Hi @JHedges​ 

Tested with an STM32F469NIH6, there is no problem.

I think that the problem is on the user's own board not ST's.

Best regards,

Nesrine

Hi @Nesrine.JLASSI​ ,

You say you have tested with an STM32F469NIH6, did you pair this with external memory which has a sector count greater than 4000?

The issue I am seeing is with the management of exteral memory not the ST MCU flash.

Here is the StorageInfo definition from our custom stldr:

/* This structure containes information used by ST-LINK Utility to program and erase the device */
__attribute__((used)) const tStorageInfo StorageInfo  =  {
   "MX25L12833F_STM32F469NI", 	 					// Device Name + ST MCU
   NOR_FLASH,                   					// Device Type
   0x90000000,                						// Device Start Address
   0x1000000,                 						// Device Size in Bytes (16MBytes)
   0x100,                    						// Programming Page Size 256Bytes
   0xFF,                       						// Initial Content of Erased Memory
// Specify Size and Address of Sectors (view example below)
   0x00001000, 0x00001000,     				 		// Sector Num : 4096 ,Sector Size: 4KBytes
};

Regards,

Jack

Kraal
Senior III

Hi @JHedges​ , @Nesrine.JLASSI​ 

I have the same problem with a Nucleo-L432KC and a Winbond W25Q128JV (size is the same as @JHedges​ ).

The total number of sectors cannot be displayed by CubeProg. However I can't remember if the display gets corrupted afterwards or not.

@JHedges​  regarding your second issue, did you implement the mass erase function in the code ? Because when I ask for a full chip erase, the loader calls mass erase, not sector erase with sectors ranging from 0 to the max number...

Best regards,

Kraal.

Hi @Kraal​,

Thankyou for contributing to this thread!

Regarding the second issue I don't have the mass erase implemented, hence why in the log you can see it calling the sector erase with the parameters 0x90000000 and 0x901FFFFF. I believe the parameters should be 0x90000000 and 0x91000000 to erase the full flash using the sector erase API. If I remember correctly the mass erase is optional and if not implemented the sector erase should be able to perform the same.

Regards,

Jack