Example ssdConfig for mpc5646b

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

Example ssdConfig for mpc5646b

1,076 Views
vaso
Contributor I

Hello

Tell me how to implement the function of removing write protection of the high block in the MPC5646B processor. I took the example with MPC5602B as a basis, but I can only write to the lower part of the flash. How can I implement writing to the second bank of the flash. I am trying to use this code

where can I download an example example for MPC5646. All the links that are on the forum are empty. Or how can I correct my code for initializing the block. With the example below, I get error 300 when initializing the unlock

 

/* Unlock LOW PRIMARY blocks */
ret = pSetLock(&ssdDataConfig, LOCK_LOW_PRIMARY, 0x0U, FLASH_LMLR_PASSWORD);
ret |= pGetLock(&ssdDataConfig, LOCK_LOW_PRIMARY, &blkLockEnabled, &blkLockState);
blkLockState &= (0xFFFFFFFF >> (32 - ssdDataConfig.lowBlockNum));
if ((C90FL_OK != ret) || blkLockState)
{
ErrorTrap(ret);
}

/* Unlock LOW SECONDARY blocks */
ret = pSetLock(&ssdDataConfig, LOCK_LOW_SECONDARY, 0x0U, FLASH_SLMLR_PASSWORD);
ret |= pGetLock(&ssdDataConfig, LOCK_LOW_SECONDARY, &blkLockEnabled, &blkLockState);
blkLockState &= (0xFFFFFFFF >> (32 - ssdDataConfig.lowBlockNum));
if ((C90FL_OK != ret) || blkLockState)
{
ErrorTrap(ret);
}

/* Unlock HIGH blocks (optional) */
ret = pSetLock(&ssdDataConfig, LOCK_HIGH, 0x0U, FLASH_HBLR_PASSWORD);
ret |= pGetLock(&ssdDataConfig, LOCK_HIGH, &blkLockEnabled, &blkLockState);
blkLockState &= (0xFFFFFFFF >> (32 - ssdDataConfig.highBlockNum));
if ((C90FL_OK != ret) || blkLockState)
{
ErrorTrap(ret);
}

0 Kudos
Reply
4 Replies

782 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

I was talking to one colleague and he have example code.

Hope it helps.

Best regards,

Peter

0 Kudos
Reply

1,048 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

where can I download an example example for MPC5646. All the links that are on the forum are empty. Or how can I correct my code for initializing the block. With the example below, I get error 300 when initializing the unlock

Here are the examples:

https://community.nxp.com/t5/MPC5xxx-Knowledge-Base/MPC5-software-example-list/ta-p/1102445#MPC5646C

Tell me how to implement the function of removing write protection of the high block in the MPC5646B processor. I took the example with MPC5602B as a basis, but I can only write to the lower part of the flash. How can I implement writing to the second bank of the flash. I am trying to use this code

Access protections may be applied on a per-master basis for both reads and writes to support security and privilege mechanisms.

petervlna_0-1754551315487.png

petervlna_1-1754552476960.png

You need to unlock the HBL before programming:

petervlna_2-1754552564147.png

petervlna_3-1754553179513.png

 

/* unlock HLB block */
CFLASH.HLB.R =  0xB2B22222; /* unlock register */
CFLASH.HLB.R = 0x00000FFF; /* unlock all HLB flash */

Best regards,
Peter

 

0 Kudos
Reply

1,033 Views
vaso
Contributor I

Hello,

From the link you provided, I do not see an example of programming via the SSD_C90FL driver for BANK2 starting at address 0x180000.

I am encountering a problem where, using the SSD_C90FL driver, I am unable to program flash memory above address 0x180000.

I tried changing the password, and when using an incorrect password, I receive error code A00. Now, the password is accepted (no error), but I get error code 200 during flash programming.

Can you provide me with a working example for MPC5646B using the SSD_C90FL driver, or at least confirm the correct block configuration for BANK2 in the SSD_CONFIG?

Below is the configuration I tried:

lowBlockNum = 12, .

