Loading image to NAND in imx28

cancel
Showing results for 
Search instead for 
Did you mean: 

Loading image to NAND in imx28

565 Views
shany
Contributor II

Hello,

I'm trying to load an image to NAND  in imx28.

In the function -

OEMVerifyMemory(DWORD dwStartAddr, DWORD dwLength)

[PLATFORM\iMX28-EVK-PDK1_9\SRC\BOOTLOADER\COMMON\main.c]

The addresses parameters are: dwStartAddr = 0x87F00000,

dwPhysVerifyStart = 0x47F00000, length = 0xF971140.

These addresses will result in loading image to SD in the following values -

KITLOutputDebugString("INFO: Downloading NK SD/MMC image.\r\n");

g_ImageType = IMAGE_TYPE_NK;

g_ImageMemory = IMAGE_MEMORY_SD;

My question is this - if I want to change the load to NAND instead of SD, the addresses have to be changed. I don't understand entirely why there values are the way they are and where exactly they are set (the dwStartAddr).  

If I insert the following code at the top of this function - OEMVerifyMemory(DWORD dwStartAddr, DWORD dwLength):

DWORD* pdwStartAddr = &dwStartAddr;

dwPhysVerifyStart = IMAGE_BOOT_NKIMAGE_NAND_PA_START;

dwPhysVerifyEnd = dwPhysVerifyStart + dwLength - 1;

pdwStartAddr = OALPAtoCA(dwPhysVerifyStart);

dwStartAddr = *pdwStartAddr;

 

Now I see that the flash is indeed programmed, however, when reset - nothing happens, the system isn't re-boot as if there is nothing in the NAND.

 

Am I doing this procedure correctly?

Thanks

Shany, 

0 Kudos
5 Replies

76 Views
shany
Contributor II


Hello,

I've tried what you've suggested - change the imge file from nk.bin to nk.nb0.

