Debugger Lost Communication with MCU

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

Debugger Lost Communication with MCU

ソリューションへジャンプ
1,802件の閲覧回数
yicui
Contributor I

Hi Everyone:

I am a starter with Freescale products. I am working on a LED blinking program.

I found  two lines of port control code would lead to debugger complaining bad communication with MCU.

14114_14114.pngSS.png

With the two port control lines, the code actually is correct because I saw the led blinking after downloading.

However, the break points or stop are not available due to the communication issue.

Without the two port control lines of code, communication problem doesn't occur.  LED will then not blinking because ports not configured correctly

I am using Tower system TWR-K60100M with a MK60DN512VMD10 MCU.

Following is the code.

 

#include "derivative.h" /* include peripheral declarations */

int  main(void)

{

 

  int  counter=0;

  SIM_SCGC5 |= (SIM_SCGC5_PORTA_MASK );   /*clock gating*/

  PORTA_GPCLR=0xFFFF0000|PORT_PCR_DSE_MASK|PORT_PCR_MUX(1) ; /*Port Control*/

  PORTA_GPCHR=0xFFFF0000|PORT_PCR_DSE_MASK|PORT_PCR_MUX(1) ; /*Port Control*/

 

  GPIOA_PDDR=0xFFFFFFFF;

  for(;counter<210000;counter++)

  {

  if(counter<100000){

  GPIOA_PDOR=0xFFFFFFFF;

  }

  else{

  GPIOA_PDOR=0;

  }

  if(counter>200000)

  counter=0;

  }

  while(1);

  return 0;

}

ラベル(1)
タグ(2)
0 件の賞賛
返信
1 解決策
1,528件の閲覧回数
ndavies
Contributor V

The debugger talks to the CPU through the JTAG lines on Port A 0-3. When the MCU powers up these lines default to that purpose. Your are reprogramming too many pins on PortA to be GPIO. You need to be more selective in the number of PortA Pins you reconfigure to be GPIO.

Norm Davies.

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
1,529件の閲覧回数
ndavies
Contributor V

The debugger talks to the CPU through the JTAG lines on Port A 0-3. When the MCU powers up these lines default to that purpose. Your are reprogramming too many pins on PortA to be GPIO. You need to be more selective in the number of PortA Pins you reconfigure to be GPIO.

Norm Davies.

0 件の賞賛
返信