How to support MultiBIN(BINFS) on SDMMC for Freescale IMX5x WinCE 6.0/7.0 BSP -blog archive

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to support MultiBIN(BINFS) on SDMMC for Freescale IMX5x WinCE 6.0/7.0 BSP -blog archive

10,767件の閲覧回数
qiang_li-mpu_se
NXP Employee
NXP Employee

    For MultiBIN system, the EBOOT don't need read the full NK from SDMMC card to memory for WinCE running. It just need to read the RAMIMAGE bin to memory for boot, and this bin is only 3MB, so it can reduce the WinCE boot time.

    The followed is the example to support MultiBIN on SDMMC device, as we know, for BINFS solution, the block device driver(sdmemory.dll) should be loaded by storage manager, but the original SDMMC driver architecture can't meet such requirement, so here we customerized the SDMMC driver for the boot ESDHC port.

    The followed is the pacth which can support both IMX51 and IMX50. Details please check the attached readme file.

 

For MultiBIN on NAND, please reference to

https://community.freescale.com/thread/280556

 

2013/04/27: added WinCE 7.0 support for iMX51 EVK and iMX53 SMD board, based on WCE700_MX53_ER_1105 and WCE700_MX51_ER_1106 BSP. BINFS for SDMMC WinCE7.zip

 

2013/05/06: missed "WINCE700\PLATFORM\iMX53_SMD\SRC\DRIVERS\PMIC\DA9052\FILES\DA9052.bib", which will get makeimg failure for iMX53 SMD. Please remove the followed red lines from DA9052.bib.

 

IF IMGMULTIXIP !
#define XIPKERNEL   NK
ENDIF IMGMULTIXIP !

IF IMGMULTIXIP
#define XIPKERNEL   XIPKERNEL
ENDIF IMGMULTIXIP

MODULES
;   Name                    Path                                    Memory Type
;   --------------          ----------------------------------      ------ ----


;------------------------------------------------------------------------------
; Device.exe drivers
;------------------------------------------------------------------------------

 

 

2013/05/07: How to use the cfimager.exe to burn the binfs image to SD card, the followed is the example for iMX51 EVK and iMX53 SMD, based on WinCE 7.0 BSP, the offset is same as ucl.xml in MFGTool.

 

For iMX51 EVK (Disk F is the SD card):

cfimager -f eboot.nb0 -d F -raw -offset 0x400

cfimager -f xip.nb0 -d F -raw -offset 0xA0400

 

For iMX53 SMD (Disk F is the SD card):

cfimager -f eboot.nb0 -d F -raw -offset 0x400

cfimager -f xip.nb0 -d F -raw -offset 0x120400

 

2014/07/16: Updated the WINCE600 patch for iMX51 EVK, WINCE600_ER1104_BINFS+HIVEREG+ROMFS_2014_07_16.zip, the followed is the update:

1. Sometimes in sdmemmain.cpp, function SMC_Init(), it will fail to get the card ready event from SDBUS driver, this will make boot up hang. Added a workaround to use watch dog service, if the failure happens, a watchdog reboot will happen. I think the sdhc + sdbus + sdmemory three drivers mode is not good for binfs solution, if there is a simple SDMMC disk driver, the issue should not happen. Unfuture, we don't have such a driver, so I used the watch dog reset workaround, it will increase about 1.2s boot up time when the issue happens.

 

2. Added SDHC DMA support and BSP_LOADDRIVER_LATER to load the USB driver later, the binfs system can boot into Wince desktop in 8 seconds.

 

3. Added clean boot menu in EBoot whcih can be used to clean the HIVE registry.

 

4. XIP.nb0 image size had been changed back to 94MB.


5. The same solution can be used in WinCE700 BSP, please do the porting by yourself.

Original Attachment has been moved to: README.txt.zip

Original Attachment has been moved to: Mfgtools-Rel-WCE600_11.04.00_update.zip

Original Attachment has been moved to: WINCE600_ER1104_BINFS+HIVEREG+ROMFS.zip

Original Attachment has been moved to: WINCE600_ER1104_BINFS.zip

Original Attachment has been moved to: BINFS-for-SDMMC-WinCE7.zip

