Is there actually any working solution to flash external SDRam in USB Mode?
Hello,
after reading a lot i am still confused.
I am looking for a solution to flash the internal and the external memory of an STM32F4 (for testing i am using the F469 Discovery Board).
There is no problem using the ST-Link on-board, but what about a solution for a mass-production board where no ST-Link is assembled and maybe the end-user needs to do an update?
Well, i am using this code to enter the bootloader for USB:
void goToBootloader(void)
{
HAL_RCC_DeInit();
SysTick->CTRL = SysTick->LOAD = SysTick->VAL = 0;
__HAL_SYSCFG_REMAPMEMORY_SYSTEMFLASH();
const uint32_t p = (*((uint32_t *) 0x1FFF0000));
__set_MSP( p );
void (*SysMemBootJump)(void);
SysMemBootJump = (void (*)(void)) (*((uint32_t *) 0x1FFF0004));
SysMemBootJump();
while( 1 ) {}
}So far so good, i can connect to the device with the CubeProgrammer.
And it seems that i can flash the internal memory but then failed at 0x9000000
11:57:01 : USB speed : Full Speed (12MBit/s)
11:57:01 : Manuf. ID : STMicroelectronics
11:57:01 : Product ID : STM32 BOOTLOADER
11:57:01 : SN : 336E335E3538
11:57:01 : DFU protocol: 1.1
11:57:01 : Board : --
11:57:01 : Device ID : 0x0434
11:57:01 : UPLOADING OPTION BYTES DATA ...
11:57:01 : Bank : 0x00
11:57:01 : Address : 0x1fffc000
11:57:01 : Size : 16 Bytes
11:57:01 : Bank : 0x01
11:57:01 : Address : 0x1ffec008
11:57:01 : Size : 4 Bytes
11:57:01 : UPLOADING ...
11:57:01 : Size : 2097152 Bytes
11:57:01 : Address : 0x8000000
11:57:01 : Read progress:
11:57:04 : Data read successfully
11:57:04 : Time elapsed during the read operation is: 00:00:03.465
11:57:16 : Memory Programming ...
11:57:16 : Opening and parsing file: STM32F469I-DISCO.hex
11:57:16 : File : STM32F469I-DISCO.hex
11:57:16 : Size : 9.63 MB
11:57:16 : Address : 0x08000000
11:57:16 : Erasing memory corresponding to segment 0:
11:57:16 : Erasing internal memory sectors [0 6]
11:57:16 : erasing sector 0000 @: 0x08000000 done
11:57:16 : erasing sector 0001 @: 0x08004000 done
11:57:17 : erasing sector 0002 @: 0x08008000 done
11:57:17 : erasing sector 0003 @: 0x0800c000 done
11:57:18 : erasing sector 0004 @: 0x08010000 done
11:57:20 : erasing sector 0005 @: 0x08020000 done
11:57:22 : erasing sector 0006 @: 0x08040000 done
11:57:22 : Erasing memory corresponding to segment 1:
11:57:22 : Not flash Memory : No erase done
11:57:22 : Download in Progress:
11:57:29 : Error: failed to download Segment[1]
11:57:29 : Error: failed to download the File
11:57:29 : RUNNING Program ...
11:57:29 : Address: : 0x08000000
11:57:29 : Start operation achieved successfully
11:57:29 : Warning: Connection to device 0x434 is lost
11:57:29 : Disconnected from device.I checked the External Loader for the 469-Disco Board.
A bit more detailed Log:
11:59:36:170 : downloading data
11:59:36:204 : Segment[0] downloaded successfully
11:59:36:204 : Size : 9784556 Bytes
11:59:36:204 : Address : 0x90000000
11:59:36:205 : setting the address pointer to address: 0x90000000
11:59:36:732 : received memory address is wrong or unsupported
11:59:36:732 : Error: failed to download Segment[1]
11:59:36:733 : Error: failed to download the File
11:59:36:752 : RUNNING Program ...
11:59:36:752 : Address: : 0x08000000
11:59:36:752 : sending a clear status request
11:59:36:753 : setting the address pointer to address: 0x08000000
11:59:36:753 : sending a dfu end of download request
11:59:36:753 : Start operation achieved successfully
11:59:36:784 : Warning: Connection to device 0x434 is lost
11:59:37:032 : Disconnected from device.I hope someone can help me.
Thanks.
