Interrupt and message passing?

I have written our own serial port handler and application for handling serial packets. The application runs fine in a terminal window in Photon.

The ISR returns a signal when there is a complete packet to process. This wakes up a blocked thread to do the processing etc.

If I boot without loading photon and run the same application I get timing errors. It seems as though the message passing of the event has slowed down, or the interrupt response time has slowed (which I cannot believe). So packets are no longer being processed in good time.

My blocked thread runs at prio 55 so it is above all but the kernel.

Can anyone explain what is happening as I would expect the app to run faster when photon is not loaded!

Ian

I think you better put more details, because looks something strange. I can send you my serial port handler (it’s for check the system from serial console when system hangs). Do you have interrupts coming at all? BTW thread does not have to have high priority, you better assign high priority to event you send (as for me i don’t send interrupt event, just regular high priority pulse).

Are you writing this as an exercise in device drivers are do you intend to use it?
If you want to create a packet driver there is no need to boost priority or touch interupts, fread/fwrite and sleep should give you all the performance you need.

As for why it fails Hmmm… I would suspect that there is some timing issue in your code that runs a bit quicker when photon is not present. like checking for a result too soon but as dron says more info on what you are trying to do would help.

As well as changing priority have you change the algorithm? FIFO/RR etc.