MCU speed vs Task Manager

Moldy01
Posts: 2
Joined: Fri Mar 29, 2024 2:59 pm

MCU speed vs Task Manager

Postby Moldy01 » Mon Apr 08, 2024 5:03 pm

I was sure that I posted this before, but I'm not seeing it. So, I'll try again.
I've been communicating with Espressif for a couple of months and they've got no idea except that it may be in the code. So, they suggested this Blog as the Arduino Engineers my help better.

I have a device running Arduino on an ESP32, mostly written in C++ , but drawing upon the Arduino libraries greatly. This device Periodically has issues wherein it will NOT communicate with another device using the UART for longer than a few seconds. I found that it is awaiting an ACK that just doesn't seem to come. I know the code works, as for the most part, I get great communications, and everything works per Hoyle.

Unfortunately, every now and again, it goes back to a few seconds then quits (again, awaiting the ACK).

Does ANYONE know of an issue with the UART or the Task Manager which might cause this. We recently changed the compile to lock in MCU clock at 160 MHz rather than the 240 MHz that we had been using. Espressif mentioned that there was an issue with the initialization of the MESH networking if started in the 240 MHz mode. Now that I've done that, suddenly we have problems with the UART communications.

Any thoughts would be helpful. The device is "Potted" since it sits in a motor pit at the end of a swimming pool (runs the pool cover). The other device is a touchscreen keypad which sends the command to open/close the cover.

Thanks,

Mitch

ESP_Sprite
Posts: 9759
Joined: Thu Nov 26, 2015 4:08 am

Re: MCU speed vs Task Manager

Postby ESP_Sprite » Tue Apr 09, 2024 2:05 am

Any chance you can post your code, or preferably a whittled down version of the code that does the bare minimum and still shows the issue?

pipi61
Posts: 60
Joined: Fri Dec 23, 2016 10:58 pm

Re: MCU speed vs Task Manager

Postby pipi61 » Tue Apr 09, 2024 10:57 pm

what kind of ACK is it?
There is no ACK in UART serial data transmission, it is asynchronous data transmission between transmitter and receiver, there is transmission even if the receiver is not connected....

ESP_Sprite
Posts: 9759
Joined: Thu Nov 26, 2015 4:08 am

Re: MCU speed vs Task Manager

Postby ESP_Sprite » Wed Apr 10, 2024 12:23 am

pipi61 wrote:
Tue Apr 09, 2024 10:57 pm
what kind of ACK is it?
There is no ACK in UART serial data transmission, it is asynchronous data transmission between transmitter and receiver, there is transmission even if the receiver is not connected....
I read it as an ACK in the protocol overlaid on the UART. As unchecked data streams are usually not that useful for m2m communications, people often put some (usually packetized) protocol layer on top of it.

pipi61
Posts: 60
Joined: Fri Dec 23, 2016 10:58 pm

Re: MCU speed vs Task Manager

Postby pipi61 » Wed Apr 10, 2024 12:06 pm

Then look for the error in the protocol, not in the esp32 UART hardware

MicroController
Posts: 1726
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: MCU speed vs Task Manager

Postby MicroController » Wed Apr 10, 2024 9:25 pm

Moldy01 wrote:
Mon Apr 08, 2024 5:03 pm
they've got no idea except that it may be in the code.
And they're probably right.
clock at 160 MHz rather than the 240 MHz ... suddenly we have problems with the UART communications.
Seems to hint at some timing-related issue. This could be due to any kind of race condition which just happens to become (more) noticable at a certain CPU speed, or of course could also be something else.
I would try moving away from searching for a problem in the MCU or the OS and start to verify that the application code is actually correct, maybe beginning with checking for race conditions/improper synchronizations.

Who is online

Users browsing this forum: No registered users and 64 guests