Serial data missing

I have an application on my ME that uses 20-30 threads. The serial data is missing 1/5 of the characters. If I bump up the priority of the COMM thread, then the whole app locks up. Anyone with ideas?


Why is there a need to have 20 - 30 tasks running on an embedded device? It’s a microprocessor…not a desktop CPU.

If you’re looking for a software SPI, check out the src/examples/nartcapp. There’s code to talk to a real-time clock using software SPI (it’s 3-wire, but I’ve successfully modified it for 4-wire). Note: it also requires mods to the gpio_def.h, gpio.c, and rtc_gpio, but it’s a nice starting point.

I got it solved by tweeking, but to answer your question:

  1. 8-10 threads for SSH Server.
  2. 1 thread apeace for the 15 telnet clients.
  3. 1 thread for the serial port handler.
  4. 1 thread for the reboot server (remote rebooting).
  5. 1 main thread.
  6. 1 os thread (for timers and TCP stack - look in bsp).
  7. 1 thread for each command shell (for the SSH server).

These are just the ones I can think of off the top of my head. I think that it adds up to 30 threads.

The ME was designed as a web server, so heavy processing is required unless you are doing something really simple. My application is for government use so it requires SSH security for FIPS. The good ARM processor and the large memory is the whole reason we are using the ME. (I just wish the interface to the board wasn’t so primative - a good SPI connection would be nice and I have yet to find anyone who has bit-banged one that works on GPIO.)


Thanks for all of that. Yeah, we aren’t doing secure connections, so I guess it would be considered pretty simple stuff.

So, what kind of tweaking was required? Was it in the bsp?

It turned out to be the old pipe problem that NetOS can’t handle very well.

I solved it by two things:

  1. Just slightly bumping up the priority of the thread that was reading the pipe and dumping to the serial port. (Also increasing the time slice a bit. No pun intended.)
  2. Actually getting rid of the pipe and putting in a fifo with mutex thread protection.

I had delt with the NetOS pipes a long time ago and had forgotten that they are intermittant. That is what I get for not doing anything new with NetOS for 6 months!