Flashing NOR image on P4080DS Using CodeWarrior 10.1.2 and SDK v1.2 Images

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

Flashing NOR image on P4080DS Using CodeWarrior 10.1.2 and SDK v1.2 Images

Jump to solution
5,640 Views
sethmacb
Contributor II

I have been having trouble with my P4080DS board and decided this morning to flash a U-boot image into the flash alt-bank to bring the u-boot up-to-date with v1.2 SDK.

 

I used the u-boot images supplied with the v1.2 SDK and followed the "Development Deployment" instructions in the QorID SDK Documentation.  After transfering the u-boot image (tftp), erasing the flash, and then writing to flash, I reset the board.  All seemed to go well, but the board has not responded over serial connection since.  I did this all to the alternate bank addrees (0xebf80000), which is even more confusing why the board is no longer responding.

 

Since my P4080DS was now now operational, I decided to download and install codewarrior (v10.1.2) in an attempt to use the USB TAP (REV G) to program the NOR flash with the 128MB image supplied on the SDK v1.2 iso.  I ended up installing CodeWarrior on Win XP because my normal development host (CentOS 6.2) does not seem to be supported.

 

I setup a "Power Architecture Project"

  • Processor: QorIQ_P4 -> P4080
  • Processing Model: AMP (one project per core )
  • Project Output: Application
  • Toolchain: Bareboard: GCC EABI e500mc
  • Language: C
  • Build Tools Arch: 32 bit
  • Floating Point: HW
  • Debugger Connection Type: HW
  • Core index: Core 0
  • New System: P4080DS, USB TAP
  • Trace Configuration: used default

I create a "Target Tasks"

  • Imported P4080DS_NOR_FLASH.xml from the CodeWarrior installation directory
  • Added a program/verify action
  • Used the QorIQ_SDK_V1.2_p4080DS_20120614_NOR_Flash_128M.bin file
  • File type:binary
  • Checked Erase sectors before program
  • Checked Restrict to Addresses in this Range (0xE8000000 to 0xEFFFFFFF)
  • Checked Apply Address offset
  • Added action.

I connected the USB tap to a powered off p4080ds and the PC.

I powered on the p4080ds

I execute the task. Failure.

 

The USB TAP's LEDs are as follows: tx/rx is flashing green, run/pause is solid red.

 

The error is not always the same if I try executing the task multiple times.   The most common error is failed to reset the target, core note responding.  Common errors are as follows.  I shortened the file path to only the file name.

 

fl::target -lc "FlashingROM-core0_ROM_P4080_Attach"
fl::target -b 0x2000 0x30000
fl::target -v off -l off
cmdwin::fl::device -d "S29GL01GP" -o "64Mx16x1" -a 0xe8000000 0xefffffff
cmdwin::fl::image -f "QorIQ_SDK_V1.2_P4080DS_20120614_NOR_Flash_128M.bin" -t "Binary/Raw Format" -re on -r 0xe8000000 0xefffffff -oe on -o 0xe8000000
cmdwin::fl::erase image
 Beginning Operation ...   
-------------------------
Performing target initialization ...   
Error:  Connect Failed.
Failed to reset the target
[CCS last error: p4080: Core not responding ](CCSProtocolPlugin)
Error: Connect Failed.

 

 

Another Errorfl::target -lc "FlashingROM-core0_ROM_P4080_Attach"
fl::target -b 0x2000 0x30000
fl::target -v off -l off
cmdwin::fl::device -d "S29GL01GP" -o "64Mx16x1" -a 0xe8000000 0xefffffff
cmdwin::fl::image -f "QorIQ_SDK_V1.2_P4080DS_20120614_NOR_Flash_128M.bin" -t "Binary/Raw Format" -re on -r 0xe8000000 0xefffffff -oe on -o 0xe8000000
cmdwin::fl::erase image
 Beginning Operation ...   
-------------------------
Performing target initialization ...   
 Downloading Flash Device Driver ...  
Error:  Couldn't write flash driver to target.  CCSProtocolPlugin : Error writing memory[CCS last error: Core not responding ]

 

 

I have updated the firmware on the USB TAP using the instructions in the USB TAP Users Guide.  Not the issue.

 

I have also tried both the "FlashROM-core_ROM_P4080_Attach" and "LC for Simple Flash" run configurations.  Not the issue. 

 

I have slowed down the JTAG frequency and disabled fast download... still the same problem.

 

What am I missing???

Labels (1)
1 Solution
1,788 Views
AlexP
NXP Employee
NXP Employee

The commands you show there look correct if your intent is to program the Flash for the alternate bank.

 

However, please note that if you are currently booted from the alternate bank, those commands will overwrite the main bank (bank 0) of Flash, and as such the board might behave strangely when booting from the main bank.

 

My suggestion is to try to boot your board from the alternate bank by using the DIP switches.  Please try setting the SW7[2] switch from OFF to ON.  This will cause the board to attempt to boot from bank 4 by default (and the "pixis altbank" u-boot command will also boot from bank 4; there's no easy command to boot from the main bank).

 

If this succeeds, you can use the u-boot commands that modify the alternate bank Flash locations to modify your main bank, and reset the board with SW7[2] = OFF to check your progress.

 

About the CodeWarrior issue:

 

I just installed CW 10.1.2 on Windows XP (32 bit) and did encounter the connection issue when I deleted the RCW from the board, but changing SW1[1] to ON did allow me to launch the default application, and after that use the Flash Programmer to put the RCW back.  After putting SW1[1] back to OFF the newly-written RCW was back and working correctly.  For completeness, the SW1 setting that allowed me to connect while the RCW had been deleted is 11101011 (with 1 = ON, 0 = OFF).

 

Can you please try disconnecting / reconnecting the USB TAP from your machine, and retry to debug?  If this fails, you should attempt to reinstall the USB TAP drivers; you will need Administrator privileges for this, and you should have the TAP unplugged from your machine.  Navigate to the CW installation directory, and from there to the ccs\drivers\usb directory.  You should launch an Administrator-level command prompt there, and follow the instructions in the readme.txt file.

View solution in original post

15 Replies
1,788 Views
gopikrishnan
Contributor III

For me rcw setting SW1[1:5] = 11000 worked. The default switch settings gave error "Core Not Responding".

Thanks Freescale Support Team.

0 Kudos
1,788 Views
sumanthmushiger
Contributor III

Hello Gopi,

Is there any way to flash ComE without using CW?

I am not allowed to use CW.

But I guess, I have corrupted NOR memory while trying to flash a wrong RCW. I wish to Flash default 128MB binary image using other methods, I have working JTEG Trace32 connected via Ethernet and an UART console.

I can use ethernet too if there is a way to do it via tftp.

And also I could only see, SW4-5-6-8-9-10 switches on the board, as you say they are located below the ComE module, will need to struggle a bit to access them, so can you tell me by default what will be their setting?

Thanks in advance,

0 Kudos
1,788 Views
admin
Specialist II

Hi sethmacb,

 

I see you are using the LC "FlashingROM-core0_ROM_P4080_Attach". You don't use that launch configuration, you should use another launch configurations to flash (eg: FlashingROM-core0_RAM_P3041_Attach, FlashingROM-core0_RAM_P3041_Download). Because ROM_ATTACH just attach to the target, not makes any initialization platform.

 

If this problem still reproduce then please re-check the connection from your machine to the board.

 

Regards,

Gia

0 Kudos
1,788 Views
sriniv
Contributor II

Can we use the same procedure for updating the U-boot on a 4080ComE board as well?

 

Thanks in advance for help

 

Srini

 

 

0 Kudos
1,788 Views
gopikrishnan
Contributor III

Hi Vasan,

    Found SW1 and SW2 just under the ComExpress module. Just remove the com express module and look underneath. Enable hard-coded RCW  using SW2[1]=ON. Now you can use your code warrior to flash your own *bin files. However it seems the board supports only old version of u-boot.

Cheers,

Gopi Krishnan S

0 Kudos
1,788 Views
gopikrishnan
Contributor III

I tried to locate SW1 on 4080ComE; but not found. As far as the RCW file is in NOR flash, uboot can be programmed using CodeWarrior. Also if you can see uboot from bank0 or bank4,(SW7[1:4] through bank0 to bank7) of NOR flash try same from UBOOT.

0 Kudos
1,788 Views
AlexP
NXP Employee
NXP Employee

Hello,

 

Are you able to debug the project you just created? To test: try debugging with Debug Configuration -> Download and see the "Core0: Welcome to CodeWarrior!" message on the console (after entering debug mode, press the Step Over button a few times to see the output).

 

If you are able to do that, try running the Target Task while connected (just after seeing the "Welcome to CodeWarrior!" message, press the Run button on the target task).

 

If entering debug mode does not work, there is a chance that you have deleted the reset configuration word (RCW), which normally resides at the beginning of Flash.  If that is the case, I suggest powering off your board, and switching SW1[1] from "OFF" to "ON"; this will make the board start with one of the predefined RCWs, and should allow you to enter debug (and also program the NOR flash).  Please remember to switch SW1[1] back to "OFF" when you are finished programming your Flash.

 

 

0 Kudos
1,788 Views
sethmacb
Contributor II

Thanks for the response.

 

I tried entering the debug mode for my "empty" project (empty besides the default BSP files of a new project) using both the <project>_RAM_P4080_Download and <project>_RAM_P4080_Cache_Download run configurations, using their corresponding default connections.  I also tried slowing down the JTAG clock speed of the corresponding connection.  Nothing ran.  I most often got this error:

 

Failed to resume target process., CCSProtocolPlugin: Failed to reset the target

[CCS last error: p4080: Core not responding]

 

I would happily export the diagnostics, an option of the dialog that pops up, but the host machine is offline and there is no chance of changing that in my work environment. 

 

 

So, I tried switching SW1[1] on like you suggested to use the hard encoded RCW.  I have verified prior to my first post that all other switches are in their default position given the information in the SDK v1.2 documentation. 

 

In this configuration, I still am not seeing any text on the serial port in my hyper-terminal.  I tried again debugging (as stated above) and flashing the NOR ROM.  Both gave the error response posted above.  The only other error I sometimes got was failure to initialize JTAG, which would occur after several failed attempts.  I could resolve the JTAG error by power cycling the p4080ds and USB tap.

 

Any other suggestions to try?  The work I was doing on the P4080DS was on my most pressing timeline and I am pressed to get the board back up and running ASAP.

 

 

Lastly, I would like to reiterate, this all started when flashing a new u-boot into the alternate bank using the commands from the SDK v1.2.  Here is a screen scrap (retyped here by hand so hopefully there are no typos) of the commands I used:

=> tftp 1000000 u-boot-P4080DS-git-r17.bin

=> erase ebf80000 ebffffff

=> cp.b 1000000 ebf80000 80000

=> reset

 

Since these commands, the system has not responded over hyperterminal and is the start of when I began trying to flash the ROM.

 

 

0 Kudos
1,789 Views
AlexP
NXP Employee
NXP Employee

The commands you show there look correct if your intent is to program the Flash for the alternate bank.

 

However, please note that if you are currently booted from the alternate bank, those commands will overwrite the main bank (bank 0) of Flash, and as such the board might behave strangely when booting from the main bank.

 

My suggestion is to try to boot your board from the alternate bank by using the DIP switches.  Please try setting the SW7[2] switch from OFF to ON.  This will cause the board to attempt to boot from bank 4 by default (and the "pixis altbank" u-boot command will also boot from bank 4; there's no easy command to boot from the main bank).

 

If this succeeds, you can use the u-boot commands that modify the alternate bank Flash locations to modify your main bank, and reset the board with SW7[2] = OFF to check your progress.

 

About the CodeWarrior issue:

 

I just installed CW 10.1.2 on Windows XP (32 bit) and did encounter the connection issue when I deleted the RCW from the board, but changing SW1[1] to ON did allow me to launch the default application, and after that use the Flash Programmer to put the RCW back.  After putting SW1[1] back to OFF the newly-written RCW was back and working correctly.  For completeness, the SW1 setting that allowed me to connect while the RCW had been deleted is 11101011 (with 1 = ON, 0 = OFF).

 

Can you please try disconnecting / reconnecting the USB TAP from your machine, and retry to debug?  If this fails, you should attempt to reinstall the USB TAP drivers; you will need Administrator privileges for this, and you should have the TAP unplugged from your machine.  Navigate to the CW installation directory, and from there to the ccs\drivers\usb directory.  You should launch an Administrator-level command prompt there, and follow the instructions in the readme.txt file.

1,788 Views
adrianteso
Contributor I

Hello,

I have some changes on the NOR flash and now I am trying to reset to the original Flash image but it returns me the following error:

fl::target -lc "LC for Simple Flash (2)"

fl::target -b 0x2000 0x30000

fl::target -v off -l off

cmdwin::fl::device -d "S29GL01GP" -o "64Mx16x1" -a 0xe8000000 0xefffffff

cmdwin::fl::erase all

Beginning Operation ...   

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

Performing target initialization ...   

Downloading Flash Device Driver ...  

Reading flash ID .......

Error:  The algorithm was not able to run on the target or the flash is not configured properly.

Error:  Getting flash ID failed

Error: The algorithm was not able to run on the target or the flash is not configured properly.

I switched the  SW1[1] to ON  and the problem is still there.

¿Could you please help me?

0 Kudos
1,788 Views
addiyi
NXP Employee
NXP Employee

First of all, please confirm if you are able to enter in debug using CW, after you switched SW1[1] to ON (this means that you are using hardcoded rcw in this moment).

One possibility, because of missing a valid rcw, is that ddr is not property initialize. You can try to use sram init (PA\PA_Support\Initialization_Files\QorIQ_P4\P4080DS_init_sram.tcl) as initialization file.

0 Kudos
1,788 Views
adrianteso
Contributor I

Hello again,

Thank you for your fast  aswer. I can debug with a new connection but now the program is not downloaded.

fl::target -lc "LC for Simple Flash (1)"

fl::target -b 0x2000 0x30000

fl::target -v off -l off

cmdwin::fl::device -d "S29GL01GP-Simics" -o "64Mx16x1" -a 0xe8000000 0xefffffff

cmdwin::fl::image -f "C:\\Users\\ateso\\workspace\\QorIQ_SDK_V1.2_P4080DS_20120614_NOR_Flash_128M.bin" -t "Auto Detect" -re on -r 0xe8000000 0xefffffff -oe off

cmdwin::fl::erase image

Beginning Operation ...   

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

Auto-detection is successful.  

  File is of type Binary/Raw Format.  

Image size is 0 bytes, nothing to erase.  

Nothing to erase.  No sectors selected

Performing target initialization ...   

Erase Command Succeeded.  

cmdwin::fl::write

Beginning Operation ...   

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

Using restricted address range 0xE8000000 to 0xEFFFFFFF  

Programming file C:\Users\ateso\workspace\QorIQ_SDK_V1.2_P4080DS_20120614_NOR_Flash_128M.bin  

Auto-detection is successful.  

  File is of type Binary/Raw Format.  

0 Bytes Programmed, Check Restricted Address Range  

Program Command Succeeded  

0 Kudos
1,788 Views
addiyi
NXP Employee
NXP Employee

Check the settings for Program / Verify Action. Make sure you have:

- selected "Erase sector before program";

- un-selected "Restrict to Address in this Range";

- selected "Apply Address Offset" and Address: 0xE8000000

0 Kudos
1,788 Views
adrianteso
Contributor I

OK it finally worked!!! Thanks for your help!!

0 Kudos
1,788 Views
sethmacb
Contributor II

As to the first part of your message, I would have never guessed to try booting into the alt-bank because I thought this is what I flashed when my problems started.  But as you said and I found in the SDK documentation:

 

Programming a new U-Boot

Typically, the system starts out after power on or after a hard reset to run an existing U-Boot in bank 0 in default. Please make sure to flash uboot in the alternate bank. Below are the flash steps: the correct flash address for alternate bank is 0xebf80000. If the current bank is the alternate bank, please use 0xeff80000 to flash new U-Boot.

 

I was in the alt-bank when I thought I had flashed the alt-bank, but I used the incorrect address.  Instead I had flashed bank 0 and something must have gone wrong with that flash.  After switching SW7[2] on, the system booted prooperly into the alt-bank and I was able to repair bank 0.

 

 

As far as the CodeWarrior issue. When I was trying to flash the ROM before the solution above, my switch SW1 settings were as you reported and still I had no luck.    I have not tried to run the default application using USB TAP and CodeWarrior yet since the above fix.  When I do, I will reinstall the USB TAP drivers if I have any issues before reopening this thread.

 

 

Thanks for all the help!

 

0 Kudos