How to flash NOR on P1014 Custom board?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to flash NOR on P1014 Custom board?

5,687 次查看
George_zheng
Contributor I

I refer "https://www.nxp.com/video/how-to-set-up-codewarrior-pa10:HOW-TO-RUN-CODEWARRIOR-PA10" to do NOR flash.
I select JS28F256M29EWL device, but our NOR is JS28F256M29EWH, It's should be no problem.

While trying to program the NOR flash using PA Flash Programmer Task,
we are getting following errors in CodeWarrior console for 'Diagnostics','Checksume', 'program/verify' actions:

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

fl::target -lc "p1014_SRAM-core00_SRAM_P1014_Download"
fl::target -b 0x2000 0x30000
fl::target -v off -l off
cmdwin::fl::device -d "JS28F256M29EWL" -o "32Mx8x1" -a 0x0 0x1ffffff
cmdwin::fl::diagnose
Beginning Operation ...
-------------------------
Performing target initialization ...
Downloading Flash Diagnostics Driver ...
Reading flash ID ...
Running Diagnostics ...
Error: The Diagnostics operation failed. Flash diagnostics reports the following error(s): Operation Unsupported
Error: Diagnose operation failed
Error: The Diagnostics operation failed. Flash diagnostics reports the following error(s): Operation Unsupported

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

And following while running 'Earse/blankcheck' action:

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

fl::target -b 0x2000 0x30000
fl::target -v off -l off
cmdwin::fl::device -d "JS28F256M29EWL" -o "32Mx8x1" -a 0x0 0x1ffffff
cmdwin::fl::device -sd all
cmdwin::fl::device -se 0
cmdwin::fl::erase list
Beginning Operation ...
-------------------------
Performing target initialization ...
Downloading Flash Device Driver ...
Reading flash ID ...
Erasing Sector 0x00000000 to 0x0001FFFF
Erasing .......................
Error: Erase failed. Flash driver reports the following error(s): Timed Out. If you are trying to program a sector please make sure that the sector is erased.

Error: Erase failed. Flash driver reports the following error(s): Timed Out. If you are trying to program a sector please make su
re that the sector is erased.

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

And following while running 'Checksume' action:

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

fl::target -lc "p1014_SRAM-core00_SRAM_P1014_Download"
fl::target -b 0x2000 0x30000
fl::target -v off -l off
cmdwin::fl::device -d "JS28F256M29EWL" -o "32Mx8x1" -a 0x0 0x1ffffff
cmdwin::fl::image -f "" -t "Auto Detect" -re off -oe off
cmdwin::fl::checksum -dev
Beginning Operation ...
-------------------------
Performing target initialization ...
Downloading Flash Utility Driver ...

Calculating Checksum over 0x01FFFFFF bytes at 0x00000000 ...
Performing Checksum ...
Error: Checksum failed.
Error: Checksum failed.
Error: Checksum failed.

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

Can someone suggest what might be the reason we are unable to do NOR flash actions?

标签 (1)
0 项奖励
回复
14 回复数

5,681 次查看
yipingwang
NXP TechSupport
NXP TechSupport

You didn't specify the correct "Base Address" for the NOR flash Device.

According to CodeWarrior initialization file C:\Freescale\CW_PA_v10.5.1\PA\PA_Support\Initialization_Files\QorIQ_P1\P1014RDB-PB_init_sram.tcl, the effective address for NOR flash should be 0xFE000000 to 0xFFFFFFFF.

In the "PA Flash Programmer Task" panel, after add device JS28F256M29EWL, please modify the "Base Address“ as "0xFE000000".

 

5,674 次查看
George_zheng
Contributor I

Hi yipingwang,

After set base address to FE000000, some action can be execution.
following while running 'program/verify' action:
====================================================================
following while running 'earse' action:
fl::target -lc "p1014_SRAM-core00_SRAM_P1014_Download"
fl::target -b 0x0 0x40000
fl::target -v off -l off
cmdwin::fl::device -d "MX29GL256EH" -o "32Mx8x1" -a 0xfe000000 0xffffffff
cmdwin::fl::erase all
Beginning Operation ...
-------------------------
Performing target initialization ...
Downloading Flash Device Driver ...
Reading flash ID ...
Erasing entire flash ...
Erasing ...
Erase Command Succeeded
====================================================================
This action was success, but following while running 'program' action was fail as below:
====================================================================
fl::target -lc "p1014_SRAM-core00_SRAM_P1014_Download"
fl::target -b 0x0 0x40000
fl::target -v off -l off
cmdwin::fl::device -d "MX29GL256EH" -o "32Mx8x1" -a 0xfe000000 0xffffffff
cmdwin::fl::image -f "C:\\Users\\MLHDV\\Documents\\test.tcl" -t "Auto Detect" -re on -r 0xfe000000 0xffffffff -oe on -o 0xfe1f0000
cmdwin::fl::write
Beginning Operation ...
-------------------------
Using restricted address range 0xFE000000 to 0xFFFFFFFF
Programming file C:\Users\MLHDV\Documents\test.tcl
Auto-detection is successful.
File is of type Binary/Raw Format.

