Hi,
So far I was able to get the demo project to run DISCO-F746NG board. The bootloader can start primary application image without problem, but when I tried to initiate firmware upgrade by calling the following function:
ret = boot_set_pending(false);
if(ret == 0) {
printf("%d: press system reset button to reboot and upgrade firmware\r\n", time(nullptr));
} else {
printf("%d: failed to notify bootloader, something went wrong, code = %d\r\n", time(nullptr), ret);
}
I got the following errors:
e[2Ke[90m[DBG ][MCUb]: flash area 1 open count: 1 (+)e[0m
e[2Ke[90m[DBG ][MCUb]: initializing flash area 1...e[0m
e[2Ke[90m[DBG ][MCUb]: flash area 1 open count: 0 (-)e[0m
e[2Ke[90m[DBG ][MCUb]: deinitializing flash area block device 1...e[0m
48554: failed to notify bootloader, something went wrong, code = 3
This seems to indicate something went wrong when bootloader tried write something into the secondary block device. I used the external QSPI Flash either as a whole or a slice like this :
mbed::BlockDevice* get_secondary_bd(void)
{
static QSPIFBlockDevice bd(QSPI_FLASH1_IO0, QSPI_FLASH1_IO1, QSPI_FLASH1_IO2, QSPI_FLASH1_IO3, QSPI_FLASH1_SCK, QSPI_FLASH1_CSN, QSPIF_POLARITY_MODE_0, MBED_CONF_QSPIF_QSPI_FREQ);
//static mbed::SlicingBlockDevice sliced_bd(&bd, 0x0, MCUBOOT_SLOT_SIZE);
return &bd;
}
The primary application can write into/read from the QSPI flash through, but somehow bootloader part of code seems having trouble with secondary_bd.
Did I do something wrong here? Please advise.
Thanks,
ZL