Skip to content

Commit deb43c5

Browse files
committed
samples: drivers: modem: hello_hl78xx sample
Add HL78xx driver sample application Signed-off-by: Zafer SEN <zafersn93@gmail.com>
1 parent 064bf94 commit deb43c5

File tree

8 files changed

+420
-0
lines changed

8 files changed

+420
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# editors
2+
*.swp
3+
*~
4+
5+
# build
6+
/build*/
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Sierra Wireless HL78XX driver driver options
2+
3+
# Copyright (c) 2025 Netfeasa
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
cmake_minimum_required(VERSION 3.20.0)
7+
8+
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
9+
project(hello_hl78xx)
10+
11+
target_sources(app PRIVATE src/main.c)
12+
13+
include(${ZEPHYR_BASE}/samples/net/common/common.cmake)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Sierra Wireless HL78XX driver driver options
2+
3+
# Copyright (c) 2025 Netfeasa
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
source "samples/net/common/Kconfig"
7+
source "Kconfig.zephyr"
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
.. zephyr:code-sample:: hello_hl78xx
2+
:name: Hello hl78xx modem driver
3+
4+
get & set basic hl78xx modem information & functionality with HL78XX modem APIs
5+
6+
Overview
7+
********
8+
9+
A simple sample that can be used with only Sierra Wireles HL78XX series modems
10+
11+
Notes
12+
*****
13+
14+
This sample uses the devicetree alias ``modem`` to identify
15+
the modem instance to use.
16+
17+
Building and Running
18+
********************
19+
20+
This application can be built and executed on QEMU as follows:
21+
22+
.. zephyr-app-commands::
23+
:zephyr-app: samples/drivers/modem/hello_hl78xx
24+
:host-os: all
25+
:goals: build flash
26+
:compact:
27+
28+
To build for another board, change "qemu_x86" above to that board's name.
29+
30+
Sample Output
31+
=============
32+
33+
.. code-block:: console
34+
35+
**********************************************************
36+
********* Hello HL78XX Modem Sample Application **********
37+
**********************************************************
38+
[00:00:16.881,000] <inf> main: Manufacturer: Sierra Wireless
39+
[00:00:16.881,000] <inf> main: Firmware Version: HL7812.5.5.17.0
40+
[00:00:16.881,000] <inf> main: APN: netfeasavod
41+
[00:00:16.881,000] <inf> main: Imei: 352244440111111
42+
[00:00:16.881,000] <inf> main: RAT: NB1
43+
[00:00:16.881,000] <inf> main: Connection status: Roaming Network
44+
[00:00:16.881,000] <inf> main: RSRP : -90
45+
**********************************************************
46+
47+
After startup, code performs:
48+
49+
#. Modem readiness check and power-on
50+
#. Network interface setup via Zephyr's Connection Manager
51+
#. Modem queries (manufacturer, firmware, APN, IMEI, signal strength, etc.)
52+
#. Network registration and signal strength checks
53+
#. Setting and verifying a new APN
54+
#. Sending an AT command to validate communication
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Sierra Wireless HL78XX driver driver options
2+
3+
# Copyright (c) 2025 Netfeasa Ltd.
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
# The HL78xx driver gets its IP settings from the cell network
7+
8+
#system
9+
CONFIG_HEAP_MEM_POOL_SIZE=4096
10+
CONFIG_MAIN_STACK_SIZE=4096
11+
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
12+
CONFIG_POSIX_API=y
13+
14+
#PM
15+
# CONFIG_PM_DEVICE=y
16+
17+
#uart
18+
CONFIG_UART_ASYNC_API=y
19+
CONFIG_UART_INTERRUPT_DRIVEN=y
20+
21+
# Generic networking options
22+
CONFIG_NETWORKING=y
23+
CONFIG_NET_UDP=y
24+
CONFIG_NET_TCP=y
25+
CONFIG_NET_IPV6=n
26+
CONFIG_NET_IPV4=y
27+
CONFIG_NET_SOCKETS=y
28+
29+
# DNS
30+
CONFIG_DNS_RESOLVER=y
31+
CONFIG_NET_SOCKETS_DNS_TIMEOUT=5000
32+
33+
# Wait for the network to be ready
34+
CONFIG_NET_SAMPLE_COMMON_WAIT_DNS_SERVER_ADDITION=y
35+
36+
# Network management
37+
CONFIG_NET_MGMT=y
38+
CONFIG_NET_MGMT_EVENT=y
39+
# NB-IoT has large latency, so increase timeouts. It is ok to use this for Cat-M1 as well.
40+
CONFIG_NET_SOCKETS_CONNECT_TIMEOUT=15000
41+
CONFIG_NET_CONNECTION_MANAGER=y
42+
43+
# Network buffers
44+
CONFIG_NET_PKT_RX_COUNT=32
45+
CONFIG_NET_PKT_TX_COUNT=16
46+
CONFIG_NET_BUF_RX_COUNT=64
47+
CONFIG_NET_BUF_TX_COUNT=32
48+
49+
# Modem driver
50+
CONFIG_MODEM=y
51+
52+
#hl78xx modem
53+
CONFIG_MODEM_HL78XX=y
54+
CONFIG_MODEM_HL7812=y
55+
56+
# Statistics
57+
CONFIG_MODEM_STATS=y
58+
CONFIG_SHELL=y
59+
60+
#apn source
61+
# CONFIG_MODEM_HL78XX_APN_SOURCE_KCONFIG=y
62+
# CONFIG_MODEM_HL78XX_APN="internet"
63+
64+
CONFIG_MODEM_HL78XX_BOOT_IN_FULLY_FUNCTIONAL_MODE=y
65+
66+
# RAT selection
67+
CONFIG_MODEM_HL78XX_AUTORAT=n
68+
CONFIG_MODEM_HL78XX_RAT_NB1=y
69+
70+
# Monitor modem events
71+
CONFIG_HL78XX_EVT_MONITOR=y
72+
73+
# Logging
74+
CONFIG_LOG=y
75+
CONFIG_LOG_MODE_DEFERRED=y
76+
CONFIG_LOG_BUFFER_SIZE=32768
77+
# For extra verbosity
78+
# CONFIG_MODEM_MODULES_LOG_LEVEL_DBG=y
79+
# CONFIG_MODEM_LOG_LEVEL_DBG=y
80+
# CONFIG_MODEM_CHAT_LOG_BUFFER_SIZE=1024
81+
# CONFIG_MODEM_HL78XX_LOG_CONTEXT_VERBOSE_DEBUG=y
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
sample:
2+
description: Sample for HL78XX modem
3+
name: Hello HL78XX sample
4+
common:
5+
tags:
6+
- modem
7+
- hl78xx
8+
filter: dt_alias_exists("modem")
9+
tests:
10+
sample.driver.modem.hello_hl78xx:
11+
platform_allow:
12+
- nucleo_u575zi_q
13+
integration_platforms:
14+
- nucleo_u575zi_q
15+
extra_args:
16+
- SHIELD=swir_hl78xx_ev_kit

0 commit comments

Comments
 (0)