Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SAMD boards compilation gets failed with latest release #300

Closed
dhineshkumarmcci opened this issue Jun 21, 2021 · 5 comments
Closed

SAMD boards compilation gets failed with latest release #300

dhineshkumarmcci opened this issue Jun 21, 2021 · 5 comments
Assignees
Labels

Comments

@dhineshkumarmcci
Copy link
Member

With the latest version of library, SAMD boards get build issues. Please find the error logs below.

In file included from C:\Users\dhineshkumar\Documents\Arduino\libraries\Catena-Arduino-Platform\src/Catena4450.h:46:0,
                 from C:\Users\dhineshkumar\Documents\Arduino\libraries\Catena-Arduino-Platform\src/Catena.h:23,
                 from C:\Users\dhineshkumar\Documents\Arduino\libraries\Catena-Arduino-Platform\examples\catena_hello_lora\catena_hello_lora.ino:16:
C:\Users\dhineshkumar\Documents\Arduino\libraries\Catena-Arduino-Platform\src/CatenaWingFram2k.h:150:22: error: 'virtual void McciCatena::CatenaWingFram2k::LoRaWAN::NetSaveSessionState(const SessionState&)' cannot be overloaded
         virtual void NetSaveSessionState(
                      ^
C:\Users\dhineshkumar\Documents\Arduino\libraries\Catena-Arduino-Platform\src/CatenaWingFram2k.h:147:15: error: with 'virtual void McciCatena::CatenaWingFram2k::LoRaWAN::NetSaveSessionState(const SessionState&)'
  virtual void NetSaveSessionState(
               ^
@terrillmoore
Copy link
Member

Your commit 7fe5c72 seems to be what's needed.

@terrillmoore
Copy link
Member

When doing the pull request, please set version to 0.21.1-1 (as it will be pre-release 1 for 0.21.1).

@dhineshkumarmcci
Copy link
Member Author

However above fix, did not help SAMD compilation to succeed. We also get build issue on Catena Download which uses Flash in STM32.

In file included from C:\Users\dhineshkumar\Documents\Arduino\libraries\Catena-Arduino-Platform\src\lib\Catena_Download.cpp:22:0:
C:\Users\dhineshkumar\Documents\Arduino\libraries\Catena-Arduino-Platform\src/Catena_Download.h: In static member function 'static constexpr const char* McciCatena::cDownload::getStateName(McciCatena::cDownload::State_t)':
C:\Users\dhineshkumar\Documents\Arduino\libraries\Catena-Arduino-Platform\src/Catena_Download.h:118:9: error: body of constexpr function 'static constexpr const char* McciCatena::cDownload::getStateName(McciCatena::cDownload::State_t)' not a return-statement
         }
         ^
C:\Users\dhineshkumar\Documents\Arduino\libraries\Catena-Arduino-Platform\src\lib\Catena_Download.cpp: In member function 'McciCatena::cDownload::State_t McciCatena::cDownload::fsmDispatch(McciCatena::cDownload::State_t, bool)':
C:\Users\dhineshkumar\Documents\Arduino\libraries\Catena-Arduino-Platform\src\lib\Catena_Download.cpp:368:36: error: 'FLASH' was not declared in this scope
                 if (HAL_IS_BIT_SET(FLASH->PECR, FLASH_PECR_PELOCK))
                                    ^
C:\Users\dhineshkumar\Documents\Arduino\libraries\Catena-Arduino-Platform\src\lib\Catena_Download.cpp:368:49: error: 'FLASH_PECR_PELOCK' was not declared in this scope
                 if (HAL_IS_BIT_SET(FLASH->PECR, FLASH_PECR_PELOCK))
                                                 ^
C:\Users\dhineshkumar\Documents\Arduino\libraries\Catena-Arduino-Platform\src\lib\Catena_Download.cpp:368:66: error: 'HAL_IS_BIT_SET' was not declared in this scope
                 if (HAL_IS_BIT_SET(FLASH->PECR, FLASH_PECR_PELOCK))
                                                                  ^
C:\Users\dhineshkumar\Documents\Arduino\libraries\Catena-Arduino-Platform\src\lib\Catena_Download.cpp:370:46: error: 'FLASH_PEKEY1' was not declared in this scope
                     WRITE_REG(FLASH->PEKEYR, FLASH_PEKEY1);
                                              ^
C:\Users\dhineshkumar\Documents\Arduino\libraries\Catena-Arduino-Platform\src\lib\Catena_Download.cpp:370:58: error: 'WRITE_REG' was not declared in this scope
                     WRITE_REG(FLASH->PEKEYR, FLASH_PEKEY1);
                                                          ^
C:\Users\dhineshkumar\Documents\Arduino\libraries\Catena-Arduino-Platform\src\lib\Catena_Download.cpp:371:46: error: 'FLASH_PEKEY2' was not declared in this scope
                     WRITE_REG(FLASH->PEKEYR, FLASH_PEKEY2);
                                              ^
C:\Users\dhineshkumar\Documents\Arduino\libraries\Catena-Arduino-Platform\src\lib\Catena_Download.cpp:374:17: error: 'FLASH' was not declared in this scope
                 FLASH->PECR &= ~FLASH_PECR_ERASE_Msk;
                 ^
C:\Users\dhineshkumar\Documents\Arduino\libraries\Catena-Arduino-Platform\src\lib\Catena_Download.cpp:374:33: error: 'FLASH_PECR_ERASE_Msk' was not declared in this scope
                 FLASH->PECR &= ~FLASH_PECR_ERASE_Msk;
                                 ^
C:\Users\dhineshkumar\Documents\Arduino\libraries\Catena-Arduino-Platform\src\lib\Catena_Download.cpp:377:21: error: 'FLASH_FLAG_EOP' was not declared in this scope
                     FLASH_FLAG_EOP|FLASH_FLAG_WRPERR|FLASH_FLAG_PGAERR|\
                     ^
C:\Users\dhineshkumar\Documents\Arduino\libraries\Catena-Arduino-Platform\src\lib\Catena_Download.cpp:377:36: error: 'FLASH_FLAG_WRPERR' was not declared in this scope
                     FLASH_FLAG_EOP|FLASH_FLAG_WRPERR|FLASH_FLAG_PGAERR|\
                                    ^
C:\Users\dhineshkumar\Documents\Arduino\libraries\Catena-Arduino-Platform\src\lib\Catena_Download.cpp:377:54: error: 'FLASH_FLAG_PGAERR' was not declared in this scope
                     FLASH_FLAG_EOP|FLASH_FLAG_WRPERR|FLASH_FLAG_PGAERR|\
                                                      ^
C:\Users\dhineshkumar\Documents\Arduino\libraries\Catena-Arduino-Platform\src\lib\Catena_Download.cpp:378:21: error: 'FLASH_FLAG_SIZERR' was not declared in this scope
                     FLASH_FLAG_SIZERR|FLASH_FLAG_OPTVERR|FLASH_FLAG_RDERR|\
                     ^
C:\Users\dhineshkumar\Documents\Arduino\libraries\Catena-Arduino-Platform\src\lib\Catena_Download.cpp:378:39: error: 'FLASH_FLAG_OPTVERR' was not declared in this scope
                     FLASH_FLAG_SIZERR|FLASH_FLAG_OPTVERR|FLASH_FLAG_RDERR|\
                                       ^
C:\Users\dhineshkumar\Documents\Arduino\libraries\Catena-Arduino-Platform\src\lib\Catena_Download.cpp:378:58: error: 'FLASH_FLAG_RDERR' was not declared in this scope
                     FLASH_FLAG_SIZERR|FLASH_FLAG_OPTVERR|FLASH_FLAG_RDERR|\
                                                          ^
C:\Users\dhineshkumar\Documents\Arduino\libraries\Catena-Arduino-Platform\src\lib\Catena_Download.cpp:379:21: error: 'FLASH_FLAG_FWWERR' was not declared in this scope
                     FLASH_FLAG_FWWERR|FLASH_FLAG_NOTZEROERR
                     ^
C:\Users\dhineshkumar\Documents\Arduino\libraries\Catena-Arduino-Platform\src\lib\Catena_Download.cpp:379:39: error: 'FLASH_FLAG_NOTZEROERR' was not declared in this scope
                     FLASH_FLAG_FWWERR|FLASH_FLAG_NOTZEROERR
                                       ^
C:\Users\dhineshkumar\Documents\Arduino\libraries\Catena-Arduino-Platform\src\lib\Catena_Download.cpp:380:21: error: '__HAL_FLASH_CLEAR_FLAG' was not declared in this scope
                     );
                     ^
