infineon4engineers Facebook

infineon@google+ Google+

infineon@linkedin linkedin

infineon4engi@twitter twitter

infineon@youtube youtube

+ Reply to Thread
Results 1 to 6 of 6

Thread: firmware update FoE XMC4800

  1. #1
    Beginner Beginner Janet is on a distinguished road
    Join Date
    Feb 2019
    Posts
    22
    Points
    270

    firmware update FoE XMC4800

    Hi!
    I'm working with an XMC4800 144x2028 and I need to enable the FoE for firmware update.
    I'm trying the example code ETHCAT_FWUPDATE_SSC_APPLICATION_XMC48 found at https://www.infineon.com/cms/en/prod...downloads.html (adapted to my application), but it doesn't work.
    I'm using TRACE32 Lauterbach to debug and to flash the code into the chip: I flash the ETHCAT_FWUPDATE_BOOTLOADER_XMC48 and then I run it, but the system goes in "running(sleep)" and it can't be stopped, so i'm not able to go further.
    Is there another way to implement FoE? or is there a proper way to make the ETHCAT_FWUPDATE_SSC_APPLICATION_XMC48 code work with Lauterbach? I can't use the Segger jtag.

    Thank you for any help

  2. #2
    Intermediate Intermediate
    Infineon Employee
    Infineon Employee
    MichaelIFX is on a distinguished road
    Join Date
    Mar 2016
    Posts
    48
    Points
    484.53125
    The problem you describe is not related to TRACE/Lauterbach.
    I understand you have only downloaded the bootloader, correct?

    So bootloader is starting the application image inside flash where nothing is programmed into. As a consequence the CPU hangs there.

    To solve this issue, just also download the application image using Lauterbach.
    Before downloading the images (bootloader/application) it is always good to start from a defined basis which is an erased flash.
    You can use Segger J-Flash Lite for this purpose.


    Kind Regards

    Michael
    The views expressed here are my personal opinions, have not been reviewed or authorized by Infineon and do not necessarily represent the views of Infineon.

  3. #3
    Beginner Beginner Janet is on a distinguished road
    Join Date
    Feb 2019
    Posts
    22
    Points
    270
    Hi Michael,
    I've tried to do what you said, but when i download the application i get "FLASH programming error around address SD:0xC020000".
    I can't use Segger, because my debbuger pinout is only for the Lauterbach, not compatible with Segger Debugger.

  4. #4
    Intermediate Intermediate
    Infineon Employee
    Infineon Employee
    MichaelIFX is on a distinguished road
    Join Date
    Mar 2016
    Posts
    48
    Points
    484.53125
    Hi Janet,
    Of course writing to 0xC020000 does not work, because there is no flash inside XMC48 at this address.
    Typically the application image inside FoE-example must be loaded to 0xC0020000

    Maybe you have a typo inside the linker file when you have set the address.

    Kind Regards

    Michael
    Last edited by MichaelIFX; Jul 9th, 2019 at 03:44 AM.
    The views expressed here are my personal opinions, have not been reviewed or authorized by Infineon and do not necessarily represent the views of Infineon.

  5. #5
    Beginner Beginner Janet is on a distinguished road
    Join Date
    Feb 2019
    Posts
    22
    Points
    270
    Hi!
    I've been able to download a .bin file with FoE from the master, but now i don't know how to retrive the file from where it is sotred and i don't know how to write it in the correct flash partition as to make it the new CPU firmware.
    ETHCAT_FWUPDATE_SSC_APPLICATION_XMC48 doesn't work for me, so i adapted it to my application. In the process_app() i write

    Code:
    if(nAlStatus == STATE_INIT) 
    	{
    
    			/************************** check if there is a new firmware inside the backup flash partition ***********/
    			if(FWUPDATE_GetDownloadFinished() == 1) /* the INIT state is entered after the BOOT state → fw update finished*/
    			{
    				firmware_size_bytes = (START_ADDRESS_BACKUP_PARTITION + INFO_OFFSET / 4)[63];
    
    				  /* check metainfo if firmware for update is available inside backup partition */
    				  if ( (firmware_size_bytes > 0) && (firmware_size_bytes < APP_PARTITION_MAX_SIZE) )
    				  {
    
    				      /* program new firmware into application partition */
    				      FLASHPROG_Init(START_ADDRESS_APPL_PARTITION, APP_PARTITION_MAX_SIZE, FLASH_OPT_ERASE, FLASH_OPT_CHECK);
    				      FLASHPROG_Data(START_ADDRESS_BACKUP_PARTITION, firmware_size_bytes);
    				      FLASHPROG_Close();
    
    				      /* delete EEPROM content (2nd 64k sector) */
    				      FLASHPROG_Delete_physical_sector(XMC_FLASH_PHY_SECTOR_4);
    
    				        /* Restart to retry programming */
    				        BL_Normal_Restart();
    				      /* OK - new firmware was successfully programmed into application partition */
    
    				  }
    
    				  /* software from backup partition was just successfully programmed
    				   * into application partition.
    				   * In any case, make sure backup partition is erased before restarting firmware inside
    				   * application partition.
    				   */
    				  ptr_backupdata = START_ADDRESS_BACKUP_PARTITION;
    				  while(ptr_backupdata<START_ADDRESS_BACKUP_PARTITION + BACKUP_PARTITION_MAX_SIZE / 4)
    				  {
    				    /* is erase needed? */
    				    if (*ptr_backupdata!=0)
    				    {
    				      /* erase backup partition */
    				      FLASHPROG_Delete_physical_sectors(ptr_backupdata, 1);
    				    }
    				    ptr_backupdata++;
    				  }
    
    				  /* Restart inside application partition */
    				  BL_Normal_Restart();
    
    			}
    }

    the function BL_Normal_Restart and BL_Normal_Restart

    Code:
    void BL_Normal_Restart(void)
    {
    	/* Restart in alternative bootmode 0 */
    	/* Clear the reset cause field for proper reset detection of the ssw */
    	XMC_SCU_RESET_ClearDeviceResetReason();
    	/* Set ABM0 as boot mode in SWCON field of STCON register */
    	XMC_SCU_SetBootMode(XMC_SCU_BOOTMODE_NORMAL);
    	/* Trigger power on reset */
    	PPB->AIRCR = (1 << PPB_AIRCR_SYSRESETREQ_Pos) | (0x5FA << PPB_AIRCR_VECTKEY_Pos) | (0x1 << PPB_AIRCR_PRIGROUP_Pos);
    }
    
    void BL_FlashABM0_Restart(void)
    {
    	/* Restart in alternative bootmode 0 */
    	/* Clear the reset cause field for proper reset detection of the ssw */
    	XMC_SCU_RESET_ClearDeviceResetReason();
    	/* Set ABM0 as boot mode in SWCON field of STCON register */
    	XMC_SCU_SetBootMode(XMC_SCU_BOOTMODE_ABM0);
    	/* Trigger power on reset */
    	PPB->AIRCR = 1 << PPB_AIRCR_SYSRESETREQ_Pos
    			|0x5FA<<PPB_AIRCR_VECTKEY_Pos
    			| 0x1 << PPB_AIRCR_PRIGROUP_Pos;
    }

    The problem is that the ESC gets stuck in INIT state when i try to go back to OP after the FoE download.

    How could i fix it?

    Thanks for any help

  6. #6
    Beginner Beginner Janet is on a distinguished road
    Join Date
    Feb 2019
    Posts
    22
    Points
    270
    Hi again!
    I really need to know how to write the firmware in the flash app partition once i've downloaded it by FoE.

+ Reply to Thread
Disclaimer

All content and materials on this site are provided “as is“. Infineon makes no warranties or representations with regard to this content and these materials of any kind, whether express or implied, including without limitation, warranties or representations of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, whether express or implied, is granted by Infineon. Use of the information on this site may require a license from a third party, or a license from Infineon.


Infineon accepts no liability for the content and materials on this site being accurate, complete or up- to-date or for the contents of external links. Infineon distances itself expressly from the contents of the linked pages, over the structure of which Infineon has no control.


Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Usage Terms of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Usage Terms of this site. Infineon reserves the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.