Merge branch 'adafruit:master' into master

This commit is contained in:
Eduardo José Tagle
2026-02-04 12:07:14 -03:00
committed by GitHub
3 changed files with 34 additions and 26 deletions
-6
View File
@@ -397,12 +397,6 @@ endif
CFLAGS += -DDFU_APP_DATA_RESERVED=$(DFU_APP_DATA_RESERVED)
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523
# Fixes for gcc version 12, 13 and 14.
ifneq (,$(filter 12.% 13.% 14.%,$(shell $(CC) -dumpversion 2>$(NULL_DEVICE))))
CFLAGS += --param=min-pagesize=0
endif
#------------------------------------------------------------------------------
# Linker Flags
#------------------------------------------------------------------------------
@@ -40,15 +40,22 @@ void bootloader_util_settings_get(const bootloader_settings_t ** pp_bootloader_s
*pp_bootloader_settings = p_bootloader_settings;
}
void bootloader_mbr_addrs_populate(void)
{
if (*(const uint32_t *)MBR_BOOTLOADER_ADDR == 0xFFFFFFFF)
{
nrfx_nvmc_word_write(MBR_BOOTLOADER_ADDR, BOOTLOADER_REGION_START);
}
if (*(const uint32_t *)MBR_PARAM_PAGE_ADDR == 0xFFFFFFFF)
{
nrfx_nvmc_word_write(MBR_PARAM_PAGE_ADDR, BOOTLOADER_MBR_PARAMS_PAGE_ADDRESS);
}
}
void bootloader_mbr_addrs_populate(void)
{
#if defined(__GNUC__) && (__GNUC__ >= 12)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Warray-bounds"
#endif
if (*(const uint32_t *)MBR_BOOTLOADER_ADDR == 0xFFFFFFFF)
{
nrfx_nvmc_word_write(MBR_BOOTLOADER_ADDR, BOOTLOADER_REGION_START);
}
if (*(const uint32_t *)MBR_PARAM_PAGE_ADDR == 0xFFFFFFFF)
{
nrfx_nvmc_word_write(MBR_PARAM_PAGE_ADDR, BOOTLOADER_MBR_PARAMS_PAGE_ADDRESS);
}
#if defined(__GNUC__) && (__GNUC__ >= 12)
#pragma GCC diagnostic pop
#endif
}
+15 -8
View File
@@ -40,12 +40,19 @@
//
//--------------------------------------------------------------------+
// Add nonstring attribute if supported to avoid errors in GCC 15
#if defined(__has_attribute) && __has_attribute(nonstring)
#define ATTR_NONSTRING __attribute__((nonstring))
#else
#define ATTR_NONSTRING
#endif
typedef struct {
uint8_t JumpInstruction[3];
uint8_t OEMInfo[8];
uint16_t SectorSize;
uint8_t SectorsPerCluster;
uint16_t ReservedSectors;
uint8_t OEMInfo[8] ATTR_NONSTRING;
uint16_t SectorSize;
uint8_t SectorsPerCluster;
uint16_t ReservedSectors;
uint8_t FATCopies;
uint16_t RootDirectoryEntries;
uint16_t TotalSectors16;
@@ -59,8 +66,8 @@ typedef struct {
uint8_t Reserved;
uint8_t ExtendedBootSig;
uint32_t VolumeSerialNumber;
uint8_t VolumeLabel[11];
uint8_t FilesystemIdentifier[8];
uint8_t VolumeLabel[11] ATTR_NONSTRING;
uint8_t FilesystemIdentifier[8] ATTR_NONSTRING;
} __attribute__((packed)) FAT_BootBlock;
typedef struct {
@@ -81,8 +88,8 @@ typedef struct {
STATIC_ASSERT(sizeof(DirEntry) == 32);
struct TextFile {
char const name[11];
char const *content;
const char name[11] ATTR_NONSTRING;
const char *content;
};