Original Attachment has been moved to: WINCE600_ER1104_BINFS-HIVEREG-ROMFS_2014_07_16.zip

ラベル(3)
44 返答(返信)

4,034件の閲覧回数
courantcourant
Contributor I

Hello Qiang_FSL

I try to implement WinCE 7.0 Binfs on my i.MX53QSB. It can load XIPKERNEL, but system cannot boot to Desktop.

Attachments are my log, patch and ce.bib. 

Could you give me some advice?

Thank you~

0 件の賞賛
返信

4,034件の閲覧回数
KeshavaGN
Contributor V

Hi Qiang_FSL,

Can you please post OSDesign (or main SYSGEN and env variables need to be selected) for WEC7?

Thanks .

With regards,

Keshava

0 件の賞賛
返信

4,034件の閲覧回数
qiang_li-mpu_se
NXP Employee
NXP Employee

Hi Keshava, you can open "WINCE700_ER1105_BINFS.zipWINCE700\OSDesigns\iMX53_SMD_Mobility\iMX53_SMD_Mobility.sln" with VS2008, the catalog and env variables had already been included.

0 件の賞賛
返信

4,033件の閲覧回数
KeshavaGN
Contributor V

Hi Qiang_FSL ,

Sorry for the trouble. Now I'm able to load binfs_sdxxxx drivers. But i'm getting exception in binfs_sdbus.dll.

Below are the debug prints.

Can you give some ideas on this?

Windows CE Kernel for ARM (Thumb Enabled) Built on Mar 31 2014 at 17:35:09

ProcessorType=0c09  Revision=10 CpuId=0x412fc09a

OEMAddressTable = 80201424

Initializing VFP, FPSID=41033094

NKStartup done, starting up kernel. nCpus = 1

Windows CE KernelInit

Booting Windows CE version 7.00 for (ARM)

Memory Configuring: Total pages: 206549, Filesystem pages = 25818

Booting kernel with clean memory configuration:

Total Memory Sections:4

[0] (static): start: 80927000, extension/attributes: 0003e000, length: 0f6d5000

[1] (dynamic): start: 002d0000, extension/attributes: 00040800, length: 10000000

[2] (dynamic): start: 003d0000, extension/attributes: 00040800, length: 10000000

[3] (dynamic): start: 004d0000, extension/attributes: 0000c800, length: 03000000

Scheduling the first thread.

PID:00400002 TID:00410002 PGPOOL: Reserved 768 pages for Loader pool

PID:00400002 TID:00410002 PGPOOL: Reserved 256 pages for File pool

PID:00400002 TID:00410002 OSAXST0: Platform Name = i.MX6Q SABREAuto

PID:00400002 TID:00410002 OSAXST1: >>> Loading Module 'kd.dll' (0xC0801F30) at address 0xEFFE0000-0xEFFFE000 in Process 'NK.EXE' (0x80909AD0)

PID:00400002 TID:00410002 KD: Starting kernel debugger software probe (KdStub) - KD API version 27

PID:00400002 TID:00410002 OSAXST1: >>> Loading Module 'NK.EXE' (0x80909AD0) at address 0x80200000-0x80230000 in Process 'NK.EXE' (0x80909AD0)

PID:00400002 TID:00410002 Message Queue support initialized, g_hMsgQHeap = c48c0010

PID:00400002 TID:00500002 OSAXST1: >>> Loading Module 'filesys.dll' (0xC08027D4) at address 0xEFD10000-0xEFDD7000 in Process 'NK.EXE' (0x80909AD0)

PID:00400002 TID:00500002 OSAXST1: >>> Loading Module 'fsdmgr.dll' (0xC080290C) at address 0xEFC30000-0xEFC85000 in Process 'NK.EXE' (0x80909AD0)

PID:00400002 TID:00520002 FileSystem Starting - starting with clean file system

PID:00400002 TID:00520002 OSAXST1: >>> Loading Module 'romfsd.dll' (0xC0803000) at address 0xEFD00000-0xEFD07000 in Process 'NK.EXE' (0x80909AD0)

PID:00400002 TID:00520002 OSAXST1: >>> Loading Module 'binfs_sdmemory.dll' (0xC0805000) at address 0xEFB40000-0xEFB5B000 in Process 'NK.EXE' (0x80909AD0)

PID:00400002 TID:00520002 OSAXST1: >>> Loading Module 'binfs_sdbus.dll' (0xC0805138) at address 0xEFB60000-0xEFB9D000 in Process 'NK.EXE' (0x80909AD0)

PID:00400002 TID:00520002 OSAXST1: >>> Loading Module 'k.ceddk.dll' (0xC0805270) at address 0xEFC00000-0xEFC0E000 in Process 'NK.EXE' (0x80909AD0)

PID:00400002 TID:00520002 SDBusDriver: PROCESS_ATTACH

                                                      PID:00400002 TID:00520002 SDMemory: +SMC_Init

PID:00400002 TID:00520002 SDMemory: LoadDriver binfs_sdbus.dll.

PID:00400002 TID:00520002 SDMemory: Call SDC_Init(), hLoadDriver = 0xc0805138.

PID:00400002 TID:00520002 SDBusDriver: +SDC_Init

                                                PID:00400002 TID:00520002 SDBusDriver: Bus Driver instance created : 0xC4833AD0 ! -SDC_Init

                                                            PID:00400002 TID:00520002 SDMemory: LoadDriver binfs_usdhc.dll.

PID:00400002 TID:00520002 OSAXST1: >>> Loading Module 'binfs_usdhc.dll' (0xC0805700) at address 0xEFBA0000-0xEFBC1000 in Process 'NK.EXE' (0x80909AD0)

PID:00400002 TID:00520002 OSAXST1: >>> Loading Module 'cspddk.dll' (0xC0805838) at address 0xEFBD0000-0xEFBEF000 in Process 'NK.EXE' (0x80909AD0)

PID:00400002 TID:00520002 SDHCDGetHCFunctions: +Init

                                                    PID:00400002 TID:00520002 SDHCDGetHCFunctions: -Init

                        PID:00400002 TID:00520002 SDMemory: Call SHC_Init(), hLoadDriver = 0xc0805700.

PID:00400002 TID:00520002 SDHC +Init

                                    PID:00400002 TID:00520002 SDHC Active RegPath: Drivers\BlockDevice\USDHC

                             PID:00400002 TID:00520002 +CUSDHCBase::Init: Active RegPath: Drivers\BlockDevice\USDHC

PID:00400002 TID:00520002 Unknown: DEBUGCHK failed in file e:\wince700\platform\common\src\soc\common_fsl_v3\binfs_sdcard\sdbus\sdworki.cpp at line 101

  KdTrap: JIT debugging requested, waiting for OEM selection

  KdTrap: JIT debugging accepted

PID:00400002 TID:00520002 DEBUG_BREAK @efb91a28 Ignored.

PID:00400002 TID:00520002 m_dwVendorVersion=0x0

PID:00400002 TID:00520002 SlotpOptionHandler: Caps = 0x2001013c, HSS = 0x1

PID:00400002 TID:00520002 SDHCInitialize++

                                          PID:00400002 TID:00520002 CUSDHCBase::Start

PID:00400002 TID:00520002 CUSDHCBase::Start: PROCTL set value = 7000021

PID:00400002 TID:00520002 SDHC[3]: Using ADMA2

PID:00400002 TID:00520002 CUSDHCBase32BitADMA2:Create DMA Object for ADMA2

PID:00400002 TID:00520002 BspUSDHCInit==>

PID:00400002 TID:00520002 BspUSDHCInit1

PID:00400002 TID:00520002 sdhc3

PID:00400002 TID:00520002 SetClockRate - Requested Rate: 100000, Setting clock rate to 96679 Hz

PID:00400002 TID:00520002 SYSCTL 0x008E40FF

PID:00400002 TID:009D0002 SDHC[3] status did not change

PID:00400002 TID:00520002 SDHCInitialize--

                                          PID:00400002 TID:00520002 -CUSDHCBase::Init

PID:00400002 TID:00520002 SDHC -Init

                                    PID:00400002 TID:00520002 SDMemory: Load SDBUS driver Done.

PID:00400002 TID:00980002 CUSDHCBase::SetInterface: Setting for 1 bit mode

PID:00400002 TID:00980002 CUSDHCBase::SetInterface: PROCTL value = 0x7800021

PID:00400002 TID:00980002 SetClockRate - Requested Rate: 100000, Setting clock rate to 96679 Hz

PID:00400002 TID:00980002 SYSCTL 0x008E40FF

PID:00400002 TID:00980002 SDSetCardInterfaceForSlot - HC ClockRate differs desired setting: desired: 100000 Hz, Actual : 96679 Hz

                                                  PID:00400002 TID:00980002 HandleCommandErrors - STATUS ERROR BITS=0x00010000

                                              PID:00400002 TID:00980002 DumpCurrentRequest: 0xC4834494

                      PID:00400002 TID:00980002          Command: 5

                                                                   PID:00400002 TID:00980002     Argument: 0x00000000

                                     PID:00400002 TID:00980002   ResponseType: 5

                                                                                PID:00400002 TID:00980002        NumBlocks: 0

                                             PID:00400002 TID:00980002   BlockSize: 0

     PID:00400002 TID:00980002   HCParam: 0

                                           PID:00400002 TID:00980002 +DumpUSDHCRegs-------------------------

PID:00400002 TID:00980002 DSADDR 0x00000000

PID:00400002 TID:00980002 BLKATTR 0x00010200

PID:00400002 TID:00980002 CMDARG 0x00000000

PID:00400002 TID:00980002 XFERTYP 0x05020000

PID:00400002 TID:00980002 CMDRSP0 0x00000900

PID:00400002 TID:00980002 CMDRSP1 0x001D8A7F

PID:00400002 TID:00980002 CMDRSP2 0x325B5900

PID:00400002 TID:00980002 CMDRSP3 0x00000B00

PID:00400002 TID:00980002 PRSSTAT 0xFF8D8089

PID:00400002 TID:00980002 PROCTL 0x07800021

PID:00400002 TID:00980002 SYSCTL 0x008E40FF

PID:00400002 TID:00980002 IRQSTAT 0x00010000

PID:00400002 TID:00980002 AUTOC12ERR 0x00000000

PID:00400002 TID:00980002 HOSTCAPBLT 0x07F30000

PID:00400002 TID:00980002 WML 0x08800880

PID:00400002 TID:00980002 HOSTVER 0x00000003

PID:00400002 TID:00980002 -DumpUSDHCRegs-------------------------

PID:00400002 TID:00980002 HandleCommandErrors - Command line error (0x10000). Resetting CMD line.

PID:00400002 TID:00980002 SDSynchronousBusRequest_I: queue request failed(0xc0000014),TransferClass(2), CommandCode(5),CommandArgument(0)

PID:00400002 TID:00980002 HandleCommandErrors - STATUS ERROR BITS=0x00010000

                                                                            PID:00400002 TID:00980002 DumpCurrentRequest: 0xC4834494

                                                    PID:00400002 TID:00980002    Command: 1

           PID:00400002 TID:00980002     Argument: 0x400e0000

                                                             PID:00400002 TID:00980002   ResponseType: 4

                        PID:00400002 TID:00980002        NumBlocks: 0

                                                                     PID:00400002 TID:00980002   BlockSize: 0

                             PID:00400002 TID:00980002   HCParam: 0

                                                                   PID:00400002 TID:00980002 +DumpUSDHCRegs-------------------------

PID:00400002 TID:00980002 DSADDR 0x00000000

PID:00400002 TID:00980002 BLKATTR 0x00010200

PID:00400002 TID:00980002 CMDARG 0x400E0000

PID:00400002 TID:00980002 XFERTYP 0x01020000

PID:00400002 TID:00980002 CMDRSP0 0x00000900

PID:00400002 TID:00980002 CMDRSP1 0x001D8A7F

PID:00400002 TID:00980002 CMDRSP2 0x325B5900

PID:00400002 TID:00980002 CMDRSP3 0x00000B00

PID:00400002 TID:00980002 PRSSTAT 0xFF8D8089

PID:00400002 TID:00980002 PROCTL 0x07800021

PID:00400002 TID:00980002 SYSCTL 0x008E40FF

PID:00400002 TID:00980002 IRQSTAT 0x00010000

PID:00400002 TID:00980002 AUTOC12ERR 0x00000000

PID:00400002 TID:00980002 HOSTCAPBLT 0x07F30000

PID:00400002 TID:00980002 WML 0x08800880

PID:00400002 TID:00980002 HOSTVER 0x00000003

PID:00400002 TID:00980002 -DumpUSDHCRegs-------------------------

PID:00400002 TID:00980002 HandleCommandErrors - Command line error (0x10000). Resetting CMD line.

PID:00400002 TID:00980002 SDSynchronousBusRequest_I: queue request failed(0xc0000014),TransferClass(2), CommandCode(1),CommandArgument(400e0000)

PID:00400002 TID:00980002 SDBusDriver: The SDIO card does not support block mode.  Use Soft-Block instead.

                           PID:00400002 TID:00980002 CUSDHCBase::SetInterface: Setting for 4 bit mode

PID:00400002 TID:00980002 CUSDHCBase::SetInterface: PROCTL value = 0x7800023

PID:00400002 TID:00980002 SetClockRate - Requested Rate: 25000000, Setting clock rate to 24750000 Hz

PID:00400002 TID:00980002 SYSCTL 0x008E007F

PID:00400002 TID:00980002 SDSetCardInterfaceForSlot - HC ClockRate differs desired setting: desired: 25000000 Hz, Actual : 24750000 Hz

                                                       PID:00400002 TID:00980002 The clock rate is set to 24750000PID:00400002 TID:00980002 CUSDHCBase::SetInterface: Setting for 4 bit mode

PID:00400002 TID:00980002 CUSDHCBase::SetInterface: PROCTL value = 0x7800023

PID:00400002 TID:00980002 SetClockRate - Requested Rate: 24750000, Setting clock rate to 24750000 Hz

PID:00400002 TID:00980002 SYSCTL 0x008E040F

PID:00400002 TID:00980002 CUSDHCBase::SetInterface: Setting for 4 bit mode

PID:00400002 TID:00980002 CUSDHCBase::SetInterface: PROCTL value = 0x7800023

PID:00400002 TID:00980002 SetClockRate - Requested Rate: 50000000, Setting clock rate to 49500000 Hz

PID:00400002 TID:00980002 SYSCTL 0x008E003F

PID:00400002 TID:00980002 The clock rate is set to 50000000PID:00400002 TID:00980002 LoadDevice: type = 2, slot 0PID:00400002 TID:00980002 SDLoadDevice

PID:00400002 TID:00980002 SDLoadDevice no CUSTOM driver path was found so set the default path

PID:00400002 TID:00980002 SDLoadDevice Device_SD_Memory == m_DeviceType || Device_SD_Combo == m_DeviceType

PID:00400002 TID:00980002 SDLoadDevice SDLoadDevice Device_SD_Memory == m_DeviceType || Device_SD_Combo == m_DeviceType BSP_SUPPORT_MULTIBIN

PID:00400002 TID:00980002 Exception 'Data Abort' (0x4): Thread-Id=00980002(pth=c0806700), Proc-Id=00400002(pprc=80909ad0) 'NK.EXE', VM-active=00400002(pprc=80909ad0) 'NK.EXE'

PID:00400002 TID:00980002 PC=efe4db20(k.coredll.dll+0x0004db20) RA=efb94370(binfs_sdbus.dll+0x00034370) SP=ccb1f924, BVA=000000ac

PID:00400002 TID:00980002 RtlDispatchException: returning failure. Flags=0

  KdTrap: JIT debugging requested, waiting for OEM selection

  KdTrap: JIT debugging accepted

PID:00400002 TID:00980002

Unhandled exception c0000005:

PID:00400002 TID:00980002 Secondary thread in proc 00400002 faulted, Exception code = c0000005, Exception Address = efe4db20!

PID:00400002 TID:00980002 Terminating thread c0806700

Thanks & regards,

Keshava

0 件の賞賛
返信

4,034件の閲覧回数
qiang_li-mpu_se
NXP Employee
NXP Employee

