Unable to erase sector in flash memory XMC4800

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
elsp1991
Level 1
Level 1
First solution authored 5 replies posted 5 sign-ins

Hello all,

I have an issue trying to erase the Flash memory and specifically any sector above S8 of XMC4800. I am using the following function:

XMC_FLASH_EraseSector((uint32_t*)0x0C040000); 

and it completely freezes the microcontroller when running over this command. In the other hand the following

XMC_FLASH_EraseSector((uint32_t*)0x0C020000);

It succeeds. My firmware is running in S0-S4. The weird thing is that if I use the XMC4800_E196x2048 version it works but I my board has the XMC4800_F144x2048. Is anyone aware of any errata related?

0 Likes
1 Solution
elsp1991
Level 1
Level 1
First solution authored 5 replies posted 5 sign-ins

I was able to  track down the problem. So during the Flash erase the MCU is consuming significantly more power than in normal operation causing by power supply to be unstable but without droping completely the voltage. This behavior caused the MCU to hang in a very unknown state.
The XMC4800F100 looks like is consuming a bit more power than is documented during at least the flash erasing in maximum CPU freq

View solution in original post

0 Likes
8 Replies
BushraH_91
Moderator
Moderator
Moderator
750 replies posted 50 likes received 250 solutions authored

Hello,

Thank you for contacting Infineon Technologies. Can you please share the screenshot of the issue and if possible send the code.

Thank you

Regards,

Bushra

0 Likes

Hello,

Can you please provide full MPN of the Flash memory you are using?

Thank you

Regards,

Bushra

0 Likes

Hello BushraH,

The uC I am using is XMC4800F100K2048 (AA 84pkva73x08 G2023)

hope that helps

 

0 Likes
lock attach
Attachments are accessible only for community members.

This is the main.c of the project, the project is just newly created as Dave simple main project and everything is the default. Attached you can find the dave project as zip file. 
The code will go through the erase of sector 8 but will hang during erasing of sector 10

 

 

/*
 * main.c
 *
 *  Created on: 2022 Mar 02 10:04:07
 *  Author: 
 */



#include "xmc_common.h"
#include "xmc_flash.h"
/**

 * @brief main() - Application entry point
 *
 * <b>Details of function</b><br>
 * This routine is the application entry point. It is invoked by the device startup code. 
 */

int main(void)
{
  XMC_FLASH_EraseSector(XMC_FLASH_SECTOR_8);
  XMC_FLASH_EraseSector(XMC_FLASH_SECTOR_10);
  /* Placeholder for user application code. The while loop below can be replaced with user application code. */
  while(1U)
  {

  }
}

 

 

 

0 Likes

Hello Bushra,

I also realized that the problem is not consistant through the 25 PCBs I have but with some of them I cannot even erase the S8. So is it possible that somehow the Flash memory is corrupted and if so is there a way to repair each sector?

0 Likes

Hello Bushra,

Do you have any news regarding this issue?

0 Likes
Vasanth
Moderator
Moderator
Moderator
250 sign-ins 500 solutions authored First question asked

Hi,

Is this the custom board you are using ? When the failure is happening is the control is going to any fault handlers ? Have you been able identify the fault if that is happening at your end ?

Best Regards,
Vasanth

0 Likes
elsp1991
Level 1
Level 1
First solution authored 5 replies posted 5 sign-ins

I was able to  track down the problem. So during the Flash erase the MCU is consuming significantly more power than in normal operation causing by power supply to be unstable but without droping completely the voltage. This behavior caused the MCU to hang in a very unknown state.
The XMC4800F100 looks like is consuming a bit more power than is documented during at least the flash erasing in maximum CPU freq

0 Likes