idBlockNum = 4,

highBlockNum = 16,

Thank you!

 

0 Kudos
Reply

962 Views
vaso
Contributor I

I wanted to add more details to my original post in this thread about programming the second flash bank (high blocks / BANK2) on MPC5646B using the SSD_C90FL driver.

BANK1 can be programmed without issues using the standard SSD_C90FL example. For BANK2, however, I still cannot get a working ssd_config configuration or correct block masks.

What I have checked and tried so far:

According to the block map in the MPC5646B Reference Manual, BANK2 consists of high blocks.

I have attempted to determine the addresses and masks for FlashErase() and FlashProgram() experimentally, but no success so far.

Unlocking via FlashSetLock() for high blocks does not work — likely due to incorrect mask values or base address settings.

I would appreciate help with the following points:

The correct SSD_CONFIG structure settings for BANK2 (addresses, sizes, number of blocks).

Whether a separate base address is required for BANK2 or if it shares the same base as BANK1.

Correct mask values for lowBlockLock, midBlockLock, and highBlockLock when unlocking high blocks.

A working example of FlashErase() and FlashProgram() calls for BANK2 on MPC5646B.

If anyone can share a working code snippet (or a link to an application note/example) where BANK2 is covered in detail for MPC5646B, that would be very helpful.

Here is my current draft configuration and code skeleton for BANK2:

#include "ssd_types.h"
#include "ssd_c90fl.h" // Header name may vary depending on SSD package

/* ======== TODO: Replace with exact values from MPC5646B RM ======== */
/* Fill in:
- P-Flash base address (main array)
- BANK2 (high blocks) start address, block size, number of blocks
- Shadow/UTEST base (if required)
- Correct lock/select masks for high blocks
*/

#define PFLASH_BASE 0x00XXXXXXu // TODO: base P-Flash address
#define BANK2_FIRST_BLOCK_ADDR 0x00YYYYYYu // TODO: start of first high block
#define BANK2_BLOCK_SIZE 0x00040000u // TODO: block size (e.g., 256KB)
#define BANK2_BLOCK_COUNT 0x00000004u // TODO: number of high blocks

#define DEMO_TARGET_ADDR (BANK2_FIRST_BLOCK_ADDR)

#define HIGH_BLOCK_SEL_MASK 0x00000001u // TODO: correct high block select mask
#define HIGH_BLOCK_LOCK_MASK 0x00000001u // TODO: correct high block lock mask

SSD_CONFIG ssdConfig = {
/* pFlashBase */ PFLASH_BASE,
/* uTestBase */ 0xXXXXXXu, // TODO: UTEST/shadow base (if required)
/* lowBlockNum */ 0,
/* midBlockNum */ 0,
/* highBlockNum */ BANK2_BLOCK_COUNT,
/* blockInfo */ NULL,
/* debugMode */ 0u,
/* callBack */ NULL
};

uint32_t demoBuf[64] = {0};

static void FillDemoBuffer(void)
{
for (uint32_t i = 0; i < (sizeof(demoBuf)/sizeof(demoBuf[0])); ++i) {
demoBuf[i] = 0xA5A50000u + i;
}
}

