Freemaster connect target with K line

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Freemaster connect target with K line

666 Views
wangyanjun
Contributor II

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

0 Kudos
Reply
3 Replies

634 Views
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 Kudos
Reply

629 Views
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

Tags (1)
0 Kudos
Reply

623 Views
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 Kudos
Reply