Closed jakespeed1311 closed 2 years ago
I haven't tested with PlatformIO. However, in the CMSIS header file (sam3x8e.h) there are two definitions of PIOA
, depending on whether __ASSEMBLY__
is defined.
When targeting AVR variants, DirectIO uses some #define
/#include
tricks to define _SFR_ASM_COMPAT
without breaking the Arduino toolchain. Something similar may be needed here.
I won't be able to work on this for a bit. If you are looking for a workaround, you could try #define __ASSEMBLY__ 1
and see if that works (or if it breaks something else in the toolchain, requiring similar trickery to the AVR configurations).
hi, ok thats bad news, tanks. Jake
If you try the workaround, please let me know whether it worked for you.
Hello, no success, to be shure that i did notthing wrong here the code from direct_io_pin.ini examble. I have seen some definitions, i am not able to fix this Problem by my own.
`
OutputPin pin(2);
void setup() {}
void loop() { while(1) { pin = HIGH; pin = LOW; } }
##################### `
Terminal Output ##################
Verbose mode can be enabled via -v, --verbose
option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelsam/due.html
PLATFORM: Atmel SAM 4.1.0 > Arduino Due (Programming Port)
HARDWARE: AT91SAM3X8E 84MHz, 96KB RAM, 512KB Flash
DEBUG: Current (atmel-ice) External (atmel-ice, blackmagic, jlink, stlink)
PACKAGES:
~^~~~~~~~~~~~~~~~~~~~~~
C:\Users\admin.platformio\lib\DirectIO_ID6327/include/ports_sam.h:29:36: note: in definition of macro '_define_port' static const u32 pio = u32(PIO); \ ^~~ C:\Users\admin.platformio\lib\DirectIO_ID6327/include/ports_sam.h:40:22: note: in expansion of macro 'PIOA' Compiling .pio\build\due\FrameworkArduino\USB\USBCore.cpp.o _define_port(PORT_A, PIOA); ^~~~ Compiling .pio\build\due\FrameworkArduino\WInterrupts.c.o C:\Users\admin.platformio\packages\framework-arduino-sam\system\CMSIS\Device\ATMEL/sam3xa/include/sam3x8e.h:495:21: error: 'reinterpret_cast<Pio*>(1074663424)' is not a constant expression
~^~~~~~~~~~~~~~Compiling .pio\build\due\FrameworkArduino\WMath.cpp.o
Compiling .pio\build\due\FrameworkArduino\WString.cpp.o
C:\Users\admin\.platformio\lib\DirectIO_ID6327/include/ports_sam.h:29:36: note: in definition of macro '_define_port'
static const u32 pio = u32(PIO); \
^~~
C:\Users\admin\.platformio\lib\DirectIO_ID6327/include/ports_sam.h:44:22: note: in expansion of macro 'PIOB'
_define_port(PORT_B, PIOB);
^~~~
C:\Users\admin\.platformio\packages\framework-arduino-sam\system\CMSIS\Device\ATMEL/sam3xa/include/sam3x8e.h:496:21: error: 'reinterpret_cast<Pio*>(1074663936)' is not a constant expression
#define PIOC ((Pio *)0x400E1200U) /**< \brief (PIOC ) Base Address */
~^~~~~~~~~~~~~~~~~~~~~~
C:\Users\admin\.platformio\lib\DirectIO_ID6327/include/ports_sam.h:29:36: note: in definition of macro '_define_port'
static const u32 pio = u32(PIO); \
^~~
C:\Users\admin\.platformio\lib\DirectIO_ID6327/include/ports_sam.h:48:22: note: in expansion of macro 'PIOC'
_define_port(PORT_C, PIOC);
^~~~
C:\Users\admin\.platformio\packages\framework-arduino-sam\system\CMSIS\Device\ATMEL/sam3xa/include/sam3x8e.h:497:21: error: 'reinterpret_cast<Pio*>(1074664448)' is not a constant expression
#define PIOD ((Pio *)0x400E1400U) /**< \brief (PIOD ) Base Address */
~^~~~~~~~~~~~~~~~~~~~~~
C:\Users\admin\.platformio\lib\DirectIO_ID6327/include/ports_sam.h:29:36: note: in definition of macro '_define_port'
static const u32 pio = u32(PIO); \
^~~
C:\Users\admin\.platformio\lib\DirectIO_ID6327/include/ports_sam.h:52:22: note: in expansion of macro 'PIOD'
_define_port(PORT_D, PIOD);
^~~~
*** [.pio\build\due\src\direct_io_pin.ino.cpp.o] Error 1
C:\Users\admin\.platformio\packages\framework-arduino-sam\cores\arduino\USB\USBCore.cpp: In function 'void USB_ISR()':
C:\Users\admin\.platformio\packages\framework-arduino-sam\cores\arduino\USB\USBCore.cpp:688:21: warning: this 'else' clause does not guard... [-Wmisleading-indentation]
else
^~~~
C:\Users\admin\.platformio\packages\framework-arduino-sam\cores\arduino\USB\USBCore.cpp:690:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'else'
UDD_Send8(EP0, 0);
^~~~~~~~~
========================================================================= [FAILED] Took 3.77 seconds =========================================================================
The terminal process terminated with exit code: 1
#
Hello, i tried to test the Lib with Platformio and compile the Examble "direct_io_pin.ino" My version of PlatformIO ist 3.1.0 Core 4.2.1 I use an Arduino DUE an Programming Port tis ist Atmel SAM 4.1.0
'reinterpret_cast<Pio*>(1074662912)' is not a constant expression L redifiniton of that thing ? But i don't kow how do fix this. Thanks for help!
The error in the Terminal Output:
Processing due (platform: atmelsam; board: due; framework: arduino)
Verbose mode can be enabled via
-v, --verbose
option CONFIGURATION: https://docs.platformio.org/page/boards/atmelsam/due.html PLATFORM: Atmel SAM 4.1.0 > Arduino Due (Programming Port) HARDWARE: AT91SAM3X8E 84MHz, 96KB RAM, 512KB Flash DEBUG: Current (atmel-ice) External (atmel-ice, blackmagic, jlink, stlink) PACKAGES:define PIOA ((Pio *)0x400E0E00U) /*< \brief (PIOA ) Base Address /
C:\Users\admin.platformio\lib\DirectIO_ID6327/include/ports_sam.h:29:36: note: in definition of macro '_define_port' static const u32 pio = u32(PIO); \ ^~~ C:\Users\admin.platformio\lib\DirectIO_ID6327/include/ports_sam.h:40:22: note: in expansion of macro 'PIOA' _define_port(PORT_A, PIOA); ^~~~ C:\Users\admin.platformio\packages\framework-arduino-sam\system\CMSIS\Device\ATMEL/sam3xa/include/sam3x8e.h:495:21: error: 'reinterpret_cast<Pio*>(1074663424)' is not a constant expression
define PIOB ((Pio *)0x400E1000U) /*< \brief (PIOB ) Base Address /
C:\Users\admin.platformio\lib\DirectIO_ID6327/include/ports_sam.h:29:36: note: in definition of macro '_define_port' static const u32 pio = u32(PIO); \ ^~~ C:\Users\admin.platformio\lib\DirectIO_ID6327/include/ports_sam.h:44:22: note: in expansion of macro 'PIOB' _define_port(PORT_B, PIOB); ^~~~ C:\Users\admin.platformio\packages\framework-arduino-sam\system\CMSIS\Device\ATMEL/sam3xa/include/sam3x8e.h:496:21: error: 'reinterpret_cast<Pio*>(1074663936)' is not a constant expression
define PIOC ((Pio *)0x400E1200U) /*< \brief (PIOC ) Base Address /
C:\Users\admin.platformio\lib\DirectIO_ID6327/include/ports_sam.h:29:36: note: in definition of macro '_define_port' static const u32 pio = u32(PIO); \ ^~~ C:\Users\admin.platformio\lib\DirectIO_ID6327/include/ports_sam.h:48:22: note: in expansion of macro 'PIOC' _define_port(PORT_C, PIOC); ^~~~ C:\Users\admin.platformio\packages\framework-arduino-sam\system\CMSIS\Device\ATMEL/sam3xa/include/sam3x8e.h:497:21: error: 'reinterpret_cast<Pio*>(1074664448)' is not a constant expression
define PIOD ((Pio *)0x400E1400U) /*< \brief (PIOD ) Base Address /
C:\Users\admin.platformio\lib\DirectIO_ID6327/include/ports_sam.h:29:36: note: in definition of macro '_define_port' static const u32 pio = u32(PIO); \ ^~~ C:\Users\admin.platformio\lib\DirectIO_ID6327/include/ports_sam.h:52:22: note: in expansion of macro 'PIOD' _define_port(PORT_D, PIOD); ^~~~ *** [.pio\build\due\src\direct_io_pin.ino.cpp.o] Error 1 ========================================================================= [FAILED] Took 4.18 seconds =========================================================================