int ProgramBank2Demo(void)
{
uint32_t ret;
FLASH_SSD_CONFIG flashCfg = ssdConfig;

ret = FlashInit(&flashCfg);
if (ret != FTFx_OK) return ret;

ret = FlashSetLock(&flashCfg,
/* lowLock */ 0x00000000u,
/* midLock */ 0x00000000u,
/* highLock */ ~HIGH_BLOCK_LOCK_MASK);
if (ret != FTFx_OK) return ret;

ret = FlashBlockSelect(&flashCfg,
/* lowSel */ 0x00000000u,
/* midSel */ 0x00000000u,
/* highSel */ HIGH_BLOCK_SEL_MASK,
/* selInfo */ 0);
if (ret != FTFx_OK) return ret;

ret = FlashErase(&flashCfg,
/* dest */ DEMO_TARGET_ADDR,
/* size */ BANK2_BLOCK_SIZE,
/* key */ ERS_KEY);
if (ret != FTFx_OK) return ret;

FillDemoBuffer();
ret = FlashProgram(&flashCfg,
/* dest */ DEMO_TARGET_ADDR,
/* size */ sizeof(demoBuf),
/* pSource */ (uint32_t)demoBuf);
if (ret != FTFx_OK) return ret;

ret = FlashVerifyProgram(&flashCfg,
/* dest */ DEMO_TARGET_ADDR,
/* size */ sizeof(demoBuf),
/* pSource */ (uint32_t)demoBuf,
/* margin */ VERIFY_ALL);
return ret;
}

 

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2147517%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EExample%20ssdConfig%20for%20mpc5646b%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2147517%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%3C%2FP%3E%3CP%3ETell%20me%20how%20to%20implement%20the%20function%20of%20removing%20write%20protection%20of%20the%20high%20block%20in%20the%20MPC5646B%20processor.%20I%20took%20the%20example%20with%20MPC5602B%20as%20a%20basis%2C%20but%20I%20can%20only%20write%20to%20the%20lower%20part%20of%20the%20flash.%20How%20can%20I%20implement%20writing%20to%20the%20second%20bank%20of%20the%20flash.%20I%20am%20trying%20to%20use%20this%20code%3C%2FP%3E%3CP%3Ewhere%20can%20I%20download%20an%20example%20example%20for%20MPC5646.%20All%20the%20links%20that%20are%20on%20the%20forum%20are%20empty.%20Or%20how%20can%20I%20correct%20my%20code%20for%20initializing%20the%20block.%20With%20the%20example%20below%2C%20I%20get%20error%20300%20when%20initializing%20the%20unlock%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%2F*%20Unlock%20LOW%20PRIMARY%20blocks%20*%2F%3CBR%20%2F%3Eret%20%3D%20pSetLock(%26amp%3BssdDataConfig%2C%20LOCK_LOW_PRIMARY%2C%200x0U%2C%20FLASH_LMLR_PASSWORD)%3B%3CBR%20%2F%3Eret%20%7C%3D%20pGetLock(%26amp%3BssdDataConfig%2C%20LOCK_LOW_PRIMARY%2C%20%26amp%3BblkLockEnabled%2C%20%26amp%3BblkLockState)%3B%3CBR%20%2F%3EblkLockState%20%26amp%3B%3D%20(0xFFFFFFFF%20%26gt%3B%26gt%3B%20(32%20-%20ssdDataConfig.lowBlockNum))%3B%3CBR%20%2F%3Eif%20((C90FL_OK%20!%3D%20ret)%20%7C%7C%20blkLockState)%3CBR%20%2F%3E%7B%3CBR%20%2F%3EErrorTrap(ret)%3B%3CBR%20%2F%3E%7D%3C%2FP%3E%3CP%3E%2F*%20Unlock%20LOW%20SECONDARY%20blocks%20*%2F%3CBR%20%2F%3Eret%20%3D%20pSetLock(%26amp%3BssdDataConfig%2C%20LOCK_LOW_SECONDARY%2C%200x0U%2C%20FLASH_SLMLR_PASSWORD)%3B%3CBR%20%2F%3Eret%20%7C%3D%20pGetLock(%26amp%3BssdDataConfig%2C%20LOCK_LOW_SECONDARY%2C%20%26amp%3BblkLockEnabled%2C%20%26amp%3BblkLockState)%3B%3CBR%20%2F%3EblkLockState%20%26amp%3B%3D%20(0xFFFFFFFF%20%26gt%3B%26gt%3B%20(32%20-%20ssdDataConfig.lowBlockNum))%3B%3CBR%20%2F%3Eif%20((C90FL_OK%20!%3D%20ret)%20%7C%7C%20blkLockState)%3CBR%20%2F%3E%7B%3CBR%20%2F%3EErrorTrap(ret)%3B%3CBR%20%2F%3E%7D%3C%2FP%3E%3CP%3E%2F*%20Unlock%20HIGH%20blocks%20(optional)%20*%2F%3CBR%20%2F%3Eret%20%3D%20pSetLock(%26amp%3BssdDataConfig%2C%20LOCK_HIGH%2C%200x0U%2C%20FLASH_HBLR_PASSWORD)%3B%3CBR%20%2F%3Eret%20%7C%3D%20pGetLock(%26amp%3BssdDataConfig%2C%20LOCK_HIGH%2C%20%26amp%3BblkLockEnabled%2C%20%26amp%3BblkLockState)%3B%3CBR%20%2F%3EblkLockState%20%26amp%3B%3D%20(0xFFFFFFFF%20%26gt%3B%26gt%3B%20(32%20-%20ssdDataConfig.highBlockNum))%3B%3CBR%20%2F%3Eif%20((C90FL_OK%20!%3D%20ret)%20%7C%7C%20blkLockState)%3CBR%20%2F%3E%7B%3CBR%20%2F%3EErrorTrap(ret)%3B%3CBR%20%2F%3E%7D%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2157410%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Example%20ssdConfig%20for%20mpc5646b%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2157410%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%3C%2FP%3E%0A%3CP%3EI%20was%20talking%20to%20one%20colleague%20and%20he%20have%20example%20code.%3C%2FP%3E%0A%3CP%3EHope%20it%20helps.%3C%2FP%3E%0A%3CP%3EBest%20regards%2C%3C%2FP%3E%0A%3CP%3EPeter%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2151005%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Example%20ssdConfig%20for%20mpc5646b%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2151005%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20wanted%20to%20add%20more%20details%20to%20my%20original%20post%20in%20this%20thread%20about%20programming%20the%20second%20flash%20bank%20(high%20blocks%20%2F%20BANK2)%20on%20MPC5646B%20using%20the%20SSD_C90FL%20driver.%3C%2FP%3E%3CP%3EBANK1%20can%20be%20programmed%20without%20issues%20using%20the%20standard%20SSD_C90FL%20example.%20For%20BANK2%2C%20however%2C%20I%20still%20cannot%20get%20a%20working%20ssd_config%20configuration%20or%20correct%20block%20masks.%3C%2FP%3E%3CP%3EWhat%20I%20have%20checked%20and%20tried%20so%20far%3A%3C%2FP%3E%3CP%3EAccording%20to%20the%20block%20map%20in%20the%20MPC5646B%20Reference%20Manual%2C%20BANK2%20consists%20of%20high%20blocks.%3C%2FP%3E%3CP%3EI%20have%20attempted%20to%20determine%20the%20addresses%20and%20masks%20for%20FlashErase()%20and%20FlashProgram()%20experimentally%2C%20but%20no%20success%20so%20far.%3C%2FP%3E%3CP%3EUnlocking%20via%20FlashSetLock()%20for%20high%20blocks%20does%20not%20work%20%E2%80%94%20likely%20due%20to%20incorrect%20mask%20values%20or%20base%20address%20settings.%3C%2FP%3E%3CP%3EI%20would%20appreciate%20help%20with%20the%20following%20points%3A%3C%2FP%3E%3CP%3EThe%20correct%20SSD_CONFIG%20structure%20settings%20for%20BANK2%20(addresses%2C%20sizes%2C%20number%20of%20blocks).%3C%2FP%3E%3CP%3EWhether%20a%20separate%20base%20address%20is%20required%20for%20BANK2%20or%20if%20it%20shares%20the%20same%20base%20as%20BANK1.%3C%2FP%3E%3CP%3ECorrect%20mask%20values%20for%20lowBlockLock%2C%20midBlockLock%2C%20and%20highBlockLock%20when%20unlocking%20high%20blocks.%3C%2FP%3E%3CP%3EA%20working%20example%20of%20FlashErase()%20and%20FlashProgram()%20calls%20for%20BANK2%20on%20MPC5646B.%3C%2FP%3E%3CP%3EIf%20anyone%20can%20share%20a%20working%20code%20snippet%20(or%20a%20link%20to%20an%20application%20note%2Fexample)%20where%20BANK2%20is%20covered%20in%20detail%20for%20MPC5646B%2C%20that%20would%20be%20very%20helpful.%3C%2FP%3E%3CP%3EHere%20is%20my%20current%20draft%20configuration%20and%20code%20skeleton%20for%20BANK2%3A%3C%2FP%3E%3CP%3E%3CEM%3E%23include%20%22ssd_types.h%22%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%23include%20%22ssd_c90fl.h%22%20%2F%2F%20Header%20name%20may%20vary%20depending%20on%20SSD%20package%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3E%2F*%20%3D%3D%3D%3D%3D%3D%3D%3D%20TODO%3A%20Replace%20with%20exact%20values%20from%20MPC5646B%20RM%20%3D%3D%3D%3D%3D%3D%3D%3D%20*%2F%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%2F*%20Fill%20in%3A%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E-%20P-Flash%20base%20address%20(main%20array)%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E-%20BANK2%20(high%20blocks)%20start%20address%2C%20block%20size%2C%20number%20of%20blocks%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E-%20Shadow%2FUTEST%20base%20(if%20required)%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E-%20Correct%20lock%2Fselect%20masks%20for%20high%20blocks%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E*%2F%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3E%23define%20PFLASH_BASE%200x00XXXXXXu%20%2F%2F%20TODO%3A%20base%20P-Flash%20address%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%23define%20BANK2_FIRST_BLOCK_ADDR%200x00YYYYYYu%20%2F%2F%20TODO%3A%20start%20of%20first%20high%20block%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%23define%20BANK2_BLOCK_SIZE%200x00040000u%20%2F%2F%20TODO%3A%20block%20size%20(e.g.%2C%20256KB)%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%23define%20BANK2_BLOCK_COUNT%200x00000004u%20%2F%2F%20TODO%3A%20number%20of%20high%20blocks%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3E%23define%20DEMO_TARGET_ADDR%20(BANK2_FIRST_BLOCK_ADDR)%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3E%23define%20HIGH_BLOCK_SEL_MASK%200x00000001u%20%2F%2F%20TODO%3A%20correct%20high%20block%20select%20mask%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%23define%20HIGH_BLOCK_LOCK_MASK%200x00000001u%20%2F%2F%20TODO%3A%20correct%20high%20block%20lock%20mask%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3ESSD_CONFIG%20ssdConfig%20%3D%20%7B%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%2F*%20pFlashBase%20*%2F%20PFLASH_BASE%2C%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%2F*%20uTestBase%20*%2F%200xXXXXXXu%2C%20%2F%2F%20TODO%3A%20UTEST%2Fshadow%20base%20(if%20required)%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%2F*%20lowBlockNum%20*%2F%200%2C%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%2F*%20midBlockNum%20*%2F%200%2C%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%2F*%20highBlockNum%20*%2F%20BANK2_BLOCK_COUNT%2C%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%2F*%20blockInfo%20*%2F%20NULL%2C%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%2F*%20debugMode%20*%2F%200u%2C%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%2F*%20callBack%20*%2F%20NULL%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%7D%3B%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3Euint32_t%20demoBuf%5B64%5D%20%3D%20%7B0%7D%3B%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3Estatic%20void%20FillDemoBuffer(void)%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%7B%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3Efor%20(uint32_t%20i%20%3D%200%3B%20i%20%26lt%3B%20(sizeof(demoBuf)%2Fsizeof(demoBuf%5B0%5D))%3B%20%2B%2Bi)%20%7B%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3EdemoBuf%5Bi%5D%20%3D%200xA5A50000u%20%2B%20i%3B%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%7D%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%7D%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3Eint%20ProgramBank2Demo(void)%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%7B%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3Euint32_t%20ret%3B%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3EFLASH_SSD_CONFIG%20flashCfg%20%3D%20ssdConfig%3B%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3Eret%20%3D%20FlashInit(%26amp%3BflashCfg)%3B%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3Eif%20(ret%20!%3D%20FTFx_OK)%20return%20ret%3B%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3Eret%20%3D%20FlashSetLock(%26amp%3BflashCfg%2C%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%2F*%20lowLock%20*%2F%200x00000000u%2C%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%2F*%20midLock%20*%2F%200x00000000u%2C%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%2F*%20highLock%20*%2F%20~HIGH_BLOCK_LOCK_MASK)%3B%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3Eif%20(ret%20!%3D%20FTFx_OK)%20return%20ret%3B%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3Eret%20%3D%20FlashBlockSelect(%26amp%3BflashCfg%2C%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%2F*%20lowSel%20*%2F%200x00000000u%2C%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%2F*%20midSel%20*%2F%200x00000000u%2C%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%2F*%20highSel%20*%2F%20HIGH_BLOCK_SEL_MASK%2C%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%2F*%20selInfo%20*%2F%200)%3B%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3Eif%20(ret%20!%3D%20FTFx_OK)%20return%20ret%3B%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3Eret%20%3D%20FlashErase(%26amp%3BflashCfg%2C%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%2F*%20dest%20*%2F%20DEMO_TARGET_ADDR%2C%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%2F*%20size%20*%2F%20BANK2_BLOCK_SIZE%2C%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%2F*%20key%20*%2F%20ERS_KEY)%3B%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3Eif%20(ret%20!%3D%20FTFx_OK)%20return%20ret%3B%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3EFillDemoBuffer()%3B%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3Eret%20%3D%20FlashProgram(%26amp%3BflashCfg%2C%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%2F*%20dest%20*%2F%20DEMO_TARGET_ADDR%2C%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%2F*%20size%20*%2F%20sizeof(demoBuf)%2C%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%2F*%20pSource%20*%2F%20(uint32_t)demoBuf)%3B%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3Eif%20(ret%20!%3D%20FTFx_OK)%20return%20ret%3B%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3Eret%20%3D%20FlashVerifyProgram(%26amp%3BflashCfg%2C%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%2F*%20dest%20*%2F%20DEMO_TARGET_ADDR%2C%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%2F*%20size%20*%2F%20sizeof(demoBuf)%2C%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%2F*%20pSource%20*%2F%20(uint32_t)demoBuf%2C%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%2F*%20margin%20*%2F%20VERIFY_ALL)%3B%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3Ereturn%20ret%3B%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3E%7D%3C%2FEM%3E%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2149290%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Example%20ssdConfig%20for%20mpc5646b%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2149290%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CSPAN%3EHello%2C%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EFrom%20the%20link%20you%20provided%2C%20I%20do%20not%20see%20an%20example%20of%20programming%20via%20the%20SSD_C90FL%20driver%20for%20BANK2%20starting%20at%20address%200x180000.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EI%20am%20encountering%20a%20problem%20where%2C%20using%20the%20SSD_C90FL%20driver%2C%20I%20am%20unable%20to%20program%20flash%20memory%20above%20address%200x180000.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EI%20tried%20changing%20the%20password%2C%20and%20when%20using%20an%20incorrect%20password%2C%20I%20receive%20error%20code%20A00.%20Now%2C%20the%20password%20is%20accepted%20(no%20error)%2C%20but%20I%20get%20error%20code%20200%20during%20flash%20programming.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3ECan%20you%20provide%20me%20with%20a%20working%20example%20for%20MPC5646B%20using%20the%20SSD_C90FL%20driver%2C%20or%20at%20least%20confirm%20the%20correct%20block%20configuration%20for%20BANK2%20in%20the%20SSD_CONFIG%3F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EBelow%20is%20the%20configuration%20I%20tried%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3ElowBlockNum%20%3D%2012%2C%20.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EidBlockNum%20%3D%204%2C%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EhighBlockNum%20%3D%2016%2C%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EThank%20you!%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2148227%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Example%20ssdConfig%20for%20mpc5646b%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2148227%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%3C%2FP%3E%0A%3CBLOCKQUOTE%3E%0A%3CP%3Ewhere%20can%20I%20download%20an%20example%20example%20for%20MPC5646.%20All%20the%20links%20that%20are%20on%20the%20forum%20are%20empty.%20Or%20how%20can%20I%20correct%20my%20code%20for%20initializing%20the%20block.%20With%20the%20example%20below%2C%20I%20get%20error%20300%20when%20initializing%20the%20unlock%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CP%3EHere%20are%20the%20examples%3A%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FMPC5xxx-Knowledge-Base%2FMPC5-software-example-list%2Fta-p%2F1102445%23MPC5646C%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcommunity.nxp.com%2Ft5%2FMPC5xxx-Knowledge-Base%2FMPC5-software-example-list%2Fta-p%2F1102445%23MPC5646C%3C%2FA%3E%3C%2FP%3E%0A%3CBLOCKQUOTE%3E%0A%3CP%3ETell%20me%20how%20to%20implement%20the%20function%20of%20removing%20write%20protection%20of%20the%20high%20block%20in%20the%20MPC5646B%20processor.%20I%20took%20the%20example%20with%20MPC5602B%20as%20a%20basis%2C%20but%20I%20can%20only%20write%20to%20the%20lower%20part%20of%20the%20flash.%20How%20can%20I%20implement%20writing%20to%20the%20second%20bank%20of%20the%20flash.%20I%20am%20trying%20to%20use%20this%20code%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CP%3EAccess%20protections%20may%20be%20applied%20on%20a%20per-master%20basis%20for%20both%20reads%20and%20writes%20to%20support%20security%20and%20privilege%20mechanisms.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22petervlna_0-1754551315487.png%22%20style%3D%22width%3A%20736px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22petervlna_0-1754551315487.png%22%20style%3D%22width%3A%20736px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F351309i7422F2BFAB2A2AB9%2Fimage-dimensions%2F736x152%3Fv%3Dv2%22%20width%3D%22736%22%20height%3D%22152%22%20role%3D%22button%22%20title%3D%22petervlna_0-1754551315487.png%22%20alt%3D%22petervlna_0-1754551315487.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22petervlna_1-1754552476960.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22petervlna_1-1754552476960.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F351321iA5415C5022433DA6%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22petervlna_1-1754552476960.png%22%20alt%3D%22petervlna_1-1754552476960.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EYou%20need%20to%20unlock%20the%20HBL%20before%20programming%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22petervlna_2-1754552564147.png%22%20style%3D%22width%3A%20552px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22petervlna_2-1754552564147.png%22%20style%3D%22width%3A%20552px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F351325i71DCACDB3E88326B%2Fimage-dimensions%2F552x149%3Fv%3Dv2%22%20width%3D%22552%22%20height%3D%22149%22%20role%3D%22button%22%20title%3D%22petervlna_2-1754552564147.png%22%20alt%3D%22petervlna_2-1754552564147.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22petervlna_3-1754553179513.png%22%20style%3D%22width%3A%20558px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22petervlna_3-1754553179513.png%22%20style%3D%22width%3A%20558px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F351343iF7A2994E1F9515E2%2Fimage-dimensions%2F558x258%3Fv%3Dv2%22%20width%3D%22558%22%20height%3D%22258%22%20role%3D%22button%22%20title%3D%22petervlna_3-1754553179513.png%22%20alt%3D%22petervlna_3-1754553179513.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%2F*%20unlock%20HLB%20block%20*%2F%3CBR%20%2F%3ECFLASH.HLB.R%20%3D%20%26nbsp%3B0xB2B22222%3B%20%2F*%20unlock%20register%20*%2F%3CBR%20%2F%3ECFLASH.HLB.R%20%3D%200x00000FFF%3B%20%2F*%20unlock%20all%20HLB%20flash%20*%2F%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CP%3EBest%20regards%2C%3CBR%20%2F%3EPeter%3C%2FP%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E