2017-12-09 09:32 AM
Hi All,
I make custom bootloader based on X-CUBE-IAP-USART example, all works fine except I can't transfer a firmware .bin file using ymodem if the .bin file is above 256KB.
I use STM32F429XX that have 2MB Flash, and my firmware that want to be flashed is above 1MB.
Are anyone was got success to transfer a firmware above 256Kb using using official ST example? or that is the max file size for ymodem can accept?
Regards,
TJ.
#ymodem #iap #usart2017-12-09 09:55 AM
How does it fail? Can you debug that?
Y-MODEM doesn't inherently have a limit, support in the FLASH code for additional 128KB blocks, or blocks at the 1MB boundary might require special attention.
You have all the code, browse what it is doing a little, and instrument via SWV channel to get feedback on what is happening internally.
2017-12-09 02:56 PM
Hi,
Updating the information, now I'm porting from STM324x9I_EVAL in STM32Cube_FW_F4_V1.18.0 release.
And using hyperterminal for sending the app.bin and now the transfer process is stack and aborted in 1024KB.
Debugging in, the transfer fail in matching process :
uint32_t FLASH_If_Write(uint32_t FlashAddress, uint32_t* Data ,uint32_t DataLength)
{
uint32_t i = 0;
for (i = 0; (i < DataLength) && (FlashAddress <= (USER_FLASH_END_ADDRESS-4)); i++)
{
/* Device voltage range supposed to be [2.7V to 3.6V], the operation will
be done by word */
if (HAL_FLASH_Program(TYPEPROGRAM_WORD, FlashAddress, *(uint32_t*)(Data+i)) == HAL_OK)
{
/* Check the written value */
if (*(uint32_t*)FlashAddress != *(uint32_t*)(Data+i))
{
/* Flash content doesn't match SRAM content */
return(FLASHIF_WRITINGCTRL_ERROR); <-- It's return error for 1024KB transfer.
}
/* Increment FLASH destination address */
FlashAddress += 4;
}
else
{
/* Error occurred while writing data in Flash memory */
return (FLASHIF_WRITING_ERROR);
}
}
return (FLASHIF_OK);
}
2017-12-10 07:57 AM
Review memory content at address before/after write to understand the failure. You get one attempt to write each word.