-
Notifications
You must be signed in to change notification settings - Fork 325
Description
Hi, i am just working on a new ATSAMD21J17A from Microchip, as you know, its really complex to obtain a ATSAMD21G18 at this moment, so i am trying to make my proyect with the J17A variant.
The problem comes when i try to compile the new board, i obtain the following error:
Building zero echo "src/flash_samd21.c" src/flash_samd21.c arm-none-eabi-gcc -mthumb -mcpu=cortex-m0plus -Os -g -DSAMD21 -x c -c -pipe -nostdlib --param max-inline-insns-single=500 -fno-strict-aliasing -fdata-sections -ffunction-sections -D__SAMD21J17A__ -Werror -Wall -Wstrict-prototypes -Werror-implicit-function-declaration -Wpointer-arith -std=gnu99 -ffunction-sections -fdata-sections -Wchar-subscripts -Wcomment -Wformat=2 -Wimplicit-int -Wmain -Wparentheses -Wsequence-point -Wreturn-type -Wswitch -Wtrigraphs -Wunused -Wuninitialized -Wunknown-pragmas -Wfloat-equal -Wno-undef -Wbad-function-cast -Wwrite-strings -Waggregate-return -Wformat -Wmissing-format-attribute -Wno-deprecated-declarations -Wpacked -Wredundant-decls -Wnested-externs -Wlong-long -Wunreachable-code -Wcast-align -Wno-missing-braces -Wno-overflow -Wno-shadow -Wno-attributes -Wno-packed -Wno-pointer-sign -I. -I./inc -I./inc/preprocessor -I./boards/zero -Ilib/cmsis/CMSIS/Include -Ilib/usb_msc -Ibuild/zero -Ilib/samd21/samd21a/include/ src/flash_samd21.c -o build/zero/flash_samd21.o In file included from src/flash_samd21.c:1:0: ./inc/uf2.h:293:73: error: division by zero [-Werror=div-by-zero] #define STATIC_ASSERT(e) enum { CONCAT_0(_static_assert_, __LINE__) = 1 / ((e) ? 1 : 0) } ^ ./inc/uf2.h:298:1: note: in expansion of macro 'STATIC_ASSERT' STATIC_ASSERT(FLASH_NUM_ROWS * 4 == FLASH_NB_OF_PAGES); ^~~~~~~~~~~~~ ./inc/uf2.h:293:42: error: enumerator value for '_static_assert_298' is not an integer constant #define STATIC_ASSERT(e) enum { CONCAT_0(_static_assert_, __LINE__) = 1 / ((e) ? 1 : 0) } ^ ./inc/uf2.h:291:24: note: in definition of macro 'CONCAT_1' #define CONCAT_1(a, b) a##b ^ ./inc/uf2.h:293:33: note: in expansion of macro 'CONCAT_0' #define STATIC_ASSERT(e) enum { CONCAT_0(_static_assert_, __LINE__) = 1 / ((e) ? 1 : 0) } ^~~~~~~~ ./inc/uf2.h:298:1: note: in expansion of macro 'STATIC_ASSERT' STATIC_ASSERT(FLASH_NUM_ROWS * 4 == FLASH_NB_OF_PAGES); ^~~~~~~~~~~~~ cc1: all warnings being treated as errors Makefile:159: fallo en las instrucciones para el objetivo 'build/zero/flash_samd21.o' make: *** [build/zero/flash_samd21.o] Error 1
The main problem seems to be that "./inc/uf2.h:293:73: error: division by zero [-Werror=div-by-zero]
#define STATIC_ASSERT(e) enum { CONCAT_0(static_assert, LINE) = 1 / ((e) ? 1 : 0) }
"
I am trying to understand the error, but my knowledge with that kind of macros its really low.
Any help could be appreciated. Thanks.