This is the data recieved in the debug port (right after I selected "D", download image, in the boot menu -

INFO: Storing boot configuration to NAND block [0x20A].

INFO: Successfully store boot configuration to NAND!

+InitSpecifiedEthDevice

INFO: Trying to initialize USB RNDIS...

INFO: MAC address: 0-11-22-33-44-0

HostMiniInit:: !!

Rndis:: initialization: with addr=0

Rndis:: Address static map to addr=A8000000

Rndis:: initialization!

Rndis:: PDDInit Success!

Rndis:: Get MAC address 1104,3322,44

RndisMdd:: PDD's max RX buffer = [8192] bytes.

Rndis:: initialization: Success

HostMini:: New filter set: [0x0] --> [0xB]

INFO: MAC address: 4-11-22-33-44-0

-BLMenu .

INFO: Using device name: 'MX2817408'

+EbootSendBootmeAndWaitForTftp

Sent BOOTME to 255.255.255.255

Packet has the following data:

boot.bin[NULL]octet[NULL]

TFTP packet could have 1 name/value pairs

Locked Down Link 1

Src IP 192.168.0.1 Port 03D4 Dest IP 192.168.0.2 Port 086A

Default TFTP block size set to: 512 bytes

There were no options detected in the TFTP

EthDown::TFTPD_OPEN::boot.bin

-EbootSendBootmeAndWaitForTftp

BL_DOWNLOAD

BL_IMAGE_TYPE_MANIFEST

Packet has the following data:

boot.bin[NULL]octet[NULL]

TFTP packet could have 1 name/value pairs

Locked Down Link 1

Src IP 192.168.0.1 Port 03D4 Dest IP 192.168.0.2 Port 086B

Default TFTP block size set to: 512 bytes

There were no options detected in the TFTP

EthDown::TFTPD_OPEN::boot.bin

BL_IMAGE_TYPE_UNKNOWN

INFO: OEMMultiBINNotify (dwNumRegions = 1, dwRegionStart = 0x0).

Specify destination for NK NB0 [0 = RAM, 1 = NAND, 2 = SD/MMC]:

INFO: NK NB0 remapped to 0x84200000.

INFO: OEMVerifyMemory (CA = 0x84200000, PA = 0x44200000, length = 0x1E00000)

INFO: Downloading NK NAND image.

TFTP: Desktop losing ACK, block number = 2, Ack again

TFTP: Desktop losing ACK, block number = 2, Ack again

1

ImageStart = 0x84200000, ImageLength = 0x1E00000, LaunchAddr = 0x84200000

Completed file(s):

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

[0]: Address=0x84200000 Length=0x1E00000 Name="nk.nb0" Target=FLASH

WARNING: Flash update requested.

Do you want to continue (y/n)?

 

When I'm pressing on "y", I see that the Nand flash is being programmed. However, after reset - the system still doesn't reboot !

Any ideas?

Thanks,

Shany

0 Kudos

76 Views
shany
Contributor II

Hello,

Am I suppose to change something in oemaddrtab_cfg.inc ? [WINCE600PLATFORM\iMX28-EVK-PDK1_9\SRC\INC]

in the g_oalAddressTable?

For now - this is the g_oalAddressTable (by BSP's definitions - I haven't touched them so far) -

g_oalAddressTable

DCD 0x90000000, 0x80000000, 1

DCD 0x90100000, 0x60000000, 1 ; SPI NOR flash

DCD 0x80000000, 0x40000000, 128 ; RAM image mapping

DCD 0x88000000, 0x00000000, 1 ; On-chip RAM

DCD 0x00000000, 0x00000000, 0 ; Terminate table

 

According to what I've read on the internet - there supposed to be a region for NANDIMAGE for the eboot to download the image to NAND flash.

Am I suppose to change this table? And how ?

Thanks alot,

Shany  

0 Kudos

76 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

If you are based on the Freescale default BSP, the modification should be OK from SDMMC to NAND. Maybe you had changed some other codes which caused such result.

Any way, another choice, in platform buider setting, you can select the image file from "nk.bin" to "nk.nb0", the default image file is "nk.bin", for "nk.nb0", you need key in it. Then when Eboot received the image file, it will let you select for SDMMC or NAND from debug serial port.



shany cohen said:

Hello,

Thanks alot for yur response!

I'm sorry for my ignorance but canou please instruct men how to change this parameter ?

What I did was this:

I openned the project's properties (I'm working with WINCE6, Visual Studio 2005) in the "project" tab ->configuration properties -> Environment and changed the IMGSDMMC = 0, IMGNAND = 1.

Then, I build the project again and run it.

The outcome is the same - the debug port writes - "INFO: Downloading NK SD/MMC image".

Am I changing these parameters's values correctly?

Thanks,

Shany 

0 Kudos

76 Views
shany
Contributor II

Hello,

Thanks alot for yur response!

I'm sorry for my ignorance but canou please instruct men how to change this parameter ?

What I did was this:

I openned the project's properties (I'm working with WINCE6, Visual Studio 2005) in the "project" tab ->configuration properties -> Environment and changed the IMGSDMMC = 0, IMGNAND = 1.

Then, I build the project again and run it.

The outcome is the same - the debug port writes - "INFO: Downloading NK SD/MMC image".

Am I changing these parameters's values correctly?

Thanks,

Shany 

0 Kudos

76 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

The default BSP had already support NAND, you just need replace the platform buider parameter "IMGSDMMC" with "IMGNAND". You don't need modify that source code.

With the different IMG setting, the built out BIN image files will show different base address. Then EBoot will know it is for NAND or for SDMMC. You can reference to config.bib:

IF IMGNAND
; ROMOFFSET = (FLASH_PHYSICAL_ADDRESS - ROMSTART) % 0x100000000
; = (0x84200000 - 0x80200000) % 0x10000000 = 4200000
ROMOFFSET=4200000
ENDIF
IF IMGSDMMC
; ROMOFFSET = (FLASH PHYSICAL ADDRESS - ULDR_PHSYICAL_START) % 0x100000000
; = ( 0x87F00000 - 0x80200000 ) % 0x10000000 = 7D00000
ROMOFFSET=7d00000
ENDIF

0 Kudos