Performing target initialization ...
Downloading Flash Device Driver ...
Reading flash ID ...
Auto-detection is successful.
File is of type Binary/Raw Format.

Downloading 0x00003990 bytes to be programmed at 0xFE1F0000
Executing program ....
Executing program .....
Executing program ......
Executing program .......
Executing program ........
Executing program .........
Executing program ..........
Executing program ...........
Executing program ............
Executing program .............
Executing program ..............
Executing program ...............
Executing program ................
Executing program .................
Executing program ..................
Executing program ...................
Executing program ....................
Executing program .....................
Executing program ......................
Executing program .......................
Executing program ........................
Error: Program failed. Flash driver reports the following error(s): Timed Out. If you are trying to program a sector please make sure that the sector is erased.
Chip reported error during program. Please check that the sector you are programming is erased.

Error: Program failed. Flash driver reports the following error(s): Timed Out. If you are trying to program a sector please make
sure that the sector is erased.
Chip reported error during program. Please check that the sector you are programming is erased.
====================================================================

I test a file to flash at 0xFE1F0000 but it's failed.
It fails to burn a small file, but I have to burn a uboot.

another question, Where should uboot be burned at address?

Thanks.

0 项奖励
回复

5,660 次查看
yipingwang
NXP TechSupport
NXP TechSupport

According to your previous description your NOR flash is "JS28F256M29EWH", why did you use device "MX29GL256EH" in your flash programming procedure?

You need to program u-boot at fff40000.

0 项奖励
回复

5,653 次查看
George_zheng
Contributor I

I change another custom board to test which just nor flash different.

Following while running 'earse' action was success but I check nor flash not earse, still can boot.

and 'program' action still fail.

Do you have any suggestion or debug method?

 

 

0 项奖励
回复

5,642 次查看
yipingwang
NXP TechSupport
NXP TechSupport

MX29GL256EH should be 16bit device, why do you use the organization "32Mx8x1" in your flash programmer?

Please refer to section "110. Troubleshooting the Flash Programmer" in document C:\Freescale\CW_PA_v10.5.1\PA\PA_Tools\FlashToolKit\Documentation\AppNote-FlashProgrammer-PowerArchitecture.pdf to check whether it is possible to do flash erase in the debug shell console.

0 项奖励
回复

5,637 次查看
George_zheng
Contributor I

Our custom board was using 8bit nor flash, so I add 32Mx8x1 in MX29GL256EH to test.

I test JS28F256M29EWL also get the same error.

I try to execte the Unprotection task, but still fail.

fl::target -lc "p1014_SRAM-core00_SRAM_P1014_Download"
fl::target -b 0x0 0x40000
fl::target -v off -l off
cmdwin::fl::device -d "JS28F256M29EWL" -o "32Mx8x1" -a 0xfe000000 0xffffffff
cmdwin::fl::image -f "C:\\Users\\MLHDV\\Documents\\u-boot-1.bin" -t "Auto Detect" -re on -r 0xfe000000 0xffffffff -oe on -o 0xfef40000
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 0xFEF40000 to 0xFEF5FFFF
Erasing Sector 0xFEF60000 to 0xFEF7FFFF
Erasing Sector 0xFEF80000 to 0xFEF9FFFF
Erasing Sector 0xFEFA0000 to 0xFEFBFFFF
Erasing Sector 0xFEFC0000 to 0xFEFDFFFF
Erasing Sector 0xFEFE0000 to 0xFEFFFFFF
Erasing ...
Erase Command Succeeded
cmdwin::fl::write
Beginning Operation ...
-------------------------
Using restricted address range 0xFE000000 to 0xFFFFFFFF
Programming file C:\Users\MLHDV\Documents\u-boot-1.bin
Auto-detection is successful.
File is of type Binary/Raw Format.

Downloading Flash Device Driver ...
Reading flash ID ...
Auto-detection is successful.
File is of type Binary/Raw Format.

