femtoduino / ArduinoCore-atsamd21e18a

Arduino Core and Bootloader for the ATMEL SAM D21/R21 (E Variant) chips.
https://femto.io
29 stars 15 forks source link

Build failed #26

Closed garnould closed 5 years ago

garnould commented 5 years ago

Hello,

Just installed a fresh Arduino 1.8.7 IDE and Arduino SAMD Boards (32-bits ARM Cortex-M0+) 1.6.19 (default version). Also installed board using https://downloads.femtoduino.com/ArduinoCore-atsamd21e18a/package_atsamd21e18a-release-build_index.json.

Plugged in USB dongle and selected Atmel SAM R21E (Native USB Port).

SerialUSB_Hello build failed with (previously described) messages as seen here > https://github.com/femtoduino/ArduinoCore-atsamd21e18a/issues/11#issuecomment-281881619

Switched to Arduino SAMD Boards (32-bits ARM Cortex-M0+) 1.6.11, build succeeded.

Then switched back to Arduino SAMD Boards (32-bits ARM Cortex-M0+) 1.6.19, build succeeded again (thought it would have failed again).

Problem apparently solved but it looks like 1.6.11 updated something.

garnould commented 5 years ago

Update on last message:

Exited IDE (with 1.6.19 active) and relaunched : build re-fails with message:

