I'm working on a custom board based upon LS1021A-TWR board. I'm having problem programming the rcw_1000.bin file to the NOR flash.
The design is kept very close to LS1021A-TWR board with a few changes:
I'm using CodeWarrior Development Studio for QorIQ LS series - ARM V7 ISA Version: 10.0.7 Build Id:150825 along with CodeWarrior TAP (Ethernet).
Here is what I have so far working:
1. I can build a bareboard project using the CodeWarrior Bareboard Project Wizard, get connected to the target device and debug the project. This allows me to see all the registers and use the Debugger Shell.
2. In the Debugger Shell, I can manually read the NOR Flash manufacturer ID and device ID, using Listing 17 commands in AN4349 Adding Device(s) to the CodeWarrior™ Flash Programmer for ARM™ V7 which gives me the following results:
Debugger Shell |
---|
CodeWarrior Debugger Shell v1.0 %>source /home/qoriqsdk/Desktop/ReadID.tcl cmdwin::change p:60000000 f0f0 16bit cmdwin::change p:60000aaa aaaa 16bit cmdwin::change p:60000554 5555 16bit cmdwin::change p:60000aaa 9090 16bit cmdwin::display p:60000000..60000004 16bit 60000000 0x0001 0x227E 0x0000 .. "~ .. cmdwin::change p:60000000 f0f0 16bit |
Which are correct manufacturer ID and device ID based upon S29GL512N datasheet (LINK)
So I know the read/write functionality to the NOR flash is working.
I can also use the Target Tasks to import LS102xATWR_NOR_FLASH task and successfully run erase and blank check tasks on the NOR flash, but the program/verify task fails:
Here is the detail settings for the Erase/Program/Verify action:
And the error that I get in the flash programmer console is shown here:
Flash Programmer Console |
---|
fl::target -lc "Power1021Bare-core0_RAM_LS1021ATWR_Download" fl::target -b 0x10000000 0x20000 fl::target -v off -l off cmdwin::fl::device -d "JS28F00AM29EWHA" -o "64Mx16x1" -a 0x60000000 0x67ffffff 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 0x60000000 to 0x6001FFFF Erasing ... Erase Command Succeeded cmdwin::fl::device -sd all cmdwin::fl::device -se 0 cmdwin::fl::blankcheck list Beginning Operation ... ------------------------- Downloading Flash Utility Driver ... Performing Blank Check from 0x60000000 to 0x6001FFFF ... Blank Checking ... Blank Check Succeeded Blank Check Completed Successfully cmdwin::fl::image -f "/home/qoriqsdk/QorIQ-SDK-V1.9-20151210-yocto/build_ls1021atwr/tmp/deploy/images/ls1021atwr/rcw/ls1021atwr/RSR_PPS_70/rcw_1000.bin" -t "Binary/Raw Format" -re off -oe on -o 0x60000000 cmdwin::fl::erase image Beginning Operation ... ------------------------- Downloading Flash Device Driver ... Reading flash ID ... Error: Failed reading return status. Can not read target memory at location: 0x000000001000000C.Please make sure that the chip selects are properly configured. The CWPP response code is: CCSProtocolPlugin : CCS: Scan timeout. Error: Getting flash ID failed Error: Failed reading return status.Can not read target memory at location: 0x000000001000000C. Please make sure that the chip selects are properly configured. The CWPP response code is: CCSProtocolPlugin : CCS: Scan timeout. |
I'm not sure how to resolve this issue. Any help would be greatly appreciated.
Solved! Go to Solution.
Hello Sina Sattari,
According to your log, it looks that there is problem in the DDR controller configuration section in the initialization file. I suggest you use OCRAM on the target to execute flash programmer algorithm. When you create a bare board project, please select "Download OCRAM" or “Connect OCRAM" Launch configuration in "Debug Target Settings" panel, then use OCRAM launch configuration to connect to the target board to download the Flash Device Driver to OCRAM. This method would help you to avoid using DDR memory to overcome the problem which you are encountering.
Have a great day,
Yiping
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Thank you Yiping and Adrian I was able to get the NOR flash programmed. Here are the exact steps I took:
1. Power up the board with the CPLD setting the IFC_AD[15:8] lines to 8'b01110010; This will tell the CPU that hardcoded RCW is disabled and prevents the power up sequence from trying to access the NOR flash. (I did this using an input flag to the CPLD equivalent to SW2[2])
2. In the CodeWarrior, start a new BareBoard project and select the Connect OCRAM as Launch mode for the target settings:
3. Build the project.
4. Start the debug process by clicking the debug button in the debug configuration window accessible under RUN menu.
5. After the Debug process started with successful connection to the board, click the resume button so the code is executed:
Steps 6 to 9 can be completed in advance or once, before debug session is started. For reuse of the method, these steps can be skipped if target task is already setup.
6. In the Target Tasks window, add a new task under Root with task type set to ARM Flash Programmer and Active Debug Context as its Run Configuration.
7. Add the NOR device ( I had to make a new XML file for our NOR flash as CodeWarrior did not have the one we had used and add it to the product-manifest.xml file also. Follow the instructions in AN4349 Adding Device(s) to the CodeWarrior™ Flash Programmer for ARM™ V7
8. Set the correct base address for the NOR flash and Target RAM address and size ( based upon the SDK documentation section: Deployment Guide>Boards>LS1021ATWR>System Memory Map). Note that the RAM size has to set to 64K since only one of the cores will be active.
9. Add flash programmer actions of Erase, Program and Verify for RCW and U-boot from the SDK or based upon QorIQ Configurator at proper offset on the NOR flash ( based upon the SDK documentation section: Deployment Guide>Boards>LS1021ATWR>Flash Bank Usage).
10. Click the Execute button in the Target Tasks window:
and the flash will be programmed:
Flash Programmer Console |
---|
fl::target -lc "Power1021Bare_OCRAM_Connect-core0_OCRAM_LS1021ATWR_Connect" fl::target -b 0x10000000 0x10000 fl::target -v off -l off cmdwin::fl::device -d "S29GL512N" -o "32Mx16x1" -a 0x60000000 0x63ffffff cmdwin::fl::image -f "/home/qoriqsdk/workspace/Power1021_Config3/Generated_Code/PBL.bin" -t "Binary/Raw Format" -re off -oe on -o 0x60000000 cmdwin::fl::erase image Beginning Operation ... ------------------------- Performing target initialization ... Downloading Flash Device Driver ... Reading flash ID ... Erasing Sector 0x60000000 to 0x6001FFFF Erasing ... Erase Command Succeeded cmdwin::fl::write verify Beginning Operation ... ------------------------- Programming file /home/qoriqsdk/workspace/Power1021_Config3/Generated_Code/PBL.bin Downloading Flash Device Driver ... Reading flash ID ... Downloading 0x00000070 bytes to be programmed at 0x60000000 Executing program with verify .... Program with Verify Command Succeeded cmdwin::fl::image -f "/home/qoriqsdk/QorIQ-SDK-V1.9-20151210-yocto/build_ls1021atwr/tmp/deploy/images/ls1021atwr/u-boot-ls1021atwr.bin" -t "Binary/Raw Format" -re off -oe on -o 0x60100000 cmdwin::fl::erase image Beginning Operation ... ------------------------- Downloading Flash Device Driver ... Reading flash ID ... Erasing Sector 0x60100000 to 0x6011FFFF Erasing Sector 0x60120000 to 0x6013FFFF Erasing Sector 0x60140000 to 0x6015FFFF Erasing Sector 0x60160000 to 0x6017FFFF Erasing .... Erase Command Succeeded cmdwin::fl::write verify Beginning Operation ... ------------------------- Programming file /home/qoriqsdk/QorIQ-SDK-V1.9-20151210-yocto/build_ls1021atwr/tmp/deploy/images/ls1021atwr/u-boot-ls1021atwr.bin
Downloading Flash Device Driver ... Reading flash ID ... Downloading 0x0000D5C4 bytes to be programmed at 0x60100000 Executing program with verify .... Program with Verify Command Succeeded Downloading 0x00002A3C bytes to be programmed at 0x6010D5C4 Executing program with verify .... Program with Verify Command Succeeded Downloading 0x0000D5C4 bytes to be programmed at 0x60110000 Executing program with verify .... Program with Verify Command Succeeded Downloading 0x00002A3C bytes to be programmed at 0x6011D5C4 Executing program with verify .... Program with Verify Command Succeeded Downloading 0x0000D5C4 bytes to be programmed at 0x60120000 Executing program with verify .... Program with Verify Command Succeeded Downloading 0x00002A3C bytes to be programmed at 0x6012D5C4 Executing program with verify .... Program with Verify Command Succeeded Downloading 0x0000D5C4 bytes to be programmed at 0x60130000 Executing program with verify .... Program with Verify Command Succeeded Downloading 0x00002A3C bytes to be programmed at 0x6013D5C4 Executing program with verify .... Program with Verify Command Succeeded Downloading 0x0000D5C4 bytes to be programmed at 0x60140000 Executing program with verify .... Program with Verify Command Succeeded Downloading 0x00002A3C bytes to be programmed at 0x6014D5C4 Executing program with verify .... Program with Verify Command Succeeded Downloading 0x0000D5C4 bytes to be programmed at 0x60150000 Executing program with verify .... Program with Verify Command Succeeded Downloading 0x00002A3C bytes to be programmed at 0x6015D5C4 Executing program with verify .... Program with Verify Command Succeeded Downloading 0x0000721C bytes to be programmed at 0x60160000 Executing program with verify .... Program with Verify Command Succeeded |
Check the init for DDR and OCRAM, and use as Target RAM address in LS102xATWR_NOR_FLASH task the correct address for OCRAM or DDR.
Adrian
Thank you Adrian. I was able to follow Yiping and your instructions to get the NOR flash programmed. My target RAM address was correct (0x10000000 for the OCRAM) but the target RAM size was not correct. Since only one of the cores is being used, I can only use OCRAM0 for which the size is only 64K (0x10000) and not 128K (0x20000) as the documentation points to. I'll post my final results here.
Hello Sina Sattari,
According to your log, it looks that there is problem in the DDR controller configuration section in the initialization file. I suggest you use OCRAM on the target to execute flash programmer algorithm. When you create a bare board project, please select "Download OCRAM" or “Connect OCRAM" Launch configuration in "Debug Target Settings" panel, then use OCRAM launch configuration to connect to the target board to download the Flash Device Driver to OCRAM. This method would help you to avoid using DDR memory to overcome the problem which you are encountering.
Have a great day,
Yiping
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Thank you Yiping. I was Download as the Launch for the Target Setting in the Bareboard project wizard. As you mentioned I had to use the Connect OCRAM since my DDR is not initialized at this point.