Issue of MPC5748G C55 Flash Driver

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Issue of MPC5748G C55 Flash Driver

1,205 Views
tajo
Contributor I

Hi everyone,

   I am using  DEVKIT-MPC5748G to develop bootloader. But I got some problem while using c55 flash driver.

   The problem is that using pFlashErase() to erase 256KBlock will get stuck in IVOR1_Handler after I unlock the all the 256KBlock except the 22th 256KBlock  by using :

  pSetLock(&ssdConfig, C55_BLOCK_256K_FIRST, 0xFFE00000);

Erase by:

/* Select all blocks except blocks occupied by bootloader */
lowBlockSelect = 0x0000017C; //0b 0001 0111 1100  0x00620000-0x00620000(HSM Code) 0x00F8C000U(Bootloader) 0x00404000(BAF)
midBlockSelect = 0x000003FE; //0b 0011 1111 1110 0x00F90000U(Booyloader)
highBlockSelect = 0x00000000; //0b 0000 0000 0000 0x00F80000U 0x00F84000U (HSM Data)
n256KBlockSelect.first256KBlockSelect = 0x001FFFFF;//0x003FFFFF; // 0x003FFFFF; //0b 0011 1111 1111 1111 1111 1111
n256KBlockSelect.second256KBlockSelect = 0x00000000;

returnCode = pFlashErase(&ssdConfig,
C55_ERASE_MAIN,
lowBlockSelect,
midBlockSelect,
highBlockSelect,
n256KBlockSelect);

Is there sth err ?

Please help me about this issue.

Best regard.

0 Kudos
5 Replies

1,049 Views
tajo
Contributor I

   And when I did not erase any 256KBlock, it is Okay:

pFlashErase(&ssdConfig,
C55_ERASE_MAIN,
lowBlockSelect,
midBlockSelect,
highBlockSelect,
0x00000000);

   I have checked the memory, the last 256KBlock is from 0x01540000 to 0x0157FFFF. When I am debugging, it's occupied, so I just cannot erase this block. Is this right? But I can erase left 21 256KBlock.

   My linker_flash.ld setting is:

MEMORY

flash_rchw : org = 0x00f8c000, len = 0x4 
cpu0_reset_vec : org = 0x00f8c000+0x10, len = 0x4
cpu1_reset_vec : org = 0x00f8c000+0x14, len = 0x4
cpu2_reset_vec : org = 0x00f8c000+0x04, len = 0x4

/*m_text : org = FLASH_BASE_ADDR, len = FLASH_SIZE*/
/*m_data : org = SRAM_BASE_ADDR, len = SRAM_SIZE*/
m_text : org = 0x01540000, len = 256k
m_data : org = SRAM_BASE_ADDR, len = SRAM_SIZE
}

0 Kudos

1,049 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

I can't see any issues on my side, I successfully erased also the last 256kb blocks. Can you share some simple project to reproduce the problem?

Regards,

Lukas

0 Kudos

1,049 Views
tajo
Contributor I

Hi Lukas,

   I have just import a new S32DS prject from example.There is some original content(do not erase any 256Kblock):

blockSelect.lowBlockSelect = 0x4U;
blockSelect.midBlockSelect = 0x0U;
blockSelect.highBlockSelect = 0x0U;
blockSelect.first256KBlockSelect = 0x0U;
blockSelect.second256KBlockSelect = 0x0U;

 Because flash.ld is :

m_text : org = 0x01540000, len = 256k
m_data : org = SRAM_BASE_ADDR, len = SRAM_SIZE

   So I change it to erase all 256kb blocks except the last, from 0x01540000 to 0x0157FFFF(refer to MPC5748G_features.h) :

blockSelect.lowBlockSelect = 0x4U;
blockSelect.midBlockSelect = 0x0U;
blockSelect.highBlockSelect = 0x0U;
blockSelect.first256KBlockSelect = 0x001FFFFF;//0x0U;
blockSelect.second256KBlockSelect = 0x0U;

   Sorry I cannot find out where to upload files, so I will mention that the example project name, its:

flash_program_erase_mpc5748g

   Can U help me importing & testing it?

Regards,

Tajo.

0 Kudos

1,049 Views
tajo
Contributor I

pastedImage_1.pngpastedImage_2.png

   I try to debug with the example, for that I want to find out when the problem will happen while which blosck being erased. There was someting strange.

    When I am erasing the 20th 256kb block(while j == 19),  the last block (from 0x01540000 to 0x0157FFFF) will be erased?Emmmmmm...

0 Kudos

1,048 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

attached is my testing project. I just imported the drivers and simply copied important code from the demo code. Then I add unlocking of 256kb blocks and I erased last two blocks. To see the difference, I programmed some data to those blocks via debugger. I can see no problem here.

Regards,

Lukas

***

Any support, information, and technology (“Materials”) provided by NXP are provided AS IS, without any warranty express or implied, and
NXP disclaims all direct and indirect liability and damages in connection with the Material to the maximum extent permitted by the applicable
law. NXP accepts no liability for any assistance with applications or product design.  Materials may only be used in connection with NXP
products. Any feedback provided to NXP regarding the Materials may be used by NXP without restriction.

0 Kudos