Skip to content

modem_cellular: Add support for the simcom a76xx modem #90081

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

olalonde
Copy link

@olalonde olalonde commented May 16, 2025

Add support for the simcom a76xx modem which is similar to the simcom 7080 but has a few key differences. Tested with a simcom A7672SA module but as there is a single simcom A76XX AT commands manual, the driver should work with other modems of the series.

Copy link

Hello @olalonde, and thank you very much for your first pull request to the Zephyr project!
Our Continuous Integration pipeline will execute a series of checks on your Pull Request commit messages and code, and you are expected to address any failures by updating the PR. Please take a look at our commit message guidelines to find out how to format your commit messages, and at our contribution workflow to understand how to update your Pull Request. If you haven't already, please make sure to review the project's Contributor Expectations and update (by amending and force-pushing the commits) your pull request if necessary.
If you are stuck or need help please join us on Discord and ask your question there. Additionally, you can escalate the review when applicable. 😊

@@ -0,0 +1,27 @@
/ {
Copy link
Member

Choose a reason for hiding this comment

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

This does not look right. Now anyone having this DK will get this simcom modem added automatically even if he/she does not have one.

Copy link
Author

@olalonde olalonde May 23, 2025

Choose a reason for hiding this comment

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

I used the nrf52840dk board for testing the modem as none of the supported Zephyr boards uses it. There's no reason to run the cellular modem sample with it since it doesn't have a modem, so the chance of confusing someone is low. Is there a better way to do this? Or should i just remove it from the sample? I don't mind either way it was mostly just to facilitate my testing.

@@ -0,0 +1,3 @@
# Otherwise we run into DLCI buffer overruns (maybe due to lack of UART hardware flow control?)
Copy link
Collaborator

Choose a reason for hiding this comment

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

FYI there is now an async UART backend with HWFC available.

Copy link
Author

Choose a reason for hiding this comment

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

I'm pretty new to Zephyr/embedded but the module I'm testing with doesn't have a CTS pin, so unless I misunderstand something, I don't think it's possible to fix that in software (e.g. by using a different UART driver). The modem still won't know whether the microcontroller is ready to receive. Or maybe I'm misunderstanding something... PS: I am currently waiting for a better module with UART flow control pins, but shipping is slow.

Comment on lines +8 to +10
config SAMPLE_CELLULAR_MODEM_ENDPOINT_HOSTNAME
string "Endpoint hostname"
default "test-endpoint.com"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice! @bjarki-andreasen something really should be done with regards to test-endpoint.com... cc @kartben

Copy link
Author

@olalonde olalonde May 23, 2025

Choose a reason for hiding this comment

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

As a side note, in my own project, I recently added this to my CMakeLists.txt to avoid committing secrets to git:

if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/local.conf)
    file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/local.conf 
"# This file is not version controlled, you can use it for local only configuration")
endif()

set(EXTRA_CONF_FILE 
    ${CMAKE_CURRENT_SOURCE_DIR}/local.conf
)

And I also added local.conf to .gitignore.

It would be useful here to allow developers to set a private CONFIG_SAMPLE_CELLULAR_MODEM_ENDPOINT_HOSTNAME without having to edit a version controlled file. And for other configurations (e.g. logging) that are useful for testing but that you don't necessarily want to commit to git.

@@ -55,3 +55,12 @@ Next, the UART API must be specified using ``CONFIG_UART_INTERRUPT_DRIVEN=y`` or
``CONFIG_UART_ASYNC_API=y``. The driver doesn't support UART polling.

Lastly, the APN must be configured using ``CONFIG_MODEM_CELLULAR_APN=""``.

Server setup
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe mention CONFIG_SAMPLE_CELLULAR_MODEM_ENDPOINT_HOSTNAME?

Copy link
Author

Choose a reason for hiding this comment

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

Added a small paragraph about that 👍.

config MODEM_CELLULAR_POWER_ON_GNSS
bool "Power on the modem's GNSS module"
depends on DT_HAS_SIMCOM_A76XX_ENABLED
default n
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
default n

Default is always n.

Add support for the simcom a76xx modem which is similar to the simcom 7080
but has a few key differences. Tested with a simcom A7672SA module but as
there is a single simcom A76XX AT commands manual, the driver should work
with other modems of the series.

Signed-off-by: Olivier Lalonde <o@syskall.com>
Add a shutdown script to the a76xx modem driver.

Signed-off-by: Olivier Lalonde <o@syskall.com>
Optionally power on the GNSS module of simcom a76xx during the chat init
script. This is necessary because it does not seem possible to power on the
GNSS once the modem is in CMUX mode. Configurable through
`CONFIG_MODEM_CELLULAR_POWER_ON_GNSS`.

Signed-off-by: Olivier Lalonde <o@syskall.com>
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants