Re: How to use visionClick to program MPC555 shadow and boot from internal flash?

David Wybo <[email protected]>
Newsgroups gmane.comp.hardware.motorola.microcontrollers
Organization RealTime Consultants, Inc.
Message-ID <[email protected]>
You need to think about this as two separate steps. Think of the shadow 
flash as a separate flash array. So, you need to program the main flash 
array with your program and then program the shadow flash.

Here is how I do it. I set up a REG file to configure the target the way 
I want. I then set up a second REG file that is just a copy of the first 
one, except the CMFMCR bit is configured to shadow flash.

I then program the main flash with my executable program, using the REG 
file with VisionCLick that uses the main flash array. Then I invoke 
VisionCLick again, only this time I program a special BIN file 
containing only 256 bytes (size of shadow flash) and has the proper 
value for my reset config word in it. I use the second REG file above 
with VisionCLick to do this programming.

Additionally, when I build my executable program, I know whether I am 
building to run out of internal flash, external flash, or RAM, so I have 
my initialization code written to use global symbols as the values to 
program the CS registers. THese global symbols are defined in one of 
three linker command files, and I choose the appropriate linker command 
file based on where I want the code to run.

This way, I can have a makefile that I run and all I need to tell it is 
where I want the code to execute, iflash, xflash, or ram. The 
appropriate linker command file is used for linking, so the memory maps 
are correct, the CS registers are programmed properly, and the rest of 
the application does not need to change. The makefile then determines if 
the shadow flash needs to be programmed and does the proper flashing steps.

I hope this helps you.

wupegasus wrote:

>In last few days I have asked some question about my MPC555 board 
>and Many kindhearted men have helped me! Thank all!
>  Now I think My board is ok and the problen is that: I do not 
>program the Shadow as someone told me!
> HereI describe the problem again and wish someone who familiar the 
>visionClick and MPC555 can help me about this!
>
>  My MPC555 development platform inlude: Tornado for OSEKWorks, 
>Visionprobe II, VisionClick 7.10. 
>     Now I meet some problems in developing the minimum mpc555 
>system, that is : I do not extend the Data bus out and let the 
>RSTCONF* connectted to the SRESET*, still I wish the cpu would read 
>the reset configuration word form the shadow, not the Data bus, and 
>then boot from the internal flash.
>   
>   Usually, in my former board, I have extend the databus and make 
>the CPU read the reset configuration word for Databus. So I need not 
>burn the shadow. After I finished the programming in the  Tornado, 
>I   will do the following steps to make it boot from internal board:
>
>1¡£Make the project in Tornado and then get the *.elf file 
>2. Use the "convert" tools to convert the  *.elf to *.bin
>3. Use "mpc555fc.exe" to produce  the special *.bin(449k)
>4. Use the program the flash tool : Select the ¡°00: MPC555 K1,2,3,M 
>( 448 x 8 ) 1 Device¡± Driver.
>5. set internal RAM workspace starting at 0x003F9800.
>6.Set physical flash Base Address to 0x0*.
>7.Click on ¡°Erase-only¡±. This will erase BOTH Shadow and Main 
>Arrays.
>8.Program data into Main array (448K-bytes,)
>
>After these, my board will read the RCW form the Data bus and then 
>boot from the internal flash when power on or reset. All these are 
>ok for my applications.
>
>Now I think I need not extend the Data bus out and let the RSTCONF* 
>connectted to the SRESET*. I wish the cpu would read the reset 
>configuration word form the shadow, but not the Data bus, and then 
>boot from the internal flash when power on or reset..
>
>   I have read the Application Note-AN-0043, and iact  as follows:
>     
>1  Select the ¡°00: MPC555 K1,2,3,M ( 448 x 8 ) 1 Device¡± Driver.
>2  Use internal RAM workspace starting at 0x003F9800.
>3  Set physical flash Base Address to 0x0*.
>4  Run any target prerequisite programs/scripts, e.g. enable VPP, 
>and force Sys. Clock to 40MHz(4*10,My MF is 9) etc.
>5  Click on ¡°Erase-only¡±. This will erase BOTH Shadow and Main 
>Arrays.
>6 manually set CMFMCR_A SIE bit to¡°1¡± in the register .
>7 Program data into Shadow array (256 bytes) (I do not kown how to 
>prepare the *.bin for the shadow!!!! So i juast use your dSample 
>test files ¡°256_shdw.bin¡± )
>8   After completion, return the CMFMCR_A SIE bit to ¡°0¡± .
>9  Program data into Main array (448K-bytes,) ( the same pragram for 
>former board ) 
>   And then remove the Probe. when power on, the board should read 
>the Reset configuration word from the shadow and boot from the 
>internal flash. But it does not work at all!
>
>  Here I would appreciate much if you can tell me what I should do ?
>  Especially, I am not clear about the following questions:
>1.how to prepare the *.bin which would program into the shadow?
>2. Just as I have mentioned, for the minimum system, what I should 
>write into the CMFCFIG in 0x0000 of shadow?
>3.When program the shadow, what kind of Device Driver should I 
>select ? Still the ¡°00: MPC555 K1,2,3,M ( 448 x 8 ) 1 Device¡±?
> 
> I really appreciate much for your help!
>  Best regards!
>  wu 
>
>
>¡¡¡¡¡¡¡¡¡¡¡¡
>
>
>
>
>
>-----------------------------------------------------------
>To learn more about Freescale Microcontrollers, please visit
>http://www.freescale.com/mcu
>
>
> 
>Yahoo! Groups Links
>
>
>
> 
>
>
>
>
>
>  
>

-- 
David Wybo                    mailto:[email protected]
RealTime Consultants, Inc.    Phone: 248.345.6160
www.realtimeconsultantsinc.com





------------------------ Yahoo! Groups Sponsor --------------------~--> 
<font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12ht5acsf/M=362335.6886445.7839731.1510227/D=groups/S=1706554205:TM/Y=YAHOO/EXP=1124470154/A=2894361/R=0/SIG=13jmebhbo/*http://www.networkforgood.org/topics/education/digitaldivide/?source=YAHOO&cmpgn=GRP&RTP=http://groups.yahoo.com/">In low income neighborhoods, 84% do not own computers. At Network for Good, help bridge the Digital Divide!</a>.</font>
--------------------------------------------------------------------~-> 

-----------------------------------------------------------
To learn more about Freescale Microcontrollers, please visit
http://www.freescale.com/mcu


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/MPC500/

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.