arduino-libraries / Arduino_PowerManagement

Mozilla Public License 2.0
11 stars 2 forks source link

`enableWakeupFromPin()`, `enableSleepWhenIdle()` and `enableWakeupFromRTC()` not accessible on `arduino:mbed_nicla:nicla_vision` #4

Closed aliphys closed 3 months ago

aliphys commented 5 months ago

Currently none of the three examples compile for the Nicla Vision arduino:mbed_nicla:nicla_vision.

Battery.ino [arduino-libraries/Arduino_PowerManagement/examples/Battery/Battery.ino](https://github.com/arduino-libraries/Arduino_PowerManagement/blob/83f2f3f608381e14618948c3cd113096531ed658/examples/Battery/Battery.ino) ``` PS C:\GitHub\Arduino\Arduino_PowerManagement> arduino-cli compile -b arduino:mbed_nicla:nicla_vision ./examples/Battery -u -p COM14 --library ./ --library ..\Arduino_LowPowerPortentaC33\ --library ..\Arduino_LowPowerPortentaH7\ WARNING: library Arduino_LowPowerPortentaH7 claims to run on mbed_portenta architecture(s) and may be incompatible with your current board which runs on mbed_nicla architecture(s). C:\GitHub\Arduino\Arduino_PowerManagement\src\Board.cpp:128:33: error: no 'void Board::enableWakeupFromPin()' member function declared in class 'Board' void Board::enableWakeupFromPin(){ ^ C:\GitHub\Arduino\Arduino_PowerManagement\src\Board.cpp:132:33: error: no 'void Board::enableSleepWhenIdle()' member function declared in class 'Board' void Board::enableSleepWhenIdle(){ ^ C:\GitHub\Arduino\Arduino_PowerManagement\src\Board.cpp:181:83: error: no 'bool Board::enableWakeupFromRTC(uint32_t, uint32_t, uint32_t)' member function declared in class 'Board' bool Board::enableWakeupFromRTC(uint32_t hours, uint32_t minutes, uint32_t seconds){ ^ Multiple libraries were found for "Arduino_LowPowerPortentaH7.h" Used: C:\GitHub\Arduino\Arduino_LowPowerPortentaH7 Not used: C:\Users\Ali Jahangiri\Documents\Arduino\libraries\Arduino_LowPowerPortentaH7 Used library Version Path Arduino_PowerManagement 1.0.0 C:\GitHub\Arduino\Arduino_PowerManagement Wire C:\Users\Ali Jahangiri\AppData\Local\Arduino15\packages\arduino\hardware\mbed_nicla\4.1.3\libraries\Wire Arduino_PF1550 0.3.1 C:\Users\Ali Jahangiri\Documents\Arduino\libraries\Arduino_PF1550 Arduino_LowPowerPortentaH7 1.0.0 C:\GitHub\Arduino\Arduino_LowPowerPortentaH7 Used platform Version Path arduino:mbed_nicla 4.1.3 C:\Users\Ali Jahangiri\AppData\Local\Arduino15\packages\arduino\hardware\mbed_nicla\4.1.3 Error during build: exit status 1 ```
Charger.ino [arduino-libraries/Arduino_PowerManagement/examples/Charger/Charger.ino](https://github.com/arduino-libraries/Arduino_PowerManagement/blob/83f2f3f608381e14618948c3cd113096531ed658/examples/Charger/Charger.ino) ``` PS C:\GitHub\Arduino\Arduino_PowerManagement> arduino-cli compile -b arduino:mbed_nicla:nicla_vision ./examples/Charger -u -p COM14 --library ./ --library ..\Arduino_LowPowerPortentaC33\ --library ..\Arduino_LowPowerPortentaH7\ WARNING: library Arduino_LowPowerPortentaH7 claims to run on mbed_portenta architecture(s) and may be incompatible with your current board which runs on mbed_nicla architecture(s). C:\GitHub\Arduino\Arduino_PowerManagement\src\Board.cpp:128:33: error: no 'void Board::enableWakeupFromPin()' member function declared in class 'Board' void Board::enableWakeupFromPin(){ ^ C:\GitHub\Arduino\Arduino_PowerManagement\src\Board.cpp:132:33: error: no 'void Board::enableSleepWhenIdle()' member function declared in class 'Board' void Board::enableSleepWhenIdle(){ ^ C:\GitHub\Arduino\Arduino_PowerManagement\src\Board.cpp:181:83: error: no 'bool Board::enableWakeupFromRTC(uint32_t, uint32_t, uint32_t)' member function declared in class 'Board' bool Board::enableWakeupFromRTC(uint32_t hours, uint32_t minutes, uint32_t seconds){ ^ Multiple libraries were found for "Arduino_LowPowerPortentaH7.h" Used: C:\GitHub\Arduino\Arduino_LowPowerPortentaH7 Not used: C:\Users\Ali Jahangiri\Documents\Arduino\libraries\Arduino_LowPowerPortentaH7 Used library Version Path Arduino_PowerManagement 1.0.0 C:\GitHub\Arduino\Arduino_PowerManagement Wire C:\Users\Ali Jahangiri\AppData\Local\Arduino15\packages\arduino\hardware\mbed_nicla\4.1.3\libraries\Wire Arduino_PF1550 0.3.1 C:\Users\Ali Jahangiri\Documents\Arduino\libraries\Arduino_PF1550 Arduino_LowPowerPortentaH7 1.0.0 C:\GitHub\Arduino\Arduino_LowPowerPortentaH7 Used platform Version Path arduino:mbed_nicla 4.1.3 C:\Users\Ali Jahangiri\AppData\Local\Arduino15\packages\arduino\hardware\mbed_nicla\4.1.3 Error during build: exit status 1 ```
Standby_WakeFromPin.ino [arduino-libraries/Arduino_PowerManagement/examples/Standby_WakeFromPin/Standby_WakeFromPin.ino](https://github.com/arduino-libraries/Arduino_PowerManagement/blob/83f2f3f608381e14618948c3cd113096531ed658/examples/Standby_WakeFromPin/Standby_WakeFromPin.ino) ``` PS C:\GitHub\Arduino\Arduino_PowerManagement> arduino-cli compile -b arduino:mbed_nicla:nicla_vision .\examples\Standby_WakeFromPin\ -u -p COM14 --library ./ --library ..\Arduino_LowPowerPortentaC33\ --library ..\Arduino_LowPowerPortentaH7\ WARNING: library Arduino_LowPowerPortentaH7 claims to run on mbed_portenta architecture(s) and may be incompatible with your current board which runs on mbed_nicla architecture(s). C:\GitHub\Arduino\Arduino_PowerManagement\examples\Standby_WakeFromPin\Standby_WakeFromPin.ino: In function 'void setup()': C:\GitHub\Arduino\Arduino_PowerManagement\examples\Standby_WakeFromPin\Standby_WakeFromPin.ino:27:15: error: 'class Board' has no member named 'enableWakeupFromPin' board.enableWakeupFromPin(); ^~~~~~~~~~~~~~~~~~~ Multiple libraries were found for "Arduino_LowPowerPortentaH7.h" Used: C:\GitHub\Arduino\Arduino_LowPowerPortentaH7 Not used: C:\Users\Ali Jahangiri\Documents\Arduino\libraries\Arduino_LowPowerPortentaH7 Used library Version Path Arduino_PowerManagement 1.0.0 C:\GitHub\Arduino\Arduino_PowerManagement Wire C:\Users\Ali Jahangiri\AppData\Local\Arduino15\packages\arduino\hardware\mbed_nicla\4.1.3\libraries\Wire Arduino_PF1550 0.3.1 C:\Users\Ali Jahangiri\Documents\Arduino\libraries\Arduino_PF1550 Arduino_LowPowerPortentaH7 1.0.0 C:\GitHub\Arduino\Arduino_LowPowerPortentaH7 Used platform Version Path arduino:mbed_nicla 4.1.3 C:\Users\Ali Jahangiri\AppData\Local\Arduino15\packages\arduino\hardware\mbed_nicla\4.1.3 Error during build: exit status 1 ```

As can be seen from the examples, the following member functions of Board are not accessible to the compiler.

C:\GitHub\Arduino\Arduino_PowerManagement\src\Board.cpp:128:33: error: no 'void Board::enableWakeupFromPin()' member function declared in class 'Board'
 void Board::enableWakeupFromPin(){
                                 ^
C:\GitHub\Arduino\Arduino_PowerManagement\src\Board.cpp:132:33: error: no 'void Board::enableSleepWhenIdle()' member function declared in class 'Board'
 void Board::enableSleepWhenIdle(){
                                 ^
C:\GitHub\Arduino\Arduino_PowerManagement\src\Board.cpp:181:83: error: no 'bool Board::enableWakeupFromRTC(uint32_t, uint32_t, uint32_t)' member function declared in class 'Board'
 bool Board::enableWakeupFromRTC(uint32_t hours, uint32_t minutes, uint32_t seconds){

This seems to be an issue with defining the following methods:


Software Version
arduino-cli 1.0.0-rc.1
arduino:mbed_nicla 4.1.3
Arduino_PowerManagement 83f2f3f
Arduino_PF1550 0,3,1
Arduino_LowPowerPortentaH7 2c68a63
Arduino_LowPowerPortentaC33 8811c6c

Note that the Stanadby_wakeFromRTC_C33 and Stanadby_wakeFromRTC_H7 sketches don't compile, but are not an issue since they are not designed to work with the Nicla Vision by design. Also, the methods are accessible when the platform is set to arduino:mbed_portenta:envie_m7 (Portenta H7) or arduino:renesas_portenta:portenta_c33 (Portenta C33).

aliphys commented 3 months ago

@cristidragomir97 potentially fixed issue in https://github.com/arduino-libraries/Arduino_PowerManagement/commit/8c879eab81c8bad771c78e9dd7d6706dfedf7a64 🎉

Will be resolved when merged into main branch

aliphys commented 3 months ago

Compilation check with @cristidragomir97 with https://github.com/arduino-libraries/Arduino_PowerManagement/commit/8c879eab81c8bad771c78e9dd7d6706dfedf7a64 ✅ Battery ✅ Charger 🚫 Standby_WakeFromPin

Battery and Charger sketches do not rely on low power features, so they should compile. Standby_WakeFromPin compilation witht the Nicla Vision will be covered in the future