In file included from ~garnould/Library/Arduino15/packages/femtoduino/hardware/samd/1.8.4/cores/arduino_osc32k/USB/USBCore.cpp:21:0: ~garnould/Library/Arduino15/packages/femtoduino/hardware/samd/1.8.4/cores/arduino_osc32k/USB/SAMD21_USBDevice.h: In member function 'bool USBDevice_SAMD21G18x::epBank0IsStalled(ep_t)': ~garnould/Library/Arduino15/packages/femtoduino/hardware/samd/1.8.4/cores/arduino_osc32k/USB/SAMD21_USBDevice.h:94:96: error: 'volatile struct USB_DEVICE_EPINTFLAG_Type::<anonymous>' has no member named 'STALL0' inline bool epBank0IsStalled(ep_t ep) { return usb.DeviceEndpoint[ep].EPINTFLAG.bit.STALL0; } ^ ~garnould/Library/Arduino15/packages/femtoduino/hardware/samd/1.8.4/cores/arduino_osc32k/USB/SAMD21_USBDevice.h: In member function 'bool USBDevice_SAMD21G18x::epBank1IsStalled(ep_t)': ~garnould/Library/Arduino15/packages/femtoduino/hardware/samd/1.8.4/cores/arduino_osc32k/USB/SAMD21_USBDevice.h:95:96: error: 'volatile struct USB_DEVICE_EPINTFLAG_Type::<anonymous>' has no member named 'STALL1' inline bool epBank1IsStalled(ep_t ep) { return usb.DeviceEndpoint[ep].EPINTFLAG.bit.STALL1; } ^ ~garnould/Library/Arduino15/packages/femtoduino/hardware/samd/1.8.4/cores/arduino_osc32k/USB/SAMD21_USBDevice.h: In member function 'bool USBDevice_SAMD21G18x::epBank0IsTransferComplete(ep_t)': ~garnould/Library/Arduino15/packages/femtoduino/hardware/samd/1.8.4/cores/arduino_osc32k/USB/SAMD21_USBDevice.h:96:96: error: 'volatile struct USB_DEVICE_EPINTFLAG_Type::<anonymous>' has no member named 'TRCPT0' inline bool epBank0IsTransferComplete(ep_t ep) { return usb.DeviceEndpoint[ep].EPINTFLAG.bit.TRCPT0; } ^ ~garnould/Library/Arduino15/packages/femtoduino/hardware/samd/1.8.4/cores/arduino_osc32k/USB/SAMD21_USBDevice.h: In member function 'bool USBDevice_SAMD21G18x::epBank1IsTransferComplete(ep_t)': ~garnould/Library/Arduino15/packages/femtoduino/hardware/samd/1.8.4/cores/arduino_osc32k/USB/SAMD21_USBDevice.h:97:96: error: 'volatile struct USB_DEVICE_EPINTFLAG_Type::<anonymous>' has no member named 'TRCPT1' inline bool epBank1IsTransferComplete(ep_t ep) { return usb.DeviceEndpoint[ep].EPINTFLAG.bit.TRCPT1; } ^ ~garnould/Library/Arduino15/packages/femtoduino/hardware/samd/1.8.4/cores/arduino_osc32k/USB/SAMD21_USBDevice.h: In member function 'void USBDevice_SAMD21G18x::epBank0EnableStalled(ep_t)': ~garnould/Library/Arduino15/packages/femtoduino/hardware/samd/1.8.4/cores/arduino_osc32k/USB/SAMD21_USBDevice.h:106:93: error: 'volatile struct USB_DEVICE_EPINTENSET_Type::<anonymous>' has no member named 'STALL0' inline void epBank0EnableStalled(ep_t ep) { usb.DeviceEndpoint[ep].EPINTENSET.bit.STALL0 = 1; } ^ ~garnould/Library/Arduino15/packages/femtoduino/hardware/samd/1.8.4/cores/arduino_osc32k/USB/SAMD21_USBDevice.h: In member function 'void USBDevice_SAMD21G18x::epBank1EnableStalled(ep_t)': ~garnould/Library/Arduino15/packages/femtoduino/hardware/samd/1.8.4/cores/arduino_osc32k/USB/SAMD21_USBDevice.h:107:93: error: 'volatile struct USB_DEVICE_EPINTENSET_Type::<anonymous>' has no member named 'STALL1' inline void epBank1EnableStalled(ep_t ep) { usb.DeviceEndpoint[ep].EPINTENSET.bit.STALL1 = 1; } ^ ~garnould/Library/Arduino15/packages/femtoduino/hardware/samd/1.8.4/cores/arduino_osc32k/USB/SAMD21_USBDevice.h: In member function 'void USBDevice_SAMD21G18x::epBank0EnableTransferComplete(ep_t)': ~garnould/Library/Arduino15/packages/femtoduino/hardware/samd/1.8.4/cores/arduino_osc32k/USB/SAMD21_USBDevice.h:108:93: error: 'volatile struct USB_DEVICE_EPINTENSET_Type::<anonymous>' has no member named 'TRCPT0' inline void epBank0EnableTransferComplete(ep_t ep) { usb.DeviceEndpoint[ep].EPINTENSET.bit.TRCPT0 = 1; } ^ ~garnould/Library/Arduino15/packages/femtoduino/hardware/samd/1.8.4/cores/arduino_osc32k/USB/SAMD21_USBDevice.h: In member function 'void USBDevice_SAMD21G18x::epBank1EnableTransferComplete(ep_t)': ~garnould/Library/Arduino15/packages/femtoduino/hardware/samd/1.8.4/cores/arduino_osc32k/USB/SAMD21_USBDevice.h:109:93: error: 'volatile struct USB_DEVICE_EPINTENSET_Type::<anonymous>' has no member named 'TRCPT1' inline void epBank1EnableTransferComplete(ep_t ep) { usb.DeviceEndpoint[ep].EPINTENSET.bit.TRCPT1 = 1; } ^ ~garnould/Library/Arduino15/packages/femtoduino/hardware/samd/1.8.4/cores/arduino_osc32k/USB/SAMD21_USBDevice.h: In member function 'void USBDevice_SAMD21G18x::epBank0DisableStalled(ep_t)': ~garnould/Library/Arduino15/packages/femtoduino/hardware/samd/1.8.4/cores/arduino_osc32k/USB/SAMD21_USBDevice.h:112:94: error: 'volatile struct USB_DEVICE_EPINTENCLR_Type::<anonymous>' has no member named 'STALL0' inline void epBank0DisableStalled(ep_t ep) { usb.DeviceEndpoint[ep].EPINTENCLR.bit.STALL0 = 1; } ^ ~garnould/Library/Arduino15/packages/femtoduino/hardware/samd/1.8.4/cores/arduino_osc32k/USB/SAMD21_USBDevice.h: In member function 'void USBDevice_SAMD21G18x::epBank1DisableStalled(ep_t)': ~garnould/Library/Arduino15/packages/femtoduino/hardware/samd/1.8.4/cores/arduino_osc32k/USB/SAMD21_USBDevice.h:113:94: error: 'volatile struct USB_DEVICE_EPINTENCLR_Type::<anonymous>' has no member named 'STALL1' inline void epBank1DisableStalled(ep_t ep) { usb.DeviceEndpoint[ep].EPINTENCLR.bit.STALL1 = 1; } ^ ~garnould/Library/Arduino15/packages/femtoduino/hardware/samd/1.8.4/cores/arduino_osc32k/USB/SAMD21_USBDevice.h: In member function 'void USBDevice_SAMD21G18x::epBank0DisableTransferComplete(ep_t)': ~garnould/Library/Arduino15/packages/femtoduino/hardware/samd/1.8.4/cores/arduino_osc32k/USB/SAMD21_USBDevice.h:114:94: error: 'volatile struct USB_DEVICE_EPINTENCLR_Type::<anonymous>' has no member named 'TRCPT0' inline void epBank0DisableTransferComplete(ep_t ep) { usb.DeviceEndpoint[ep].EPINTENCLR.bit.TRCPT0 = 1; } ^ ~garnould/Library/Arduino15/packages/femtoduino/hardware/samd/1.8.4/cores/arduino_osc32k/USB/SAMD21_USBDevice.h: In member function 'void USBDevice_SAMD21G18x::epBank1DisableTransferComplete(ep_t)': ~garnould/Library/Arduino15/packages/femtoduino/hardware/samd/1.8.4/cores/arduino_osc32k/USB/SAMD21_USBDevice.h:115:94: error: 'volatile struct USB_DEVICE_EPINTENCLR_Type::<anonymous>' has no member named 'TRCPT1' inline void epBank1DisableTransferComplete(ep_t ep) { usb.DeviceEndpoint[ep].EPINTENCLR.bit.TRCPT1 = 1; } ^ ~garnould/Library/Arduino15/packages/femtoduino/hardware/samd/1.8.4/cores/arduino_osc32k/USB/SAMD21_USBDevice.h: In member function 'void USBDevice_SAMD21G18x::epBank0SetStallReq(ep_t)': ~garnould/Library/Arduino15/packages/femtoduino/hardware/samd/1.8.4/cores/arduino_osc32k/USB/SAMD21_USBDevice.h:125:85: error: 'volatile struct USB_DEVICE_EPSTATUSSET_Type::<anonymous>' has no member named 'STALLRQ0' inline void epBank0SetStallReq(ep_t ep) { usb.DeviceEndpoint[ep].EPSTATUSSET.bit.STALLRQ0 = 1; } ^ ~garnould/Library/Arduino15/packages/femtoduino/hardware/samd/1.8.4/cores/arduino_osc32k/USB/SAMD21_USBDevice.h: In member function 'void USBDevice_SAMD21G18x::epBank1SetStallReq(ep_t)': ~garnould/Library/Arduino15/packages/femtoduino/hardware/samd/1.8.4/cores/arduino_osc32k/USB/SAMD21_USBDevice.h:126:85: error: 'volatile struct USB_DEVICE_EPSTATUSSET_Type::<anonymous>' has no member named 'STALLRQ1' inline void epBank1SetStallReq(ep_t ep) { usb.DeviceEndpoint[ep].EPSTATUSSET.bit.STALLRQ1 = 1; } ^ ~garnould/Library/Arduino15/packages/femtoduino/hardware/samd/1.8.4/cores/arduino_osc32k/USB/SAMD21_USBDevice.h: In member function 'void USBDevice_SAMD21G18x::epBank0ResetStallReq(ep_t)': ~garnould/Library/Arduino15/packages/femtoduino/hardware/samd/1.8.4/cores/arduino_osc32k/USB/SAMD21_USBDevice.h:127:85: error: 'volatile struct USB_DEVICE_EPSTATUSCLR_Type::<anonymous>' has no member named 'STALLRQ0' inline void epBank0ResetStallReq(ep_t ep) { usb.DeviceEndpoint[ep].EPSTATUSCLR.bit.STALLRQ0 = 1; } ^ ~garnould/Library/Arduino15/packages/femtoduino/hardware/samd/1.8.4/cores/arduino_osc32k/USB/SAMD21_USBDevice.h: In member function 'void USBDevice_SAMD21G18x::epBank1ResetStallReq(ep_t)': ~garnould/Library/Arduino15/packages/femtoduino/hardware/samd/1.8.4/cores/arduino_osc32k/USB/SAMD21_USBDevice.h:128:85: error: 'volatile struct USB_DEVICE_EPSTATUSCLR_Type::<anonymous>' has no member named 'STALLRQ1' inline void epBank1ResetStallReq(ep_t ep) { usb.DeviceEndpoint[ep].EPSTATUSCLR.bit.STALLRQ1 = 1; } ^ exit status 1 Error compiling for board Atmel SAM R21E (Native USB Port).

Re-switched to 1.6.11 > build succeeded

Exited and relaunched IDE (1.6.11 still active) > build succeeded

Spomky commented 5 years ago

Hi,

Same problem here. Compilation succeeded with the hourly build, not the stable one.

drogge commented 5 years ago

The problem seems to be that the ArduinoCore-atsamd21e18a/cores/arduino_osc32k/USB stuff is for the samd21 but the usb.h file included is from ArduinoCore-atsamd21e18a/bootloaders/zero_osc32k/ATMEL/samr21/include/component. This usb.h file doesn't include the bitfields that are causing the errors. I've found that copying the usb.h from ArduinoCore-atsamd21e18a/bootloaders/zero_osc32k/ATMEL/samd21/include/component to the samr21/include/component dir fixes the problem. What's actually wrong is up for interpretation, the arduino_osc32k/USB should probably reference some samr21 thing instead of samd21. As far as I can tell the USB hardware is the same on the samd and samr so I think everything should be ok.

If Alex wants I can create a pull request to fix this in the repository.

zrecore commented 5 years ago

Sounds good! Excellent work!

On Tue, Oct 30, 2018, 4:08 PM Drew Rogge notifications@github.com wrote:

The problem seems to be that the ArduinoCore-atsamd21e18a/cores/arduino_osc32k/USB stuff is for the samd21 but the usb.h file included is from ArduinoCore-atsamd21e18a/bootloaders/zero_osc32k/ATMEL/samr21/include/component. This usb.h file doesn't include the bitfields that are causing the errors. I've found that copying the usb.h from ArduinoCore-atsamd21e18a/bootloaders/zero_osc32k/ATMEL/samd21/include/component to the samr21/include/component dir fixes the problem. What's actually wrong is up for interpretation, the arduino_osc32k/USB should probably reference some samr21 thing instead of samd21. As far as I can tell the USB hardware is the same on the samd and samr so I think everything should be ok.

If Alex wants I can create a pull request to fix this in the repository.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/femtoduino/ArduinoCore-atsamd21e18a/issues/26#issuecomment-434502903, or mute the thread https://github.com/notifications/unsubscribe-auth/AAaLbK3mq4n8_xZz7wsnRo0Wb5y36zWaks5uqNvsgaJpZM4XlHBu .