The module: Ground Control's library on Zephyr, with one worker thread
Ground Control's RockBLOCK 9704 library is pinned untouched in west.yml and compiled here for any board with a UART: a serial port on the bus of the rock7,rockblock-9704 devicetree node, the library's timing calls on the kernel, and one worker thread that owns every call into it, since the library has no locking and shares static buffers. The worker sleeps until a request or a byte from the modem arrives. Requests (begin, end, power, send, info, signal) wait as long as the caller says; a send with K_NO_WAIT queues and reports through mo_done. Callbacks for a sent message, a received one, the signal and the provisioning; a status snapshot that never touches the modem. The library asks for provisioning once and keeps a miss for good; the worker clears its cache before a send whose topic is missing and after the modem refuses one, so a modem provisioned later is seen. The serial port and worker began in the OGLAS satellite bench and were carried through WII6's lib/wii6-sat.
This commit is contained in:
commit
c0e92a7f02
16 files changed
+1608
No files matched your search
@@ -0,0 +1,72 @@
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
menuconfig RB9704
|
||||
bool "RockBLOCK 9704 Iridium modem"
|
||||
default y
|
||||
depends on DT_HAS_ROCK7_ROCKBLOCK_9704_ENABLED
|
||||
depends on SERIAL
|
||||
select RING_BUFFER
|
||||
select UART_INTERRUPT_DRIVEN
|
||||
help
|
||||
Ground Control's RockBLOCK 9704 (Iridium Certus, IMT messages) on the
|
||||
UART its devicetree node sits on. Builds Ground Control's library,
|
||||
pinned pristine at modules/lib/rockblock9704, with a Zephyr serial
|
||||
port and one worker thread that owns it. <rb9704/rb9704.h> is the API.
|
||||
|
||||
if RB9704
|
||||
|
||||
config RB9704_MESSAGE_MAX
|
||||
int "Largest message in either direction (bytes)"
|
||||
default 2048
|
||||
range 16 100000
|
||||
help
|
||||
The modem takes up to 100 kB, and the library keeps one static buffer
|
||||
of this size for messages out and one for messages in, plus one in
|
||||
this module for the copy rb9704_send takes. 2 kB is three buffers of
|
||||
2 kB; raise it as far as the RAM allows.
|
||||
|
||||
config RB9704_POWER
|
||||
bool "Drive the power pins from devicetree"
|
||||
default y if $(dt_compat_any_has_prop,$(DT_COMPAT_ROCK7_ROCKBLOCK_9704),power-gpios)
|
||||
select GPIO
|
||||
help
|
||||
P_EN, I_EN and I_BTD as the devicetree node gives them. Without
|
||||
them the modem is taken to be powered, as the board is with the pins
|
||||
left open.
|
||||
|
||||
config RB9704_WORKER_STACK_SIZE
|
||||
int "Worker thread stack size"
|
||||
default 8192
|
||||
help
|
||||
Measured, not guessed: the library parks a 1.5 kB MT segment on the
|
||||
stack in rbPoll(), with cJSON's recursion beneath it. A smaller stack
|
||||
overflows only when a message arrives, which may be days after the
|
||||
change.
|
||||
|
||||
config RB9704_WORKER_PRIORITY
|
||||
int "Worker thread priority"
|
||||
default 8
|
||||
|
||||
config RB9704_RX_RING_SIZE
|
||||
int "Serial receive ring (bytes)"
|
||||
default 8192
|
||||
help
|
||||
The library's longest JSPR line is 8 kB.
|
||||
|
||||
config RB9704_SHELL
|
||||
bool "`rb9704` shell command"
|
||||
default y
|
||||
depends on SHELL
|
||||
|
||||
config RB9704_UPSTREAM_DIR
|
||||
string "Where Ground Control's library is"
|
||||
default ""
|
||||
help
|
||||
Empty: <west topdir>/modules/lib/rockblock9704, where this
|
||||
repository's west.yml puts it.
|
||||
|
||||
module = RB9704
|
||||
module-str = rb9704
|
||||
source "subsys/logging/Kconfig.template.log_config"
|
||||
|
||||
endif # RB9704
|
||||
Reference in new issue
Block a user