C:\Users\dhineshkumar\Documents\Arduino\libraries\Catena-Arduino-Platform\src\lib\Catena_Download.cpp:383:32: error: 'HAL_FLASH_Lock' was not declared in this scope
                 HAL_FLASH_Lock();
                                ^
C:\Users\dhineshkumar\Documents\Arduino\libraries\Catena-Arduino-Platform\src\lib\Catena_Download.cpp:385:36: error: 'FLASH_SR_BSY' was not declared in this scope
                 while (FLASH->SR & FLASH_SR_BSY)
                                    ^

Hopefully, adding #if directive for STM32 architecture (ARDUINO_STM32) for Catena_Download.h and Catena_Download.cpp would fix this issue. On using #ifdef ARDUINO_STM32 in Catena_Download source files, able to fix above issue and make build successful.

@terrillmoore would like to have your advice on adding #if directive for these files.

@terrillmoore
Copy link
Member

terrillmoore commented Jun 21, 2021

Yes, well, that's sort of expected, given that we have not implemented the bootloader on SAMD21 at all. For now, add #if, but we should refactor so that the STM32 code is separated out and in the stm32 subdirectory. The downloader should be calling a hardware-specific routine to set the EEPROM flag. I believe that everything else in that module is hardware-independent.

I suppose we had better add "add secure bootloader for SAMD" to our list.

@dhineshkumarmcci
Copy link
Member Author

Thanks Terry, have made the changes and submitted a pull-request #301

terrillmoore added a commit that referenced this issue Jun 30, 2021
Fix #300: fix SAMD build issues with latest release
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants