AnsweredAssumed Answered

USB Stack v4.1.1  .LCF problem with MCF51JM128

Question asked by Adrian Bostan on Jul 16, 2013

There is a problem with MCF51jm128 mass storage HOST USB project.

 

The project is building correctly, no errors 'Finished building target: cfv1usbjm128.elf'.

 

If i debug the project,i hit run button, the code waits for USB stick to be plugged in, after i plugg in the USB stik, the program, goes in mcf_exception_handler -->"Illegal instruction" (this with CPUCR.IRD.bit =1) otherwise the mcu will reset itself.

 

Now, if use the flash programmer to write the code i receive a programming warning:

 

"Programming warning.  Can't program 512 bytes to address 0x803e00 because this range isn't included in the selected modules! "

 

I think is a problem with the Project.lcf file provided with freescale USB stack.

...........

MEMORY {

   code        (RX)  : ORIGIN = 0x00000410, LENGTH = 0x0001FBF0

   userram     (RWX) : ORIGIN = 0x00800000, LENGTH = 0x00003E00

   ram         (RWX) : ORIGIN = 0x00803E00, LENGTH = 0x00000200

}

...........

..........

.main_application_data :

    {

   __BDT_BASE = .;

        . = ALIGN(512);

        *(.usb_bdt)

        __BDT_END = .; 

    }>ram  

.............

...........................

Compiled with codewarrior 10.1. Same problem with codewarrior 10.4.

Board used: DEMOJM

 

Flash programmer console:

 

fl::target -lc "cfv1usbjm128 MCF51JM128_Internal_Flash"

fl::target -b 0x800000 0x4000

fl::target -v off -l off -ie on -i "" -p MCF51JM128

cmdwin::fl::device -d "MCF51JM128_FLASH" -o "128kx32x1" -a 0x0 0x1ffff

cmdwin::fl::erase all

Beginning Operation ...   

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

Initializing remote connection ...   

Performing target initialization ...   

Device MCF51JM128_FLASH   

Detect frequence ...  

Frequence 9779.96 Khz  

Erasing .............

Erase Command Succeeded.  

Device MCF51JM128_FLASH   

cmdwin::fl::image -f "C:\\Freescale\\Freescale USB Stack v4.1.1\\Source\\Host\\examples\\msd\\cw10\\cfv1usbjm128\\MCF51JM128_Internal_Flash\\cfv1usbjm128.elf" -t "Auto Detect" -re off -oe off

cmdwin::fl::write

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

Flash Operation.  ...

Device MCF51JM128_FLASH   

Programming ........

Programming warning.  Can't program 512 bytes to address 0x803e00 because this range isn't included in the selected modules!

Device MCF51JM128_FLASH   

Program Command Succeeded   

Flash Operation. done  

cmdwin::fl::verify

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

C:\Freescale\Freescale USB Stack v4.1.1\Source\Host\examples\msd\cw10\cfv1usbjm128\MCF51JM128_Internal_Flash\cfv1usbjm128.elf  

Flash Operation.  ...

Auto-detection is successful.  

  File is of type Elf Format.  

 

Device MCF51JM128_FLASH   

Error:  Verify Command Failed.

 

Error: command failed

 



Original Attachment has been moved to: Project.lcf.zip

Outcomes