std::optional causing program to crash when has_value called

Hi,

I am currently trying to use std::optional in my program, but the program crashes whenever has_value() is called.

Another thing that I have noticed, is that I can't place a breakpoint for the remainder of the function after the std::object is retrieved. The same library/function worked with an STM32 build system.

		for (int i = 0; i < Ceil(number_of_bits, 8); i++) {
			response_data[i] = 0;
		}

		for (uint16_t i = 0; i < number_of_bits; i++) {
			auto itm = register_1bit_.GetItem(start_addr + i);
			if (itm.has_value()) {


my config file looks like this:
# Copyright (c) 2023 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

CONFIG_SOC_SERIES_NRF52X=y
CONFIG_SOC_NRF52840_QIAA=y
CONFIG_BOARD_IOTA_MAIN_BOARD=y

# Enable MPU
CONFIG_ARM_MPU=y

# Enable hardware stack protection
CONFIG_HW_STACK_PROTECTION=y

# Enable RTT
CONFIG_USE_SEGGER_RTT=y

# enable GPIO
CONFIG_GPIO=y

# enable uart driver
CONFIG_SERIAL=y
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_UART_USE_RUNTIME_CONFIGURE=y
CONFIG_UART_DRV_CMD=y

# enable I2c driver
CONFIG_I2C=y

# enable spi driver
CONFIG_SPI=y
CONFIG_SPI_ASYNC=y

# enable logging
CONFIG_LOG=y
CONFIG_LOG_BACKEND_RTT=y


CONFIG_PINCTRL=y

CONFIG_CPP=y
CONFIG_STD_CPP17=y
CONFIG_REQUIRES_FULL_LIBCPP=y
CONFIG_CPP_EXCEPTIONS=y

CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096

Related