Arm Mbed OS support forum

AT Trace debug is always enabled in ATHandler::handle_start()

Is there a specific reason why AT debug is always enabled in this method? Looks like an artifact of a debug session.

Hi @jrubis
Thank you for your query!
As you can see from the code:

    const bool temp_state = get_debug();
    set_debug(true);

    cmd_start(_cmd_buffer);

    set_debug(temp_state);

The current debug state is restored after the call for cmd_start.
According to the commit of this change, this was intentional.
Regards,
Mbed Support
Ron

I know its restored, but why is the current setting overridden in the first place? This results in AT trace output when none is desired.

For example, I am using the cellular device method, modem_debug_on() to selectively turn cell tracing on and off. That works as intended until this code is executed. Then regardless of the debug setting, AT trace TX lines are outputted. RX works as intended.

Hi John,

This way we can see from Mbed traces whether the AT handler connection works at the first place. As those are separately activated traces, we have seen many times AT traces are disabled when traces are uploaded for a defect. Of course we could have created a new mbed trace based solution but we decided to use this approach instead.
Does this cause a real issue for you or is it just an annoying feature?
Regards,
Antti

Hi Antti, I understand, but it seems there would have been a better way to ensure logging was enabled for the case that you describe. The approach taken to override that setting, breaks the API you created to enable or disable cell debug , which is a nice feature.

We have run into an issue where TLS breaks if AT debugging is on. So I would vote for what John is saying.