Freemaster connect target with K line

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

Freemaster connect target with K line

811件の閲覧回数
wangyanjun
Contributor II

Freemaster always report Response Timeout error. How to setup to connect?

0 件の賞賛
返信
3 返答(返信)

779件の閲覧回数
MichalH
NXP Apps Support
NXP Apps Support

Hello, 

you need to be more specific when reporting problems like this. 

  • What is your target MCU board?
  • How do you try to connect / what communication interface?
  • Does a MCU freemaster demo application work with your hardware setup?
  • What is the MCU application and what FreeMASTER driver you use (where it comes from)?

From the subject, I'm guessing you try to use a K-Line (12V UART bus) so please also give more information how do you interface the MCU and PC to this bus.

Thanks,
Michal

0 件の賞賛
返信

774件の閲覧回数
wangyanjun
Contributor II

Target MCU: LPC54616J512BD100

Communication interface: USART (SERIAL in Freemaster)

Comm Driver from SDK 2_12_0

K-Line is single wire connection between Host and target and used in automotive for diagnostic.

 

Thanks,

Wang Yanjun

タグ(1)
0 件の賞賛
返信

768件の閲覧回数
MichalH
NXP Apps Support
NXP Apps Support

Hello,

thanks for initial information. I would recommend to use a logic analyzer or oscilloscope to debug if the serial communication reaches the MCU pins and if the FreeMASTER driver in the MCU gets the data bytes correctly. You can place a breakpoint at FMSTR_ProtocolDecoder() in freemaster_protocol.c. If you get a hit there, you should be able to trace down if the response sent by the MCU reaches the K-Line bus and if PC can read it. 

There are many places where an error may occur and it is hard for me to guess it for your custom hardware. Several tips:

  • Verify that the UART is set up properly in the MCU. Your application needs to set up UART clocks, pins, baudrate etc. and then call FMSTR_Init()
  • Verify your applicaion's main() loop runs and calls FMSTR_Poll() fast enough for the protocol to be processed - alternatively, use an interrupt driven mode as documented in the MCU driver user manual.
  • You can set FMSTR_DEBUG_TX to 1 in freemaster_cfg.h to let the MCU to periodically transmit short test messages on UART. You should be able to see the communication on the PC using a simple terminal application (e.g. TeraTerm).
  • Analyze this DEBUG_TX communication at the physical wire using a logic analyzer to see if the baudrate is correct.
  • Check if the same baudrate is also selected in FreeMASTER on the PC side.

Regards,
Michal

 

0 件の賞賛
返信