Codewarrior flash error - Sector Protection Error.

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

Codewarrior flash error - Sector Protection Error.

Jump to solution
4,122 Views
Amit-Kumar
Contributor II


We have a T1023 based design board which we are trying to program for first time with Hardcoded RCW. When flash programmer actions "Program and verify" are chosen, Erase fails:

"Error: Erase failed. Flash driver reports the following error(s): Sector Protection Error"

The Dump flash appears to go well from logs and the saved file is all 0xFF's (Clean flash).

Few details and background:

1) NOR flash is device S70GL02GT12FHBV20 (Cypress) - 256 MB.
2) Created a bareboard project in codewarrior and chose template target init script as "T1023RDB_init_sram.tcl" and Memory initialization one as "T1023RDB.mem". These were modified for our design (For 256 MB flash). Attached.
3) Added a flash device as "S29GL01GP (64Mx16x1)" with base address and offsets as captured in console logs.

Please advice/guide with your expertise. If a support request is required let me know too.

Tags (1)
0 Kudos
1 Solution
4,032 Views
ufedor
NXP Employee
NXP Employee

Have you considered that IFC address bus is 32-bit-wide for T1042 and only 28-bit-wide for T1023?

View solution in original post

9 Replies
2,281 Views
RachelGomez123
Contributor I

If this error happens only on one PC and CodeWarrior correctly works on other PC, try to reinstall CodeWarrior on this PC.

It looks like that CodeWarrior incorrectly installed on this PC.

 

Regards,

Rachel Gomez

0 Kudos
3,952 Views
Amit-Kumar
Contributor II

Considering switching "ADM_SHFT_MODE" and modification of CPLD logic to handle addresses straight. Thanks for assistance.

0 Kudos
4,069 Views
ufedor
NXP Employee
NXP Employee

Please add Unprotect Action for selected sectors.

0 Kudos
4,060 Views
Amit-Kumar
Contributor II

Yup tried that as well .. Doesn't work.

fl::target -lc "T1023_Fresh_debug-core00_RAM_T1023_Connect"

fl::target -b 0x0 0x10000

fl::target -v on -l off

cmdwin::fl::device -d "S29GL01GP" -o "64Mx16x1" -a 0xe0000000 0xe7ffffff

cmdwin::fl::protect all off

 Beginning Operation ...   

------------------------- 

Performing target initialization ...   

 Downloading Flash Diagnostics Driver ...  

 Reading flash ID ...

Unprotecting all sectors...  

Unprotecting ...  

Unprotecting ....  

Unprotecting .....  

Unprotecting ......  

 Unprotect Command Succeeded   

fl::target -lc "T1023_Fresh_debug-core00_RAM_T1023_Connect"

fl::target -b 0x0 0x10000

fl::target -v on -l off

cmdwin::fl::device -d "S29GL01GP" -o "64Mx16x1" -a 0xe0000000 0xe7ffffff

cmdwin::fl::image -f "C:\\Users\\labuser\\qcvs\\NTK55952\\Generated_Code\\PBL.bin" -t "Auto Detect" -re off -oe on -o 0xe3a20000

cmdwin::fl::erase image

 Beginning Operation ...   

------------------------- 

Auto-detection is successful.  

 File is of type Binary/Raw Format.  

 

Performing target initialization ...   

 Downloading Flash Device Driver ...  

 Reading flash ID ...

Erasing Sector 0xE3A20000 to 0xE3A3FFFF  

 Erasing ...

Error: Erase failed.  Flash driver reports the following error(s): Sector Protection Error

Error: Erase failed. Flash driver reports the following error(s): Sector Protection Error


Real assistance would be to verify the two codewarrior scripts we modified to suit our design with minor changes, please check them once, they are attached in this request:

 

< T1023RDB_init_sram.tcl>

=> Expanded LAW window as (0xE000_0000 – 0x EFFF_FFFF) to accommodate 256 MB flash device.

=> IFC Controller setup for new space.

 

< T1023RDB.mem>

=> TLB Entries and reserved range update for flash.

 

Meanwhile we are also checking the addresses put on the address bus of the flash device, since there is one more device in between T1023 and Flash device.

0 Kudos
4,051 Views
ufedor
NXP Employee
NXP Employee

".mem" file is not used during Flash Programmer operation.

In the modified "T1023RDB_init_sram.tcl" ADM_SHFT_MODE=0:

mem [CCSR_ADDR [expr {0x124130 + $NOR_CS * 0x0C}]] = 0x0000000C

Why?

4,042 Views
Amit-Kumar
Contributor II


This is alright, we have a CPLD device between T1023 and Flash.

T1023 =>CPLD=> Flash.

And is according to the expectation of CPLD device.

We also use T1042 based system with same flash and CPLD device which works perfectly...
This setting came from there (ADM_SHFT_MODE=0)

We are also verifying if CPLD device is putting correct addresses or not for flash.

0 Kudos
4,033 Views
ufedor
NXP Employee
NXP Employee

Have you considered that IFC address bus is 32-bit-wide for T1042 and only 28-bit-wide for T1023?

4,020 Views
Amit-Kumar
Contributor II

Going through Reference manuals of T1042 and T1023 i see no differences between IFC block of both.

I hope you are not taking about our design (Which uses 28 bit indeed)?

0 Kudos
4,013 Views
Amit-Kumar
Contributor II


Thanks Fedor this is a very good point. I get it now.


I was running through "Integrated flash" section in Reference manual for T1023.

<Table 23-1. Signal properties>
 

Which mentioned

IFC_AD[0:15]        AD[0:15]

IFC_A[16:31]        ADDR[16:31]

 

Which led me to believe that its a 32 bit bus. But its not actually.

0 Kudos