LPUART KL17 and target reset

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

LPUART KL17 and target reset

ソリューションへジャンプ
589件の閲覧回数
beng_
Contributor III

i'm usign a 32-pin QFN part I'm trying to change the LPUART1 from using PTE0 (TX) and PTE1 (RX) to using PTC3 (RX) and PTC4 (TX) (and re-allocating PTE0 & PTE1 as GPIO lines).

When I change the code, my target devices keeps resetting. I'm fairly certain it's a software issue rather than a hardware issue. When I change which lines I'm using for the LPUART is there anything else I need to change? (Or am I doing anything daft in my code)

Old Code Which Works

  PORT_SetPinMux(PORTC, PIN3_IDX, kPORT_MuxAsGpio);
  PORTC->PCR[3] = ((PORTC->PCR[3] &
      (~(PORT_PCR_SRE_MASK | PORT_PCR_ISF_MASK)))
      | PORT_PCR_SRE(PCR_SRE_SLOW)
  );
  PORT_SetPinMux(PORTC, PIN4_IDX, kPORT_MuxAsGpio);
  PORTC->PCR[4] = ((PORTC->PCR[4] &
      (~(PORT_PCR_SRE_MASK | PORT_PCR_ISF_MASK)))
      | PORT_PCR_SRE(PCR_SRE_SLOW)
  );

  PORT_SetPinMux(PORTE, PIN0_IDX, kPORT_MuxAlt3);
  PORTE->PCR[0] = ((PORTE->PCR[0] &
      (~(PORT_PCR_PE_MASK | PORT_PCR_ISF_MASK)))
      | PORT_PCR_PE(PCR_PE_ENABLED)
  );
  PORT_SetPinMux(PORTE, PIN1_IDX, kPORT_MuxAlt3);

New Code which causes target to keep resetting

  // Pin 1 - PTE0
  PORT_SetPinMux(PORTE, PIN0_IDX, kPORT_MuxAsGpio);
  PORTE->PCR[0] = ((PORTE->PCR[0] &
      (~(PORT_PCR_SRE_MASK | PORT_PCR_ISF_MASK)))
      | PORT_PCR_SRE(PCR_SRE_SLOW)
  );

  // Pin 2 - PTE1
  PORT_SetPinMux(PORTE, PIN1_IDX, kPORT_MuxAsGpio); 
  PORTE->PCR[1] = ((PORTE->PCR[1] &
      (~(PORT_PCR_SRE_MASK | PORT_PCR_ISF_MASK)))
      | PORT_PCR_SRE(PCR_SRE_SLOW)
  );

  // Pin 24 - PTC3
  PORT_SetPinMux(PORTC, PIN3_IDX, kPORT_MuxAlt3);

  // Pin 25 - PTC4
  PORT_SetPinMux(PORTC, PIN4_IDX, kPORT_MuxAlt3);
  PORTC->PCR[4] = ((PORTC->PCR[4] &
      (~(PORT_PCR_PE_MASK | PORT_PCR_ISF_MASK)))
      | PORT_PCR_PE(PCR_PE_ENABLED)
  );

ラベル(1)
タグ(3)
0 件の賞賛
1 解決策
459件の閲覧回数
beng_
Contributor III

I've resolved this issue, there has a define hidden deep within my code that I hadn't changed.

元の投稿で解決策を見る

0 件の賞賛
2 返答(返信)
460件の閲覧回数
beng_
Contributor III

I've resolved this issue, there has a define hidden deep within my code that I hadn't changed.

0 件の賞賛
459件の閲覧回数
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Ben Griffiths,

  Please tell me the full name of your KL17, because KL17 have two different silicon type:up 128K flash and below 64K flash.

  Different KL17 silicon type is different.

So, please tell me the part number at first, I am afraid you are using the wrong reference manual, then control the wrong register or pin.

 


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