cancel
Showing results for 
Search instead for 
Did you mean: 

maximum ymodem transfer file size for IAP?

Teguh Sobirin
Associate
Posted on December 09, 2017 at 18:32

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 #usart
3 REPLIES 3
Posted on December 09, 2017 at 18:55

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on December 09, 2017 at 22:56

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.

0690X00000604ElQAI.jpg

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);

}

Posted on December 10, 2017 at 15:57

Review memory content at address before/after write to understand the failure. You get one attempt to write each word.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..