Skip to content
This repository has been archived by the owner on Nov 11, 2024. It is now read-only.

Cellular change only: GPIO pull direction fix. #7

Merged
merged 18 commits into from
Mar 19, 2021

Conversation

RobMeades
Copy link
Contributor

The way GPIO initialisation for the cellular pins was performed was messy and, in particular, resulted in a different pin configuration for the VInt pull up/down state depending on whether a pinEnablePower happened to have been defined. With this change the pin configuration is reset to default before each pin-setting and the VInt case is fixed to be "no pull".

This change has passed automated testing on all platforms on the ubxlib test farm.

RobMeades and others added 18 commits March 9, 2021 08:21
…the SARA-U201 module has become unresponsive to the AT+URAT=x command to change RATs. (#163)
…166)

It is easy to accidentally introduce JSON errors when editing settings.json: this change prints a nice big banner when this happens to make it more obvious.
Cellular change only: a TLS-based socket connection attempt can fail on SARA-R5 if it is invoked immediately after the socket is secured; this commit introduces a 250 ms delay to prevent that. Without this change three connection failures were seen in 30 test runs, with this change zero connection failures were seen in 30 test runs.
The SNR calculation in uCellInfoGetSnrDb() is now made fixed-point, courtesy of @mazgch. Since there is no down-side to disabling floating point the fixed-point versions of the stdio functions are used by default on all platforms except nRF5 SDK, which doesn't support them and so can't be saved.
The sockets examples sometimes fail to connect when run under the test campaign, I believe due to collisions of connection attempts at the test echo server when establishing a secure socket.  It is sensible, in any case, to have a retry with a delay as connections can fail in the real world, so add a retry to the sockets examples.
Added CONFIG_ASSERT to catch errors.
Added CONFIG_EXECUTE_XOR_WRITE=n to be able to write and execute from RAM for libCommon test.
Changed 0xFFFFFFF to /delete-property/ for rts and cts for no flow control.
When a sockets operation fails on the AT interface the module can be queried for further error information with AT+USOERR.  With this commit, whenever an AT socket operation fails, this command is emitted for debug purposes (i.e. it is visible in the AT log if that is being printed but nowhere else).
…169)

Zephyr change only: switch to using minimal C lib instead of newlib.

It turns out that the Zephyr integration of the non-malloc() functions in newlib, i.e. snprintf(), printf(), scanf(), strtok(), etc., is not thread-safe.  This commit switches over to using the default Zephyr minimal C library instead.  This entails the addition of a number of functions in the port/platform/clib directory which the Zephyr minimal C library doesn't support: isblank(), mktime() and setjmp()/longjump().

Note that, unfortunately, the Zephyr minimal C library doesn't support any form of heap usage checking so we have to rely on other platforms for that.
* Added semaphores.
No generic test has been written for uPortSemaphoreGiveIsr yet since this might be tricky in the generic case since we need to run from interrupt context. Done for zephyr but for the others we just execute from the current thread context for now.
I was being stupid: it is AT+USOER, not AT+UESORR.
While the change kind of made sense, in fact if there is to be a retry loop it is better across the whole socket create/connect/[close] process since failing to connect a socket can result in it being closed, hence it would need to be speculatively closed and re-created.  That is to messy for a simple example so go back to the original version.
The way GPIO initialisation for the cellular pins was performed was messy and, in particular, resulted in a different pin configuration for the VInt pull up/down state depending on whether a pinEnablePower happened to have been defined. With this change the pin configuration is reset to default before each pin-setting and the VInt case is fixed to be "no pull".
@RobMeades RobMeades requested a review from philwareublox March 19, 2021 14:37
@RobMeades RobMeades linked an issue Mar 19, 2021 that may be closed by this pull request
@RobMeades
Copy link
Contributor Author

@philwareublox: this will necessarily pull in all the PRs that were merged into our internal ubxlib repo and had not yet been pushed here; all you need to do is review the very last commit, not all of them!

@RobMeades RobMeades merged commit 661e054 into master Mar 19, 2021
@RobMeades RobMeades deleted the fix_cell_gpio_pulls_rmea branch March 19, 2021 14:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

missing gpioConfig.pullMode assignment for VINT pin?
3 participants