DSC 56F82746 Software Reset / Bootloader Problem

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

DSC 56F82746 Software Reset / Bootloader Problem

993 次查看
dynapb
Contributor IV

Hi All

Having a problem with doing a Software Reset on a 56F82746 in order to jump to my bootloader.

I tried a number of things but would think the SWRst flag in SIM_CTRL would work.

I do the following code to disable things and then do the software reset.

//Disable timer and interrupts, pjb114.

TimerInterruptGP_Disable();

asm { nop; nop; nop; nop; nop; nop; }

Cpu_DisableInt();

asm { nop; nop; nop; nop; nop; nop; }

 //asm { jmp 0x7800 }

SIM_CTRL |= SIM_CTRL_SWRst_MASK; //TEST Full reset to get to bootloader, pjb114

while (1) {} //asm { nop; nop; nop; nop; nop; nop; }

It just locks up the processor somewhere and it is hard to troubleshoot since it is between normal code and bootloader.

Any thoughts on what might be happening?

Thanks

Pete

0 项奖励
回复
1 回复

698 次查看
dynapb
Contributor IV

Just an update for anyone interested.

I made the bootloader for the 56F82746 by modifying the one from AN4759.

The problem with the Software Reset occurs when I try to run the bootloader after running it previously.

I can start my program directly at power-up without going through the bootloader (main change I made), then start the bootloader by command (asm{jmp 0x7800}), download a new set of code and run that code.  All that works fine.  If I try to run the bootloader again is when it locks up and need a to resest the board.

There must be something set differently after running the bootloader or with the new code download so that it does not run again but have not found what that might be.

For this application it is not a problem since the bootloader does run without a problem the first time so I will use it as is since I have spent enough time on this.

Pete

0 项奖励
回复