You have the followed error messages in your log:

PID:00400002 TID:00520002 Unknown: DEBUGCHK failed in file e:\wince700\platform\common\src\soc\common_fsl_v3\binfs_sdcard\sdbus\sdworki.cpp at line 101

In my original code, line 101 of that file is just a comment "//  Input:  pMessage - message to post", it will not generate error, that means your code is not based on my code. It is strange, where do you got your code?

0 件の賞賛
返信

4,034件の閲覧回数
KeshavaGN
Contributor V

Hi Qiang_FSL ,

Thanks for reply.

Actually there is code difference because i cloned latest SDbus code from public and applied your patch (ie: only "BSP_SUPPORT_MULTIBIN" code).

And about the error you mentioned, in my case there is following statement,

BOOL CSDWorkItem::Init(DWORD  dwCeThreadPriority)

{

    BOOL bRet = FALSE;

    Lock();

    if  (

        m_psdSlotEvent  != NULL &&

        m_hWakeupEvent  != NULL &&

        m_hEmptySlotSem != NULL

        )

    {

        //If not initialized already initialize it

        if( m_bInitialized == FALSE)

        {

            m_dwCeThreadPriority = dwCeThreadPriority;

            CeSetPriority( (int)m_dwCeThreadPriority );

            ThreadStart();

            m_bInitialized = TRUE;

        }

        bRet = TRUE;

    }

    ASSERT(FALSE);

    Unlock();

    return bRet;

   

}

ASSERT(FALSE); which will end up in DBGCHK fail which is expected (i guess). I don't know why assert(false); is added here. It is there in public code.

And, can you please confirm, whether xip.nb0 is the complete OS?? or we need to use NK.nb0 ?? If yes, how? If no, whether I should add all the dlls in XIP region?? Please clarify..

Thanks & regards,

Keshava

0 件の賞賛
返信

4,034件の閲覧回数
KeshavaGN
Contributor V

Also, I'm implementing on imx6q...

0 件の賞賛
返信

4,034件の閲覧回数
holyyuan
Contributor II
0 件の賞賛
返信

4,034件の閲覧回数
holyyuan
Contributor II
0 件の賞賛
返信

4,033件の閲覧回数
holyyuan
Contributor II
0 件の賞賛
返信

4,033件の閲覧回数
holyyuan
Contributor II
0 件の賞賛
返信

4,034件の閲覧回数
KeshavaGN
Contributor V

Also, One more doubt is that how to flash NK etc . , and how this binary is loaded? Thanks

0 件の賞賛
返信

4,033件の閲覧回数
holyyuan
Contributor II
0 件の賞賛
返信

4,034件の閲覧回数
KeshavaGN
Contributor V

Oh Sorry, I didn't noticed this folder.

Thanks Qiang_FSL for support

0 件の賞賛
返信

4,034件の閲覧回数
holyyuan
Contributor II
0 件の賞賛
返信

4,034件の閲覧回数
holyyuan
Contributor II
0 件の賞賛
返信

4,034件の閲覧回数
holyyuan
Contributor II
0 件の賞賛
返信

4,034件の閲覧回数
pawel
Contributor II

Link for NAND implementation is not working/ not available. Could you please, upload it somewhere else?

0 件の賞賛
返信

4,034件の閲覧回数
qiang_li-mpu_se
NXP Employee
NXP Employee
0 件の賞賛
返信

4,034件の閲覧回数
holyyuan
Contributor II

Hi Qiang,

  I find the final problem is lie in the directory:"F:\WINCE700\platform\common\src\soc\COMMON_FSL_V3"\BINFS_SDCARD\", in this directory,I run "build -c", it will reminding" Build Failed". but when " build -c"(rebuild) its four sub-directories in order,every directory build succeed. Everytime I rebuild the "BINFS_SDCARD" directory, it will remind "build faied". So, what is the problem? I check the dirs file in BINFS_SDCARD is OK. Now,I really don't know how to do next.

The BINFS_SDCARD and its source code is in the attachment!

Might you share your experience in this point  for winCE7 IMX53 platform?

Thanks a lot!

Best regard

0 件の賞賛
返信