arduino / arduino/ArduinoModule-CMSIS-Atmel

CMSIS Error using WDT

Open
#11 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
25
Forks
38
PR merge metrics
No merged PRs in 30d

Description

This simple test of the PM->RCAUSE.bit.WDT bit cause an error in a CMSIS Macro... Other bits in RCAUSE work fine...

Arduino 1.85
SAMD21 1.6.19
CMSIS-Atmel 1.1.0
~~~
void setup() {

if (PM->RCAUSE.bit.WDT) {}

}

void loop() {

}

// error messages below...

///Users/lafleur/Library/Arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-g++" -mcpu=cortex-m0plus -mthumb -c -g -Os -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -MMD -DF_CPU=48000000L -DARDUINO=10805 -DARDUINO_SAMD_ZERO -DARDUINO_ARCH_SAMD -D__SAMD21G18A__ -DUSB_VID=0x2341 -DUSB_PID=0x804d -DUSBCON '-DUSB_MANUFACTURER="Arduino LLC"' '-DUSB_PRODUCT="Arduino Zero"' "-I/Users/lafleur/Library/Arduino15/packages/arduino/tools/CMSIS/4.5.0/CMSIS/Include/" "-I/Users/lafleur/Library/Arduino15/packages/arduino/tools/CMSIS-Atmel/1.1.0/CMSIS/Device/ATMEL/" "-I/Users/lafleur/Library/Arduino15/packages/arduino/hardware/samd/1.6.19/cores/arduino" "-I/Users/lafleur/Library/Arduino15/packages/arduino/hardware/samd/1.6.19/variants/arduino_zero" "/var/folders/53/f8mlg0xn1xv3fsm58phqmtb40000gn/T/arduino_build_786181/sketch/WDT-Reset-Test.ino.cpp" -o "/var/folders/53/f8mlg0xn1xv3fsm58phqmtb40000gn/T/arduino_build_786181/sketch/WDT-Reset-Test.ino.cpp.o"
//In file included from /Users/lafleur/Library/Arduino15/packages/arduino/tools/CMSIS-Atmel/1.1.0/CMSIS/Device/ATMEL/samd21/include/samd21.h:69:0,
// from /Users/lafleur/Library/Arduino15/packages/arduino/tools/CMSIS-Atmel/1.1.0/CMSIS/Device/ATMEL/samd.h:105,
// from /Users/lafleur/Library/Arduino15/packages/arduino/tools/CMSIS-Atmel/1.1.0/CMSIS/Device/ATMEL/sam.h:470,
// from /Users/lafleur/Library/Arduino15/packages/arduino/hardware/samd/1.6.19/cores/arduino/Arduino.h:48,
// from /var/folders/53/f8mlg0xn1xv3fsm58phqmtb40000gn/T/arduino_build_786181/sketch/WDT-Reset-Test.ino.cpp:1:
///Users/lafleur/Desktop/MySensor-Arduino-development/MCCI/WDT-Reset-Test/WDT-Reset-Test.ino: In function 'void setup()':
///Users/lafleur/Library/Arduino15/packages/arduino/tools/CMSIS-Atmel/1.1.0/CMSIS/Device/ATMEL/samd21/include/samd21g18a.h:520:27: error: expected unqualified-id before '(' token
// #define WDT ((Wdt *)0x40001000UL) /**< \brief (WDT) APB Base Address */
// ^
///Users/lafleur/Desktop/MySensor-Arduino-development/MCCI/WDT-Reset-Test/WDT-Reset-Test.ino:4:20: note: in expansion of macro 'WDT'
// if (PM->RCAUSE.bit.WDT) {}
// ^
//exit status 1
//Error compiling for board Arduino/Genuino Zero (Native USB Port).
~~~

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the Arduino Zero build with the WDT-Reset-Test.ino example, then inspect CMSIS/Device/ATMEL/samd21/include/samd21g18a.h around the WDT macro and the PM->RCAUSE.bit.WDT expression. Done means the example compiles while preserving access to the WDT reset-cause bit.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
embedded-iot
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.