Utilize pipe for logging

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

Utilize pipe for logging

89 Views
tschue-nxt
Contributor I

Hi community,

I am trying to integrate freemaster pipes for logging (and maybe use more of its functionality later on).

As I am running linux I tried to go the freemaster light + python path.
I can properly connect but when trying to open the pipeline and print my piped log messages I am not receiving any data via the rpc server.

To verify the target implementation I also checked via the Windows GUI which could read the pipe properly, so the issue seems to be on the PC side.

See attached example python script. Any hints welcome.

best regards

 

0 Kudos
Reply
2 Replies

88 Views
tschue-nxt
Contributor I

Never mind, seems I have to explicitly call PipeFlush on the receiver side. Did not expect that. Attached the working example as reference.

0 Kudos
Reply

29 Views
MichalH
NXP Apps Support
NXP Apps Support

Hello, 

it is great you got it finally working. I confirm the PipeFlush needs to be called as it causes the pipe data to be exchanged in both directions. This is actually the only pipe call which causes a physical data transfer. All other operations at both PC and target sides are just buffering the data to pipe buffers.

When using FreeMASTER protocol, the PC is the only initiator of communication. The target board cannot start it by itself. The PipeFlush is the place where PC gives the target a chance to report (and then send) any new pipe data.

Regards,
Michal

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2393739%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EUtilize%20pipe%20for%20logging%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2393739%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20community%2C%3C%2FP%3E%3CP%3EI%20am%20trying%20to%20integrate%20freemaster%20pipes%20for%20logging%20(and%20maybe%20use%20more%20of%20its%20functionality%20later%20on).%3C%2FP%3E%3CP%3EAs%20I%20am%20running%20linux%20I%20tried%20to%20go%20the%20freemaster%20light%20%2B%20python%20path.%3CBR%20%2F%3EI%20can%20properly%20connect%20but%20when%20trying%20to%20open%20the%20pipeline%20and%20print%20my%20piped%20log%20messages%20I%20am%20not%20receiving%20any%20data%20via%20the%20rpc%20server.%3C%2FP%3E%3CP%3ETo%20verify%20the%20target%20implementation%20I%20also%20checked%20via%20the%20Windows%20GUI%20which%20could%20read%20the%20pipe%20properly%2C%20so%20the%20issue%20seems%20to%20be%20on%20the%20PC%20side.%3C%2FP%3E%3CP%3ESee%20attached%20example%20python%20script.%20Any%20hints%20welcome.%3C%2FP%3E%3CP%3Ebest%20regards%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2393740%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Utilize%20pipe%20for%20logging%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2393740%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ENever%20mind%2C%20seems%20I%20have%20to%20explicitly%20call%20PipeFlush%20on%20the%20receiver%20side.%20Did%20not%20expect%20that.%20Attached%20the%20working%20example%20as%20reference.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2394237%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Utilize%20pipe%20for%20logging%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2394237%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%26nbsp%3B%3C%2FP%3E%0A%3CP%3Eit%20is%20great%20you%20got%20it%20finally%20working.%20I%20confirm%20the%20PipeFlush%20needs%20to%20be%20called%20as%20it%20causes%20the%20pipe%20data%20to%20be%20exchanged%20in%20both%20directions.%20This%20is%20actually%20the%20only%20pipe%20call%20which%20causes%20a%20physical%20data%20transfer.%20All%20other%20operations%20at%20both%20PC%20and%20target%20sides%20are%20just%20buffering%20the%20data%20to%20pipe%20buffers.%3C%2FP%3E%0A%3CP%3EWhen%20using%20FreeMASTER%20protocol%2C%20the%20PC%20is%20the%20only%20initiator%20of%20communication.%20The%20target%20board%20cannot%20start%20it%20by%20itself.%20The%20PipeFlush%20is%20the%20place%20where%20PC%20gives%20the%20target%20a%20chance%20to%20report%20(and%20then%20send)%20any%20new%20pipe%20data.%3C%2FP%3E%0A%3CP%3ERegards%2C%3CBR%20%2F%3EMichal%3C%2FP%3E%3C%2FLINGO-BODY%3E