Skip to content

Conversation

lgehreke
Copy link
Contributor

The sim 7080 driver has a lot functionality crammed into one source file. This makes it hard to maintain. Furthermore some bugs were fixed during the refactor.

Changes:

  • Split modem driver into multiple files
  • One file per modem functionality
  • Verifying xtra file validity on aided gps
  • Modem driver uses fixed baudrate to evade autobaud sequence

Additions:

  • Added multiple boot modes
  • Added force reset function
  • Added function to query time
  • Added battery measurement function
  • Added function to query iccid
  • Added gpio set function

Bugfixes:

  • Corrected socket connect behavior
  • Fixed wrong pdp context on offload_connect
  • Send sequence queries the available tx space before sending

rerickson1
rerickson1 previously approved these changes Aug 26, 2025
Copy link
Member

@rerickson1 rerickson1 left a comment

Choose a reason for hiding this comment

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

Do a rebase and see if CI is fixed.

Placed sim7080 driver in separate directory and split it in multiple
source files for better readability.

Signed-off-by: Lukas Gehreke <[email protected]>
On first boot a fixed baudrate is set for the sim7080. This makes power
on detection more reliable.

Signed-off-by: Lukas Gehreke <[email protected]>
Check the modem model on boot.

Signed-off-by: Lukas Gehreke <[email protected]>
PDP context handling takes place in separate source file for better
readability.

Signed-off-by: Lukas Gehreke <[email protected]>
Modem can either attach to network after initialization or be turned
off.

Signed-off-by: Lukas Gehreke <[email protected]>
Network and gnss can be disabled with stop functions instead of power
cycling the modem. The start functions will also not power cycle the
modem. In order to call the start functions the modem needs to be
booted.

Signed-off-by: Lukas Gehreke <[email protected]>
Moved socket related urc handling to dedicated file.

Signed-off-by: Lukas Gehreke <[email protected]>
Socket functions return EINVAL instead of EAGAIN when modem is
not in networking mode. Using EAGAIN could lead to a infinite sleep
loop in offload_sendmsg().

Signed-off-by: Lukas Gehreke <[email protected]>
Removed sleep to prevent infinite loop in sendmsg.

Signed-off-by: Lukas Gehreke <[email protected]>
Connection id and pdp index were swapped. Corrected this and
hardcoded pdp index since 0 is always used as index.

Signed-off-by: Lukas Gehreke <[email protected]>
Query available tx size before sending data instead of using
hardcoded number. Removed unnecessary strg+z send after data.

Signed-off-by: Lukas Gehreke <[email protected]>
The modem handler error can not be used to transport the result
of CAOPEN since it is overwritten by the trailing OK.
Socket does not get closed forcefully when connecting failed.

Signed-off-by: Lukas Gehreke <[email protected]>
Removed connected check from offload_close in order to be able
to close non-connected sockets.

Signed-off-by: Lukas Gehreke <[email protected]>
If a socket gets closed by the network while waiting on data
in offload_recvfrom this would hangup forever since modem_socket_wait_data
does not support timeouts. When the socket gets closed this wait is
unblocked.

Signed-off-by: Lukas Gehreke <[email protected]>
Added functionality to set modem gpio pins.

Signed-off-by: Lukas Gehreke <[email protected]>
Added function to get the iccid number.

Signed-off-by: Lukas Gehreke <[email protected]>
Added function to measure battery voltage, battery charge status
and battery connection level.

Signed-off-by: Lukas Gehreke <[email protected]>
Added function to query the modem state from application side.

Signed-off-by: Lukas Gehreke <[email protected]>
Added command to query ue system information from the modem.

Signed-off-by: Lukas Gehreke <[email protected]>
Added funtions to download a gnss xtra file, query its validity
and use it in gps.

Signed-off-by: Lukas Gehreke <[email protected]>
Added funtion to query local time and added injection time to
gnss xtra validity query function.

Signed-off-by: Lukas Gehreke <[email protected]>
Starting gnss with xtra functionality is only possible if the
validity of the xtra file was queried. Enabling xtra will be skipped
if the file is not valid

Signed-off-by: Lukas Gehreke <[email protected]>
Added function to forcefully reset the modem by holding the pwrkey
for 15 seconds.

Signed-off-by: Lukas Gehreke <[email protected]>
Added check that makes sure ftp works when the network context is
already active.

Signed-off-by: Lukas Gehreke <[email protected]>
@lgehreke lgehreke force-pushed the sim7080-refactor branch 3 times, most recently from 71317b4 to 3981738 Compare August 26, 2025 11:33
Fixed zephyr style violations.

Signed-off-by: Lukas Gehreke <[email protected]>
Copy link

@lgehreke lgehreke requested a review from rerickson1 August 26, 2025 12:37
@tomi-font tomi-font removed their request for review August 27, 2025 12:06
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.

3 participants