CodeWarrior Flash Programmer will not ERASE anymore!

cancel
Showing results for 
Search instead for 
Did you mean: 

CodeWarrior Flash Programmer will not ERASE anymore!

2,924 Views
hammer
Contributor I

Just recently, my CW Flash Programmer stopped working.  I erased and programmed a few months ago without any problems and now whenever I try to erase I receive "Erasing............" in the "Status" box (the dots just keep going on and on).  In the Flash Programmer log, the only information regarding the erase is ":------------------------------------" (at the top of the log).  Here is what I have:

- CodeWarrior 8.8 for Power Architecture

- CodeWarrior USB TAP (COP)
- Windows XP
- target processor is a MPC8272

Been programming with USB TAP on the MPC8272 for years.  I have no idea why I can no longer erase. Downloaded the 8.8.5 patch and that did not solve the problem.  I submitted a Service Request but nobody will answer it (SR 1-786420062).  I am dead in the water until this can get resolved.  Perhaps a Windows XP issue (MS patch update)? HELP!

Labels (1)
0 Kudos
4 Replies

565 Views
hammer
Contributor I

Here is some additional information:

I just realized the bottom of the Flash Programmer Log is the most up-to-date entry.  As I mentioned before, when I try to erase, the status bar indicates "Erasing..............................................." (dots continue).  If I let it sit for a few minutes, I will received "Error: Erase failied. See Details for additional information".  The Details additional information and the bottom of the log indicate the same thing -- "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".

I can perform the hardware diagnostics tests and the checksum tests fine.  Just can't erase the flash.

0 Kudos

565 Views
ronco
NXP Employee
NXP Employee

The usual causes for this problem are a) unstable target RAM, and b) improperly located Flash Programmer RAM Buffer.  Stable target RAM is configured by the Target Configuration file called out in the 'Target Configuration' panel.  And in this same panel is your definition for Target RAM Memory Buffer.  Make sure Buffer Address is set to 0x02000 to avoid conflict with the MPC8272's Exception Vector table, and the Buffer Size must be less than the maximum available RAM on your board.  Click on the 'Verify Target Memory Writes' option in this panel to ensure that all attempted Flash Programmer reads/writes are valid.

 

You can also try slowing the Interface Clock Speed on your USB TAP (Edit->Preferences->Remote Connections->CodeWarrior USB TAP.)  More troubleshooting tips are available in your copy of the "ANFlashProg.pdf" file in your C:\Program Files\Freescale\CodeWarrior PA V8.8\PowerPC_EABI_Tools\FlashProgrammer\Documentation  folder.

If this problem continues, try creating a new CodeWarrior project (File->New->EPPC New Project Wizard) and make sure you can debug it.

565 Views
mric
Contributor II

I am facing similar problem. I am trying to program a S29GL512N flash device interfaced to a MPC8347 custom board. I use a CodeWarrior USB TAP rev.A with CodeWarrior v8.8 running on Windows XP SP3. The board contains two S29GL512N11 modules (2x64MB) connected to the LBC/GPCM. Only CS0 is connected to the flash modules. CS0 goes through some SN74LVC chip to select which device to boot from. First flash module is mapped to 0xF8000000-0xFBFFFFFF and second one to 0xFC000000-0xFFFFFFFF. The flash already contains a valid u-boot (0xFFF00000) and linux kernel (0xF8000000). I am trying to flash new u-boot and debug it.

With CW flash programmer, I can read the device (verify, checksum), but I can't write (program). I either face:

  • "couldn't write flash driver to target, CCSProtocolPlugin: Error reading memory [SAP: corrupt read]" or
  • "couldn't write flash driver to target, CCSProtocolPlugin: Error writing memory [Invalid handle]" or
  • "target timed out"

When I uncheck "verify target writes", driver seems to be loaded correctly and status says "programming", but it never leaves this state (10 min). I get following log:

======================================================================
=== Execute: Program
=== Timestamp:  Thu Feb  6 10:45:28 2014
=== Flash Device:           S29GL512N
=== Flash Organization:   64Mx8x2
=== Flash Mem Start Addr: 0xF8000000
=== Flash Mem End Addr:   0xFFFFFFFF
======================================================================
Informing other connection clients that the target is being 'clobbered'.
Loading Flash Device Driver at: 0x00005000
Flash Driver Buffer is at:       0x00006DA0
Flash Driver Buffer Size is:     0x0000E260
Done

Initialization Command Succeeded

Programming 0x00010000 bytes of Target Memory at 0xFE300000

Program Command Cancelled

From CW flash programmer I select:

  • Processor family: 83xx
  • Target processor:  8347
  • Connection: USB TAP (CCS Remote Conn., port 41475, multi-core debugging, core index 0)
  • JTAG init file:
    E300 (1 1) (2 0x04040000) (3 0xA46A002)

I use following target init file:

# setMMRBaseAddr 0xFF400000
writereg     MBAR     0xFF400000

#################################
# Local Bus Local Access Windows
#################################

# WINDOW 1 - FLASH
writemem.l 0xff400028 0xF8000000 # LBLAWBAR1  - begining at 0xf8000000
writemem.l 0xff40002C 0x8000001A # LBLAWAR1   - enable, size = 128MB 

# WINDOW 3 - u-boot stack
writemem.l 0xff400038 0xe4000000 # LBLAWBAR3  - begining at 0xe4000000
writemem.l 0xff40003c 0x80000011 # LBLAWAR3   - enable, size = 256KB

# SICRL
# LDP_A = LDP[0-3]
writemem.l 0xff400114 0x80000000

# SICRH
# TSOBI1 = 1 output buffer for 40 Ohms, 3.3V
writemem.l 0xff400118 0x00000002

# Enable Core in ACR
#  COREDIS:0     cpu enabled,
#  PIPE_DEP:000  1 transaction
#  RPTCNT:000    1 transaction
#  APARK:00      park to master
#  PARKM:0000    e300 core
writemem.l 0xff400800 0x00000000

# machine check interrupts enable,
# floating-point enable,
# exception vectors at 0x0000_0000
writereg MSR 0x3000

# ACR - bits 10-11 should get a value different than '00'
# when the core is operating at below x2 of the system clock
ANDMem.l    0xff400800 0x00300000 

# prevent debugger to build stack trace after reset
writereg SP 0x0F

I must be doing something wrong, question is what? When flash driver cannot be loaded in DDR, I assume either I am trying to load it to the wrong place, either the DDR has not been initialized correctly.

I read ANFlashProg.pdf and successfully recovered manufacturer and device ID with following script. Problem here is the flash base address I put in this script is wrong. I put 0xFF80 although the flash starts at 0xF800. I tried with the right address, but either I get "read error" or read 0xFFFF instead of 0x227E. Does anyone have an idea what is happening here? Do you know how I can successfully program my flash device?

# change p:  
# Set device to Read state (reset?)
change p:FF800000 f0f0 16bit

# Get Mfg and Device ID values
change p:FF800AAA aaaa 16bit
change p:FF800554 5555 16bit
change p:FF800AAA 9090 16bit

# Display Mfg ID value at offset 0
# Display Dev ID value at offset 2
display p:FF800000..FF800004 16bit
#   ff800000 $0001 $227e

# Reset device to Read state
change p:FF800000 f0f0 16bit
0 Kudos

565 Views
mric
Contributor II

I found out my mistake: my target init file did not set up the DDR controller and local access windows. So I dropped 8349ITX_init_debug_uboot.cfg and adapted 8349ITX_rev3_init.cfg to fit my board instead.

Then my flash organisation was not fully supported by CW flash programmer. I had to use S29GL512N 32Mx16x1 flash device configuration, 0xF8000000 - 0xFBFFFFFF. To program my second flash, I had to change the address range to 0xFC000000 - 0xFFFFFFFF. This is not very convenient, but it works.