STM32G474RE internal bootloader - cannot read Unique Device ID, Flash size and package reigsters with Read Memory command
Hi everybody,
in my current project I use G474RE MCU and I wanted to use internal bootloader with the same tools which I've used with some previous projects and F401 MCU.
I jump to internal bootloader with following code (ported from some official reference example):
#define dSystemMemoryAddress 0x1FFF0000UL
#define dSystemMemoryResetVector 0x1FFF0004UL
void jump(void)
{
LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_SYSCFG);
/* set stack pointer to the bootloader start address */
__set_MSP(*((uint32_t*)(dSystemMemoryAddress)));
/* system memory mapped at 0x00000000 */
__HAL_SYSCFG_REMAPMEMORY_SYSTEMFLASH();
/* jump to @bootloader + 4 */
((void (*)(void))(*((uint32_t*)(dSystemMemoryResetVector))))();
}Then I wanted to use exe app "Flash loader demo" but it's doesn't support G4 family yet. By the way version on the site is 0.2.8 from 2015 which is kinda outdated ;)
I've checked AN3155 (Bootloader USART protocol) and I tested some commands.
"Get" command is fine, "Get Version" returns bootloader version 0x31 (is it ok? Shouldn't it be 0xD5?), "Get ID" returns correct chip ID 0x469.
Finally we come where I have my issue. Read memory command works fine, I can read user flash memory and so on, but read memory works till address 0x1FFF 73FF. After that I always get NACK response.
I need to read areas described in RM as "Device electronic signature" which is UID (0x1FFF7590), flash size (0x1FFF75E0), and package (0x1FFF7500).
How can I get it through internal bootloader? Should I unblock something in option bytes before jumping to bootloader? It worked fine with previous MCUs. Also there is no problem to read this data within running code.
