Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ jobs:
- name: Move coverage files
run: |
mv ./coverage/reports/*/*.json ./coverage/reports
rm -f ./coverage/reports/merged.json
ls -la ./coverage/reports

- name: Generate list of coverage files
Expand Down
1 change: 0 additions & 1 deletion drivers/gnss/gnss_ubx_modem.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* SPDX-License-Identifier: FSL-1.1-ALv2
*/

#include <zephyr/modem/ubx.h>
#include <zephyr/logging/log.h>

#include <infuse/gnss/ubx/protocol.h>
Expand Down
3 changes: 2 additions & 1 deletion include/infuse/gnss/ubx/modem.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
#include <zephyr/kernel.h>
#include <zephyr/net_buf.h>
#include <zephyr/modem/pipe.h>
#include <zephyr/modem/ubx.h>
#include <zephyr/sys/ring_buffer.h>

#include <infuse/gnss/ubx/protocol.h>

#ifdef __cplusplus
extern "C" {
#endif
Expand Down
20 changes: 18 additions & 2 deletions include/infuse/gnss/ubx/protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#ifndef INFUSE_GNSS_UBX_PROTOCOL_H_
#define INFUSE_GNSS_UBX_PROTOCOL_H_

#include <zephyr/modem/ubx.h>
#include <zephyr/net_buf.h>
#include <zephyr/toolchain.h>

Expand All @@ -24,6 +23,22 @@ extern "C" {
* @{
*/

#define UBX_PREAMBLE_SYNC_CHAR_1 0xB5
#define UBX_PREAMBLE_SYNC_CHAR_2 0x62

/**
* @brief UBX Message Frame
*/
struct ubx_frame {
uint8_t preamble_sync_char_1;
uint8_t preamble_sync_char_2;
uint8_t message_class;
uint8_t message_id;
uint8_t payload_size_low;
uint8_t payload_size_high;
uint8_t payload_and_checksum[];
};

/**
* @brief UBX Message Classes
*/
Expand Down Expand Up @@ -830,6 +845,7 @@ static inline void ubx_msg_prepare(struct net_buf_simple *buf, uint8_t msg_class
*/
static inline void ubx_msg_finalise(struct net_buf_simple *buf)
{
const unsigned int crc_start_idx = offsetof(struct ubx_frame, message_class);
struct ubx_frame *frame;
uint16_t payload_size;
uint8_t ckA = 0;
Expand All @@ -843,7 +859,7 @@ static inline void ubx_msg_finalise(struct net_buf_simple *buf)
frame->payload_size_low = payload_size;
frame->payload_size_high = payload_size >> 8;
/* Calculate frame CRC */
for (unsigned int i = UBX_FRM_CHECKSUM_START_IDX; i < buf->len; i++) {
for (unsigned int i = crc_start_idx; i < buf->len; i++) {
ckA += buf->data[i];
ckB += ckA;
}
Expand Down
2 changes: 0 additions & 2 deletions kconfig/Kconfig.defaults.core
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,6 @@ configdefault UART_USE_RUNTIME_CONFIGURE
default n

# Debug options
configdefault DEBUG_INFO
default y
configdefault DEBUG_THREAD_INFO
default y
configdefault OUTPUT_DISASSEMBLY
Expand Down
27 changes: 16 additions & 11 deletions scripts/west_commands/vscode.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,19 @@ def _tfm_build(self, build_dir, cache):
launch["configurations"][0]["gdbPath"] = parent_cache.get("CMAKE_GDB")
launch["configurations"][1]["gdbPath"] = parent_cache.get("CMAKE_GDB")

def _tfm_sub_image(self, build_dir):
tfm_elfs = [
"bl2.elf",
"tfm_s.elf",
]
tfm_paths = [build_dir / "tfm" / "bin" / elf for elf in tfm_elfs]
tfm_exists = [p for p in tfm_paths if p.exists()]

# Add TF-M .elf files
launch["configurations"][0]["preAttachCommands"] = [
f"add-symbol-file {str(path)}" for path in tfm_exists
]

def _zephyr_build(self, build_dir, cache):
self.cpp_properties(build_dir, cache)

Expand All @@ -272,17 +285,7 @@ def _zephyr_build(self, build_dir, cache):
)

if cache.get("BOARD")[-3:] == "/ns":
tfm_elfs = [
"bl2.elf",
"tfm_s.elf",
]
tfm_paths = [build_dir / "tfm" / "bin" / elf for elf in tfm_elfs]
tfm_exists = [p for p in tfm_paths if p.exists()]

# Add TF-M .elf files
launch["configurations"][0]["preAttachCommands"] = [
f"add-symbol-file {str(path)}" for path in tfm_exists
]
self._tfm_sub_image(build_dir)
if cache.get("SYSBUILD", False):
# Check if a `mcuboot` folder exists at the same level
mcuboot_elf = build_dir / ".." / "mcuboot" / "zephyr" / "zephyr.elf"
Expand All @@ -297,6 +300,8 @@ def _qemu(self, build_dir, cache):

self.cpp_properties(build_dir, cache)

if cache.get("BOARD")[-3:] == "/ns":
self._tfm_sub_image(build_dir)
launch["configurations"][0]["name"] = "QEMU Attach"
launch["configurations"][0]["servertype"] = "external"
launch["configurations"][0]["gdbTarget"] = "localhost:1234"
Expand Down
2 changes: 1 addition & 1 deletion subsys/mgmt/mcumgr/os_mgmt_infuse/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: Apache-2.0

zephyr_library(mgmt_mcumgr_grp_os)
zephyr_library()
zephyr_library_sources(os_mgmt_infuse.c)

if (CONFIG_BOOTLOADER_MCUBOOT)
Expand Down