Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers/at: improve URC handling #14914

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

vincent-d
Copy link
Member

Contribution description

Those changes improved our situation regarding URC with our modem.
main changes:

  • check for URC during at_drain()
  • check for URC in at_expect()
    Rationale: a URC can be emitted while a command is being sent before the echo is received.

The credit (and hopefully the support for this PR ;p ) goes to @aaltuntas

Jim O'Brien and others added 6 commits August 31, 2020 16:48
According to the ublox cellular modem AT reference manual,
a delay of -at least- 20ms is required before starting a new
command operation so that the modem has time to send the stored
URC messages to the host. It is also important to note that
this delay is inserted just BEFORE draining the AT device so as
to receive and process possible URCs. Another point to keep in
mind is that this delay is put in functions which constitute
a whole AT command, i.e. sending the command and waiting for the
answer. The remaning functions like at_send_bytes or at_recv_bytes
do not have this delay. The users, who will use those functions in
their own implementation, are advised to respect this timing.
With this commit, we attempt to fix some URC missing failures
that we have experienced so far. According to the basic test results
with the ublox SARA modem, these changes seem to be promising. However,
we need more detailed testing to come up with a final conclusion.
@vincent-d vincent-d added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation Area: drivers Area: Device drivers CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Aug 31, 2020
@aabadie aabadie added this to Backlog / Proposals in RIOT Sprint Day via automation Sep 28, 2020
@aabadie
Copy link
Contributor

aabadie commented Sep 28, 2020

@leandrolanzieri do you think you can find time to have a look at this one ?

@leandrolanzieri leandrolanzieri moved this from Backlog / Proposals to Ready for Review in RIOT Sprint Day Oct 13, 2020
@leandrolanzieri leandrolanzieri self-assigned this Oct 13, 2020
@fjmolinas
Copy link
Contributor

Can you provide some test output @vincent-d ?

Copy link
Contributor

@fjmolinas fjmolinas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments, if you provide some test results we can move forward with this one @vincent-d.

@@ -210,6 +269,7 @@ ssize_t at_send_cmd_get_resp(at_dev_t *dev, const char *command,
{
ssize_t res;

xtimer_usleep(AT_CMD_DELAY);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

xtimer is added but not as a dependency to the driver (you might consider using ztimer as well)

return rb->buf[rb->reads & (rb->size - 1)];
}

int tsrb_peek_one(tsrb_t *rb, uint8_t *dst)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a test for this in test-tsrb.c?

@MrKevinWeiss MrKevinWeiss added this to the Release 2021.07 milestone Jun 21, 2021
@MrKevinWeiss MrKevinWeiss removed this from the Release 2021.07 milestone Jul 15, 2021
@benpicco benpicco added the State: waiting for author State: Action by the author of the PR is required label Nov 29, 2021
@benpicco
Copy link
Contributor

ping @vincent-d

@stale
Copy link

stale bot commented Jun 12, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions.

@stale stale bot added the State: stale State: The issue / PR has no activity for >185 days label Jun 12, 2022
@aaltuntas
Copy link
Contributor

I will try to finalize this PR.

@stale stale bot removed the State: stale State: The issue / PR has no activity for >185 days label Jun 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: drivers Area: Device drivers CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR State: waiting for author State: Action by the author of the PR is required Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Projects
RIOT Sprint Day
  
Ready for Review
Development

Successfully merging this pull request may close these issues.

None yet

7 participants