Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Freescale MCF52259 bootloader

Status
Not open for further replies.

london

Member level 4
Joined
Jun 30, 2006
Messages
79
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,945
Hi There,
Working on MCF52259 bootloader standard program in C, as per the freescale flowchart, if the program entered into the bootloader function then board have to be reset to exit from bootloader mode. For my application, if there is no mass storage aviable on the bood, I want to exit from bootloader function automatically after some time and go to main finction without reset the board.
here is the free scale code attached for your reference, it any one have some solutation share with me

void _Entry(void)
{
word i;
dword* UserEntryCheck;

// Handy line to use when testing application code in RAM
//asm(JMP startup);

MCF_GPIO_DDRNQ &= ~MCF_GPIO_DDRNQ_DDRNQ1; // PNQ1 as loading Input
MCF_GPIO_PNQPAR &= ~(MCF_GPIO_PNQPAR_PNQPAR1(3)); // set PNQ1 as GPIO

// delay some time for GPIO stable
for(i = 0; i < 20000; i++)
{
asm(nop);
}

/*******************/

/*******************/

// Disable Software Watchdog Timer
MCF_SCM_CWCR = 0;
// Enable debug
MCF_GPIO_PDDPAR = 0x0F;

MCF_CLOCK_OCLR = 0xC0; //turn on crystal

// delay some time for oscillator stable
for(i=0;i<255;i++)
{
asm(nop);
}

MCF_CLOCK_CCLR = 0x00; //switch to crystal
MCF_CLOCK_OCHR = 0x00; //turn off relaxation osc

// Enable on-chip modules to access internal SRAM
MCF_SCM_RAMBAR = (0
| MCF_SCM_RAMBAR_BA(RAMBAR_ADDRESS)
| MCF_SCM_RAMBAR_BDE);


// init controller and USB, searching USB and TUV_ccb.s19 file; load and boot also.
Bootloader_Main();

/************copied*******************/
// If SW1 not pressed, jump to user application
if(MCF_GPIO_SETNQ & MCF_GPIO_SETNQ_SETNQ1)
{
if ((uint32)_Entry >= (uint32)(__RAMBAR)) // Test to see if running in RAM or Flash
{
asm (JMP _startup); // jump to user entry
}
else
{

UserEntryCheck = (dword*)USER_ENTRY_ADDRESS;
if(*UserEntryCheck == 0x4E714EF9) // check there is a valid jump op-code
{
UserEntryCheck++; // increment pointer to next long word

if(*UserEntryCheck != 0xFFFFFFFF) // check there is a valid jump vector
{
asm (JMP USER_ENTRY_ADDRESS); // jump to user entry
}
}
}
}
/****************************************/
}
 

Hi,

Do you mean Without "Hard Reset"? You can do a soft reset (reset in software). The variables will be automatically saved, as you are not powering it up (you are not doing hard reset).

I haven't used the Microcontroller you are using. But for HCS08, the instruction is " asm("DCB 0x8D"); " (illegal opcode reset).
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top