Downloading 0x00010000 bytes to be programmed at 0xFEF40000
Downloading 0x00010000 bytes to be programmed at 0xFEF50000
Downloading 0x00010000 bytes to be programmed at 0xFEF60000
Executing program ....
Executing program .....
Executing program ......
Executing program .......
Executing program ........
Executing program .........
Executing program ..........
Executing program ...........
Executing program ............
Executing program .............
Executing program ..............
Executing program ...............
Executing program ................
Executing program .................
Executing program ..................
Executing program ...................
Executing program ....................
Executing program .....................
Executing program ......................
Executing program .......................
Executing program ........................
Error: Program failed. Flash driver reports the following error(s): Timed Out. If you are trying to program a sector please make sure that the sector is erased.
Chip reported error during program. Please check that the sector you are programming is erased.

Error: Program failed. Flash driver reports the following error(s): Timed Out. If you are trying to program a sector please make
sure that the sector is erased.
Chip reported error during program. Please check that the sector you are programming is erased.

0 项奖励
回复

5,626 次查看
George_zheng
Contributor I

Hi YiPing,

I find ticket as below, it was similar question on p1010rdb board.

https://community.nxp.com/t5/CodeWarrior-Development-Tools/p1010-norflash-use-codewarrior-program/m-...

Does it have issue in int_core.tcl or not?

 

0 项奖励
回复

5,616 次查看
yipingwang
NXP TechSupport
NXP TechSupport

You need to modify "IFC controller timing configuration section " in C:\Freescale\CW_PA_v10.5.1\PA\PA_Support\Initialization_Files\QorIQ_P1\P1014RDB_init_sram.tcl according to your NOR flash datasheet, you could refer to P1010 reference manual.

#FTIM0_CS1
mem [CCSR 0x1E1F0] = 0x40050005
#FTIM1_CS1
mem [CCSR 0x1E1F4] = 0x1e000f00
#FTIM2_CS1
mem [CCSR 0x1E1F8] = 0x0410001c
#FTIM3_CS1
mem [CCSR 0x1E1FC] = 0x00000000

 

0 项奖励
回复

5,566 次查看
George_zheng
Contributor I

I Check S29GL256P data sheet, the timing was same with MX29GL256EH.

so I think the value should not need adjustment.

refer to section "110. Troubleshooting the Flash Programmer" in AppNote-FlashProgrammer-PowerArchitecture.pdf

to create check_flash.tcl and the content as below

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

# Set device to Read state
change p:fe000000 f0 8bit
# Get Mfg and Device ID values
change p:fe000555 aa 8bit
change p:fe0002aa 55 8bit
change p:fe000555 90 8bit
# Display Mfg ID value at offset
0# Display Dev ID value at offset 1
display p:fe000000..fe000002 8bit
# Reset device to Read state
change p:fe000000 f0 8bit

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

After connected the board I using source command in CSS console.

The console show as below, how to run the tcl?

(bin) 5 % source testid.tcl
invalid command name "change"

0 项奖励
回复

5,557 次查看
yipingwang
NXP TechSupport
NXP TechSupport

Please open debug shell console in CodeWarrior IDE from Window->Show View->Other->Debug->Debug shell, then type the following commands in the debug shell console.

# Set device to Read state
change p:fe000000 f0 8bit
# Get Mfg and Device ID values
change p:fe000555 aa 8bit
change p:fe0002aa 55 8bit
change p:fe000555 90 8bit
# Display Mfg ID value at offset
0# Display Dev ID value at offset 1
display p:fe000000..fe000002 8bit
# Reset device to Read state
change p:fe000000 f0 8bit

 

0 项奖励
回复

5,513 次查看
George_zheng
Contributor I

Hi YiPing,

I still can not falsh image to NOR flash(flash timeout), but the earse action was success.

We using 8bit NOR flash, and check P1014RDB-PB_init_sram.tcl

Is there have problem with the code as below?
How to print reg value when tcl init?

# configure IFC controller

# Autodetect CS routing based on ROM_LOC
# bits 4-7 - ROM_LOC
# 1000 8-bit NAND?12b page size
# 1001 8-bit NAND?K page size
# 1010 8-bit NAND?K page size
# 1011 8-bit NOR
# 1100 16-bit NAND?12b page size
# 1101 16-bit NAND?K page size
# 1110 16-bit NAND?K page size
# 1111 16b NOR

