Hello,
I'm trying to do a bootloader with the micro MPC5744P with GCC . But I have problems when I'm doing the flash erase. I have the program in this flash sections:
/*16 KB low flash memory block 2 (boot location 0) from 0x00F98000 to 0x00F9BFFF*/
/*16 KB low flash memory block 3 (boot location 1) from 0x00F9C000 to 0x00F9FFFF*/
/*64 KB low flash memory block 4 (boot location 2) from 0x00FA0000 to 0x00FAFFFF*/
flash_rchw : org = 0x00F98000, len = 4
cpu0_reset_vec : org = 0x00F98004, len = 4
m_text : org = 0x00F98008, len = 96K - 4 - 4
When i do de flash erase I configure the C55 driver values like this:
block_mpc574xP.h
#define UNLOCK_LOW_BLOCKS 0x0000000E
#define UNLOCK_MID_BLOCKS 0x00000000
#define UNLOCK_HIGH_BLOCKS 0x00000001
#define UNLOCK_FIRST256_BLOCKS 0x00
#define SKIP_IDX_NUM 0x4 /*for bootloader project*/
block_mpc574xp.c
const UINT32 SKIP_BLOCK_IDX[SKIP_IDX_NUM] =
{
0x1, /* BAF block */
0x2, /* bootloader block, Flash low 1 block: address 0x00F98000 to 0x00F9BFFF */
0x3, /* bootloader block, Flash low 2 block: address 0x00F9C000 to 0x00F9CFFF */
0x6 /* bootloader block, Flash high 0 block: address 0x00FA0000 to 0x00FAFFFF */
};
But when I'm doing the flash delete, is always accessing to EER exception_handler.
Thanks
I finally got it fixed.
It seems that I was erasing more than what was left. My main program was hosted in these directions. So if I deleting one of those blocks raised an exception. You should check these directions with your memory map.
const uint32_t SKIP_BLOCK_IDX[SKIP_IDX_NUM] =
{
/*for bootloader project, the flash block to ship depends on the project linker command file*/
0x1,
0x2, /* bootloader block, Flash low 1 block: address 0x00F98000 to 0x00F9BFFF */
0x3, /* bootloader block, Flash low 2 block: address 0x00F9C000 to 0x00F9CFFF */
0x6, /* bootloader block, Flash high 0 block: address 0x00FA0000 to 0x00FAFFFF */
0x7, /* bootloader block, Flash high 0 block: address 0x00FB0000 to 0x00FBFFFF */
};
Apart of that check if the blocks that you want to delete are not blocked. The blocked mask of the blocks you want to delete should be disabled.
/* Lock State */
#define UNLOCK_LOW_BLOCKS 0x00000002
#define UNLOCK_MID_BLOCKS 0x00000000
#define UNLOCK_HIGH_BLOCKS 0x00000000
#ifdef RAM_TARGET
#define UNLOCK_FIRST256_BLOCKS 0x00
#endif
#ifdef FLASH_TARGET
#define UNLOCK_FIRST256_BLOCKS 0x00
#endif
#define UNLOCK_SECOND256_BLOCKS 0x00000000
Hello Ekaitz, I was about to create a new post when I saw yours. I don't know if you solved your problem but I have a similar issue when trying to erase the flash and I was wondering if your MCU could be in the same situation. I am using a MPC5744P development kit and it started by getting programming errors during the flashing of my code using the debug probe (P&E Micro Multilink). So I decided to try to erase the flash by an application SW in RAM, without success. As soon as start the flash erase sequence, I end up in an exception because the whole memory map goes all zeros / "se_illegal " opcode.
Then I looked at the micro controller components status to see that the MEMU has uncorrectable flash error at the beginning of the flash (0x00F98000) and flags about the error reporting table overflows. But the weird part is that there are no STCU MBIST errors reported or FCCU NFC occurrences even after doing a FCCU module initialization.