Skip to content

Commit 8106ede

Browse files
authored
Merge pull request #2770 from particle-iot/disable-protected-mode/sc-127946
Allow temporarily disabling device protection
2 parents 16afae7 + edefb7e commit 8106ede

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+804
-125
lines changed

bootloader/src/nRF52840/nrf_it.c

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "hw_config.h"
2525
#include "button_hal.h"
2626
#include "hal_platform_nrf52840_config.h"
27+
#include "security_mode.h"
2728

2829
extern void Timing_Decrement(void);
2930

@@ -120,6 +121,7 @@ void UsageFault_Handler(void)
120121
void SysTick_Handler(void)
121122
{
122123
System1MsTick();
124+
security_mode_notify_system_tick();
123125
Timing_Decrement();
124126

125127
#if HAL_PLATFORM_BUTTON_DEBOUNCE_IN_SYSTICK

bootloader/src/nRF52840/usbd_dfu.cpp

+10-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
#include <cstring>
2020
#include "hal_irq_flag.h"
2121
#include "security_mode.h"
22+
#include "core_hal.h"
23+
#include "syshealth_hal.h"
2224

2325
using namespace particle::usbd;
2426
using namespace particle::usbd::dfu;
@@ -215,8 +217,9 @@ int DfuClassDriver::handleDfuUpload(SetupRequest* req) {
215217
transferBuf_[0] = detail::DFUSE_COMMAND_GET_COMMAND;
216218
transferBuf_[1] = detail::DFUSE_COMMAND_SET_ADDRESS_POINTER;
217219
transferBuf_[2] = detail::DFUSE_COMMAND_ERASE;
220+
transferBuf_[3] = detail::DFUSE_COMMAND_ENTER_SAFE_MODE;
218221
setState(detail::dfuIDLE);
219-
dev_->setupReply(req, transferBuf_, 3);
222+
dev_->setupReply(req, transferBuf_, 4);
220223
} else if (req_.wValue > 1) {
221224
/* Normal request */
222225
setState(detail::dfuUPLOAD_IDLE);
@@ -488,6 +491,12 @@ int DfuClassDriver::inDone(uint8_t ep, unsigned status) {
488491
}
489492
break;
490493
}
494+
case detail::DFUSE_COMMAND_ENTER_SAFE_MODE: {
495+
HAL_Core_Write_Backup_Register(BKP_DR_01, ENTER_SAFE_MODE_APP_REQUEST);
496+
setState(detail::dfuMANIFEST_SYNC);
497+
setStatus(detail::OK);
498+
break;
499+
}
491500
case detail::DFUSE_COMMAND_READ_UNPROTECT: {
492501
/* Unsupported */
493502
setError(detail::errUNKNOWN);

bootloader/src/nRF52840/usbd_dfu.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,8 @@ enum DfuseCommand {
166166
DFUSE_COMMAND_GET_COMMAND = 0x00,
167167
DFUSE_COMMAND_SET_ADDRESS_POINTER = 0x21,
168168
DFUSE_COMMAND_ERASE = 0x41,
169-
DFUSE_COMMAND_READ_UNPROTECT = 0x92
169+
DFUSE_COMMAND_READ_UNPROTECT = 0x92,
170+
DFUSE_COMMAND_ENTER_SAFE_MODE = 0xfa /* Particle's extension */
170171
};
171172

172173
#pragma pack(push, 1)

bootloader/src/rtl872x/rtl_it.c

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "button_hal.h"
2424
#include "hal_platform_config.h"
2525
#include "interrupts_irq.h"
26+
#include "security_mode.h"
2627

2728
extern void Timing_Decrement(void);
2829

@@ -170,6 +171,7 @@ void SecureFault_Handler(void) {
170171
void SysTick_Handler(void)
171172
{
172173
System1MsTick();
174+
security_mode_notify_system_tick();
173175
Timing_Decrement();
174176

175177
#if HAL_PLATFORM_BUTTON_DEBOUNCE_IN_SYSTICK

bootloader/src/rtl872x/usbd_dfu.cpp

+10-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#include "hal_irq_flag.h"
2121
#include <algorithm>
2222
#include "security_mode.h"
23+
#include "core_hal.h"
24+
#include "syshealth_hal.h"
2325

2426
using namespace particle::usbd;
2527
using namespace particle::usbd::dfu;
@@ -216,8 +218,9 @@ int DfuClassDriver::handleDfuUpload(SetupRequest* req) {
216218
transferBuf_[0] = detail::DFUSE_COMMAND_GET_COMMAND;
217219
transferBuf_[1] = detail::DFUSE_COMMAND_SET_ADDRESS_POINTER;
218220
transferBuf_[2] = detail::DFUSE_COMMAND_ERASE;
221+
transferBuf_[3] = detail::DFUSE_COMMAND_ENTER_SAFE_MODE;
219222
setState(detail::dfuIDLE);
220-
dev_->setupReply(req, transferBuf_, 3);
223+
dev_->setupReply(req, transferBuf_, 4);
221224
} else if (req_.wValue > 1) {
222225
/* Normal request */
223226
setState(detail::dfuUPLOAD_IDLE);
@@ -473,6 +476,12 @@ int DfuClassDriver::dataIn(unsigned ep, particle::usbd::EndpointEvent ev, size_t
473476
}
474477
break;
475478
}
479+
case detail::DFUSE_COMMAND_ENTER_SAFE_MODE: {
480+
HAL_Core_Write_Backup_Register(BKP_DR_01, ENTER_SAFE_MODE_APP_REQUEST);
481+
setState(detail::dfuMANIFEST_SYNC);
482+
setStatus(detail::OK);
483+
break;
484+
}
476485
case detail::DFUSE_COMMAND_READ_UNPROTECT: {
477486
/* Unsupported */
478487
setError(detail::errUNKNOWN);

bootloader/src/rtl872x/usbd_dfu.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@ enum DfuseCommand {
162162
DFUSE_COMMAND_GET_COMMAND = 0x00,
163163
DFUSE_COMMAND_SET_ADDRESS_POINTER = 0x21,
164164
DFUSE_COMMAND_ERASE = 0x41,
165-
DFUSE_COMMAND_READ_UNPROTECT = 0x92
165+
DFUSE_COMMAND_READ_UNPROTECT = 0x92,
166+
DFUSE_COMMAND_ENTER_SAFE_MODE = 0xfa /* Particle's extension */
166167
};
167168

168169
#pragma pack(push, 1)

build/arm-tools.mk

+16
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,19 @@ CPPFLAGS += $(LTO_FLAGS) -fno-use-cxa-atexit
102102
CONLYFLAGS += $(LTO_FLAGS)
103103
LDFLAGS += -fno-use-cxa-atexit
104104

105+
USE_LTO=0
106+
107+
ifneq ($(FORCE_LTO),)
108+
USE_LTO=1
109+
endif
110+
105111
ifeq ($(COMPILE_LTO),y)
112+
USE_LTO=1
113+
endif
114+
115+
ifeq ($(USE_LTO),1)
106116
LDFLAGS += -flto -Os -fuse-linker-plugin
117+
CFLAGS += -fuse-linker-plugin
107118
else
108119
# Be explicit and disable LTO
109120
LDFLAGS += -fno-lto
@@ -112,6 +123,11 @@ endif
112123
# We are using newlib-nano for all the platforms
113124
CFLAGS += --specs=nano.specs
114125

126+
ifneq ($(LTO_EXTRA_OPTIMIZATIONS),)
127+
CFLAGS += -fipa-pta -fdevirtualize-at-ltrans -fdevirtualize-speculatively -flto-partition=balanced -fmerge-all-constants
128+
LDFLAGS += -fipa-pta -fdevirtualize-at-ltrans -fdevirtualize-speculatively -flto-partition=balanced -fmerge-all-constants
129+
endif
130+
115131
# Check if the compiler version is the minimum required
116132
version_to_number=$(shell v=$1; v=($${v//./ }); echo $$((v[0] * 10000 + v[1] * 100 + v[2])))
117133
get_major_version=$(shell v=$1; v=($${v//./ }); echo $${v[0]})

hal/inc/bootloader.h

-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ int bootloader_update(const void* bootloader_image, unsigned length);
3636
// Make sure we have only one function to retrieve the bootloader version going forward.
3737
uint16_t bootloader_get_version(void);
3838

39-
int bootloader_init_security_mode(void* reserved);
40-
4139
#ifdef __cplusplus
4240
}
4341
#endif

hal/inc/hal_dynalib_usb.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ DYNALIB_FN(0, hal_usb, HAL_USB_USART_Init, void(HAL_USB_USART_Serial, const HAL_
4343
DYNALIB_FN(1, hal_usb, HAL_USB_USART_Begin, void(HAL_USB_USART_Serial, uint32_t, void *))
4444
DYNALIB_FN(2, hal_usb, HAL_USB_USART_End, void(HAL_USB_USART_Serial))
4545
DYNALIB_FN(3, hal_usb, HAL_USB_USART_Baud_Rate, unsigned int(HAL_USB_USART_Serial))
46-
DYNALIB_FN(4, hal_usb, HAL_USB_USART_Available_Data, int32_t(HAL_USB_USART_Serial))
47-
DYNALIB_FN(5, hal_usb, HAL_USB_USART_Available_Data_For_Write, int32_t(HAL_USB_USART_Serial))
48-
DYNALIB_FN(6, hal_usb, HAL_USB_USART_Receive_Data, int32_t(HAL_USB_USART_Serial, uint8_t))
49-
DYNALIB_FN(7, hal_usb, HAL_USB_USART_Send_Data, int32_t(HAL_USB_USART_Serial, uint8_t))
50-
DYNALIB_FN(8, hal_usb, HAL_USB_USART_Flush_Data, void(HAL_USB_USART_Serial))
46+
DYNALIB_FN_WRAP(4, hal_usb, HAL_USB_USART_Available_Data, protected, int32_t(HAL_USB_USART_Serial))
47+
DYNALIB_FN_WRAP(5, hal_usb, HAL_USB_USART_Available_Data_For_Write, protected, int32_t(HAL_USB_USART_Serial))
48+
DYNALIB_FN_WRAP(6, hal_usb, HAL_USB_USART_Receive_Data, protected, int32_t(HAL_USB_USART_Serial, uint8_t))
49+
DYNALIB_FN_WRAP(7, hal_usb, HAL_USB_USART_Send_Data, protected, int32_t(HAL_USB_USART_Serial, uint8_t))
50+
DYNALIB_FN_WRAP(8, hal_usb, HAL_USB_USART_Flush_Data, protected, void(HAL_USB_USART_Serial))
5151
DYNALIB_FN(9, hal_usb, HAL_USB_USART_Is_Enabled, bool(HAL_USB_USART_Serial))
5252
DYNALIB_FN(10, hal_usb, HAL_USB_USART_Is_Connected, bool(HAL_USB_USART_Serial))
5353
DYNALIB_FN(11, hal_usb, HAL_USB_USART_LineCoding_BitRate_Handler, int32_t(void (*handler)(uint32_t bitRate), void* reserved))

hal/inc/usb_hal.h

+7-5
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
#include "hw_config.h"
4444
#endif
4545

46+
#include "security_mode.h"
47+
4648
#ifdef __cplusplus
4749
extern "C" {
4850
#endif
@@ -204,11 +206,11 @@ void HAL_USB_USART_Init(HAL_USB_USART_Serial serial, const HAL_USB_USART_Config*
204206
void HAL_USB_USART_Begin(HAL_USB_USART_Serial serial, uint32_t baud, void *reserved);
205207
void HAL_USB_USART_End(HAL_USB_USART_Serial serial);
206208
unsigned int HAL_USB_USART_Baud_Rate(HAL_USB_USART_Serial serial);
207-
int32_t HAL_USB_USART_Available_Data(HAL_USB_USART_Serial serial);
208-
int32_t HAL_USB_USART_Available_Data_For_Write(HAL_USB_USART_Serial serial);
209-
int32_t HAL_USB_USART_Receive_Data(HAL_USB_USART_Serial serial, uint8_t peek);
210-
int32_t HAL_USB_USART_Send_Data(HAL_USB_USART_Serial serial, uint8_t data);
211-
void HAL_USB_USART_Flush_Data(HAL_USB_USART_Serial serial);
209+
SECURITY_MODE_PROTECTED_FN(int32_t, HAL_USB_USART_Available_Data, (HAL_USB_USART_Serial serial));
210+
SECURITY_MODE_PROTECTED_FN(int32_t, HAL_USB_USART_Available_Data_For_Write, (HAL_USB_USART_Serial serial));
211+
SECURITY_MODE_PROTECTED_FN(int32_t, HAL_USB_USART_Receive_Data, (HAL_USB_USART_Serial serial, uint8_t peek));
212+
SECURITY_MODE_PROTECTED_FN(int32_t, HAL_USB_USART_Send_Data, (HAL_USB_USART_Serial serial, uint8_t data));
213+
SECURITY_MODE_PROTECTED_FN(void, HAL_USB_USART_Flush_Data, (HAL_USB_USART_Serial serial));
212214
bool HAL_USB_USART_Is_Enabled(HAL_USB_USART_Serial serial);
213215
bool HAL_USB_USART_Is_Connected(HAL_USB_USART_Serial serial);
214216
int32_t HAL_USB_USART_LineCoding_BitRate_Handler(void (*handler)(uint32_t bitRate), void* reserved);

hal/src/nRF52840/ble_hal.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ int BleObject::BleGap::setDeviceAddress(const hal_ble_addr_t* address) const {
869869

870870
int BleObject::BleGap::getDeviceAddress(hal_ble_addr_t* address) const {
871871
CHECK_TRUE(address, SYSTEM_ERROR_INVALID_ARGUMENT);
872-
ble_gap_addr_t localAddr;
872+
ble_gap_addr_t localAddr = {};
873873
int ret = sd_ble_gap_addr_get(&localAddr);
874874
CHECK_NRF_RETURN(ret, nrf_system_error(ret));
875875
*address = toHalAddress(localAddr);

hal/src/nRF52840/bootloader.cpp

-13
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,3 @@ uint16_t bootloader_get_version(void)
8787
}
8888
return info.module_version;
8989
}
90-
91-
int bootloader_init_security_mode(void* reserved) {
92-
CHECK_TRUE(FLASH_VerifyCRC32(FLASH_INTERNAL, BOOTLOADER_ADDR, FLASH_ModuleLength(FLASH_INTERNAL, BOOTLOADER_ADDR)), SYSTEM_ERROR_BAD_DATA);
93-
module_info_security_mode_ext_t ext = {};
94-
ext.ext.length = sizeof(ext);
95-
CHECK(security_mode_find_extension(HAL_STORAGE_ID_INTERNAL_FLASH, BOOTLOADER_ADDR, &ext));
96-
97-
if (ext.security_mode == MODULE_INFO_SECURITY_MODE_PROTECTED) {
98-
security_mode_set(ext.security_mode, nullptr);
99-
}
100-
101-
return 0;
102-
}

hal/src/nRF52840/lwip/lwipopts.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -451,14 +451,14 @@ void sys_unlock_tcpip_core(void);
451451
* this option does not affect outgoing packet sizes, which can be controlled
452452
* via IP_FRAG.
453453
*/
454-
#define IP_REASSEMBLY (PLATFORM_ID != PLATFORM_TRACKER)
454+
#define IP_REASSEMBLY (0)
455455

456456
/**
457457
* IP_FRAG==1: Fragment outgoing IP packets if their size exceeds MTU. Note
458458
* that this option does not affect incoming packet sizes, which can be
459459
* controlled via IP_REASSEMBLY.
460460
*/
461-
#define IP_FRAG (PLATFORM_ID != PLATFORM_TRACKER)
461+
#define IP_FRAG (0)
462462

463463
/**
464464
* IP_OPTIONS_ALLOWED: Defines the behavior for IP options.

hal/src/nRF52840/usb_hal.cpp

+27
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,20 @@ int32_t HAL_USB_USART_Available_Data(HAL_USB_USART_Serial serial) {
9292
return usb_uart_available_rx_data();
9393
}
9494

95+
int32_t HAL_USB_USART_Available_Data_protected(HAL_USB_USART_Serial serial) {
96+
CHECK_SECURITY_MODE_PROTECTED();
97+
return HAL_USB_USART_Available_Data(serial);
98+
}
99+
95100
int32_t HAL_USB_USART_Available_Data_For_Write(HAL_USB_USART_Serial serial) {
96101
return usb_uart_available_tx_data();
97102
}
98103

104+
int32_t HAL_USB_USART_Available_Data_For_Write_protected(HAL_USB_USART_Serial serial) {
105+
CHECK_SECURITY_MODE_PROTECTED();
106+
return HAL_USB_USART_Available_Data_For_Write(serial);
107+
}
108+
99109
int32_t HAL_USB_USART_Receive_Data(HAL_USB_USART_Serial serial, uint8_t peek) {
100110
if (usb_uart_available_rx_data() == 0) {
101111
return -1;
@@ -108,14 +118,31 @@ int32_t HAL_USB_USART_Receive_Data(HAL_USB_USART_Serial serial, uint8_t peek) {
108118
}
109119
}
110120

121+
int32_t HAL_USB_USART_Receive_Data_protected(HAL_USB_USART_Serial serial, uint8_t peek) {
122+
CHECK_SECURITY_MODE_PROTECTED();
123+
return HAL_USB_USART_Receive_Data(serial, peek);
124+
}
125+
111126
int32_t HAL_USB_USART_Send_Data(HAL_USB_USART_Serial serial, uint8_t data) {
112127
return usb_uart_send(&data, 1);
113128
}
114129

130+
int32_t HAL_USB_USART_Send_Data_protected(HAL_USB_USART_Serial serial, uint8_t data) {
131+
CHECK_SECURITY_MODE_PROTECTED();
132+
return HAL_USB_USART_Send_Data(serial, data);
133+
}
134+
115135
void HAL_USB_USART_Flush_Data(HAL_USB_USART_Serial serial) {
116136
usb_uart_flush_tx_data();
117137
}
118138

139+
void HAL_USB_USART_Flush_Data_protected(HAL_USB_USART_Serial serial) {
140+
if (security_mode_get(NULL) == MODULE_INFO_SECURITY_MODE_PROTECTED) {
141+
return;
142+
}
143+
HAL_USB_USART_Flush_Data(serial);
144+
}
145+
119146
bool HAL_USB_USART_Is_Enabled(HAL_USB_USART_Serial serial) {
120147
return usb_hal_is_enabled();
121148
}

hal/src/rtl872x/bootloader.cpp

-13
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,3 @@ uint16_t bootloader_get_version(void)
8888
// hard code to unblock porting work for now
8989
return 1001;
9090
}
91-
92-
int bootloader_init_security_mode(void* reserved) {
93-
CHECK_TRUE(FLASH_VerifyCRC32(FLASH_INTERNAL, BOOTLOADER_ADDR, FLASH_ModuleLength(FLASH_INTERNAL, BOOTLOADER_ADDR)), SYSTEM_ERROR_BAD_DATA);
94-
module_info_security_mode_ext_t ext = {};
95-
ext.ext.length = sizeof(ext);
96-
CHECK(security_mode_find_extension(HAL_STORAGE_ID_INTERNAL_FLASH, BOOTLOADER_ADDR, &ext));
97-
98-
if (ext.security_mode == MODULE_INFO_SECURITY_MODE_PROTECTED) {
99-
security_mode_set(ext.security_mode, nullptr);
100-
}
101-
102-
return 0;
103-
}

hal/src/rtl872x/usb_hal.cpp

+27
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,11 @@ int32_t HAL_USB_USART_Available_Data(HAL_USB_USART_Serial serial) {
170170
return getCdcClassDriver().available();
171171
}
172172

173+
int32_t HAL_USB_USART_Available_Data_protected(HAL_USB_USART_Serial serial) {
174+
CHECK_SECURITY_MODE_PROTECTED();
175+
return HAL_USB_USART_Available_Data(serial);
176+
}
177+
173178
int32_t HAL_USB_USART_Available_Data_For_Write(HAL_USB_USART_Serial serial) {
174179
if (serial != HAL_USB_USART_SERIAL) {
175180
return SYSTEM_ERROR_INVALID_ARGUMENT;
@@ -180,6 +185,11 @@ int32_t HAL_USB_USART_Available_Data_For_Write(HAL_USB_USART_Serial serial) {
180185
return getCdcClassDriver().availableForWrite();
181186
}
182187

188+
int32_t HAL_USB_USART_Available_Data_For_Write_protected(HAL_USB_USART_Serial serial) {
189+
CHECK_SECURITY_MODE_PROTECTED();
190+
return HAL_USB_USART_Available_Data_For_Write(serial);
191+
}
192+
183193
int32_t HAL_USB_USART_Receive_Data(HAL_USB_USART_Serial serial, uint8_t peek) {
184194
if (serial != HAL_USB_USART_SERIAL) {
185195
return SYSTEM_ERROR_INVALID_ARGUMENT;
@@ -197,6 +207,11 @@ int32_t HAL_USB_USART_Receive_Data(HAL_USB_USART_Serial serial, uint8_t peek) {
197207
return r;
198208
}
199209

210+
int32_t HAL_USB_USART_Receive_Data_protected(HAL_USB_USART_Serial serial, uint8_t peek) {
211+
CHECK_SECURITY_MODE_PROTECTED();
212+
return HAL_USB_USART_Receive_Data(serial, peek);
213+
}
214+
200215
int32_t HAL_USB_USART_Send_Data(HAL_USB_USART_Serial serial, uint8_t data) {
201216
if (serial != HAL_USB_USART_SERIAL) {
202217
return SYSTEM_ERROR_INVALID_ARGUMENT;
@@ -220,13 +235,25 @@ int32_t HAL_USB_USART_Send_Data(HAL_USB_USART_Serial serial, uint8_t data) {
220235
return -1;
221236
}
222237

238+
int32_t HAL_USB_USART_Send_Data_protected(HAL_USB_USART_Serial serial, uint8_t data) {
239+
CHECK_SECURITY_MODE_PROTECTED();
240+
return HAL_USB_USART_Send_Data(serial, data);
241+
}
242+
223243
void HAL_USB_USART_Flush_Data(HAL_USB_USART_Serial serial) {
224244
if (serial != HAL_USB_USART_SERIAL) {
225245
return;
226246
}
227247
return getCdcClassDriver().flush();
228248
}
229249

250+
void HAL_USB_USART_Flush_Data_protected(HAL_USB_USART_Serial serial) {
251+
if (security_mode_get(NULL) == MODULE_INFO_SECURITY_MODE_PROTECTED) {
252+
return;
253+
}
254+
return HAL_USB_USART_Flush_Data(serial);
255+
}
256+
230257
bool HAL_USB_USART_Is_Enabled(HAL_USB_USART_Serial serial) {
231258
if (serial != HAL_USB_USART_SERIAL) {
232259
return false;

modules/argon/system-part1/makefile

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ NCP_FIRMWARE_MODULE_VERSION=4
99
DEPENDENCIES = newlib_nano modules/argon/user-part modules/argon/system-part1 dynalib services hal platform system wiring communication rt-dynalib crypto proto_defs
1010
LIB_DEPENDENCIES = services system wiring communication hal platform crypto proto_defs
1111

12+
export FORCE_LTO=1
13+
1214
# newlib_nano is special in that it's linked automatically by the system, so no need to add it to the library path here
1315
MAKE_DEPENDENCIES = newlib_nano $(LIB_DEPENDENCIES)
1416
include ../modular.mk
@@ -29,7 +31,7 @@ include $(PROJECT_ROOT)/build/arm-tlm.mk
2931

3032
# NOTE: When compiling with LTO vTaskSwitchContext is getting linked out, despite the fact that it's
3133
# marked as used.
32-
LDFLAGS += -flto -Os -fuse-linker-plugin -Wl,--undefined=vTaskSwitchContext
34+
LDFLAGS += -Wl,--undefined=vTaskSwitchContext
3335

3436
$(call check_modular)
3537

0 commit comments

Comments
 (0)