# boot location is NAND => NAND - cS0, NOR - CS1
if {($ROM_LOC >= 0x8 && $ROM_LOC <= 0xA) || (($ROM_LOC >= 0xC && $ROM_LOC <= 0xE))} {

###########################
# CS0 - NAND Flash settings

# AMASK0 64k NAND Flash buffer size
mem [CCSR 0x1E0A0] = 0xFFFF0000

# CSOR0
mem [CCSR 0x1E130] = 0x00800000

#FTIM0_CS0
mem [CCSR 0x1E1C0] = 0x020C0405
#FTIM1_CS0
mem [CCSR 0x1E1C4] = 0x1D1D070C
#FTIM2_CS0
mem [CCSR 0x1E1C8] = 0x0180280F
#FTIM3_CS0
mem [CCSR 0x1E1CC] = 0x04000000

# CSPR0
mem [CCSR 0x1E010] = 0xEFA00083

##########################
# CS1 - NOR Flash settings

# AMASK1 32M NOR
mem [CCSR 0x1E0AC] = 0xFE000000

# CSOR1
mem [CCSR 0x1E13C] = 0x0000E00C

#FTIM0_CS1
mem [CCSR 0x1E1F0] = 0x10010012
#FTIM1_CS1
mem [CCSR 0x1E1F4] = 0x22000B0B
#FTIM2_CS1
mem [CCSR 0x1E1F8] = 0x01102024
#FTIM3_CS1
mem [CCSR 0x1E1FC] = 0x00000000

# CSPR1
mem [CCSR 0x1E01C] = 0xFE000101

} else {

##########################
# CS0 - NOR Flash settings

# AMASK0 32M NOR
mem [CCSR 0x1E0A0] = 0xFE000000

# CSOR0
mem [CCSR 0x1E130] = 0x0000E00C

#FTIM0_CS0
mem [CCSR 0x1E1C0] = 0x10010012
#FTIM1_CS0
mem [CCSR 0x1E1C4] = 0x22000B0B
#FTIM2_CS0
mem [CCSR 0x1E1C8] = 0x01102024
#FTIM3_CS0
mem [CCSR 0x1E1CC] = 0x00000000


# CSPR0
mem [CCSR 0x1E010] = 0xFE000101

###########################
# CS1 - NAND Flash settings

# AMASK1 64k NAND Flash buffer size
mem [CCSR 0x1E0AC] = 0xFFFF0000

# CSOR1
mem [CCSR 0x1E13C] = 0x8180000C

#FTIM0_CS1
mem [CCSR 0x1E1F0] = 0x020C0405
#FTIM1_CS1
mem [CCSR 0x1E1F4] = 0x1D1D070C
#FTIM2_CS1
mem [CCSR 0x1E1F8] = 0x0180280F
#FTIM3_CS1
mem [CCSR 0x1E1FC] = 0x04000000

# CSPR1
mem [CCSR 0x1E01C] = 0xEFA00083
}

Are there other possible reasons for flash timeout?

0 项奖励
回复

5,506 次查看
yipingwang
NXP TechSupport
NXP TechSupport

BSC9131QDS also integrates JS28F256M29EWL, please refer to IFC NOR flash timing configuration section in C:\Freescale\CW_PA_v10.5.1\PA\PA_Support\Initialization_Files\Qonverge\BSC9131QDS_init_core.tcl


# FTIM0_CS0
mem [CCSR 0x1E1C0] = 0x1003000f
# FTIM1_CS0
mem [CCSR 0x1E1C4] = 0x1d000909
# FTIM2_CS0
mem [CCSR 0x1E1C8] = 0x01101c1e

0 项奖励
回复

5,498 次查看
George_zheng
Contributor I

Hi YiPing,

I using the same project and test 2 different custom board(just NOR flash different)

Refer to section "110. Troubleshooting the Flash Programmer" in AppNote-FlashProgrammer-PowerArchitecture.pdf and get the same manufacturer ID and device ID as below 

cmdwin::display p:fe000000..fe000002 8bit
fe000000 0x42 0xFB 0x50 B . P

But the NOR flash was different but get the same ID.

Where is the problem?

 

0 项奖励
回复

5,484 次查看
yipingwang
NXP TechSupport
NXP TechSupport

manufacturerid of MX29GL256EH is 0xC2

manufacturerid of JS28F256M29EWL is 0x89

It seems that the result is not correct for any NOR flash. 

Probably there is hardware problem with NOR read/write operation on your custom board, you could ask the hardware team to assist you to check the hardware design.

0 项奖励
回复