Skip to content

STM32: compilation error: no SELECT methode #3

Open
@EasyNetDev

Description

@EasyNetDev

Hi,

After fixing #2 manually (until the PR will be pushed to the main source) I've tried to continue to compile the sources.
The source code:

#include <LwIP.h>
#include <OpenMRNLite.h>


void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

I'm receiving this error:

In file included from /home/adrian/Arduino/libraries/OpenMRNLite/src/executor/Executor.hxx:50,
                 from /home/adrian/Arduino/libraries/OpenMRNLite/src/openlcb/SimpleStack.hxx:40,
                 from /home/adrian/Arduino/libraries/OpenMRNLite/src/OpenMRNLite.h:44,
                 from /home/adrian/Nextcloud/Electronic-Projects/Arduino/DCCpp+LCC/DCC_LCC_basestation/DCC_LCC_basestation.ino:6:
/home/adrian/Arduino/libraries/OpenMRNLite/src/os/OSSelectWakeup.hxx:37:70: note: #pragma message: OSSelectWakeup: Starting including OSSelectWakeup
   37 | #pragma message ("OSSelectWakeup: Starting including OSSelectWakeup" )
      |                                                                      ^
/home/adrian/Arduino/libraries/OpenMRNLite/src/os/OSSelectWakeup.hxx:63:68: note: #pragma message: OSSelectWakeup: Ending including OSSelectWakeup
   63 | #pragma message ("OSSelectWakeup: Ending including OSSelectWakeup" )
      |                                                                    ^
/home/adrian/Arduino/libraries/OpenMRNLite/src/os/OSSelectWakeup.hxx: In member function 'int OSSelectWakeup::select(int, _types_fd_set*, _types_fd_set*, _types_fd_set*, long long int)':
/home/adrian/Arduino/libraries/OpenMRNLite/src/os/OSSelectWakeup.hxx:239:16: error: 'ret' was not declared in this scope; did you mean 'creat'?
  239 |         return ret;
      |                ^~~
      |                creat
exit status 1
Error compiling for board Nucleo-144.

The pragma messages I've inserted in the OSSelectWakeup.hxx:

#ifndef _OS_OSSELECTWAKEUP_HXX_
#define _OS_OSSELECTWAKEUP_HXX_

#pragma message ("OSSelectWakeup: Starting including OSSelectWakeup" )

#include <unistd.h>

#include "openmrn_features.h"
#include "utils/Atomic.hxx"
#include "os/os.h"

#if OPENMRN_FEATURE_DEVICE_SELECT
#pragma message ("OSSelectWakeup: Induding Devtab.hxx" )
#include "Devtab.hxx"
#endif

#if OPENMRN_HAVE_PSELECT
#pragma message ("OSSelectWakeup: Induding signal.h" )
#include <signal.h>
#endif

#ifdef __WINNT__
#pragma message ("OSSelectWakeup: Induding winsock2.h" )
#include <winsock2.h>
#elif OPENMRN_HAVE_SELECT
#pragma message ("OSSelectWakeup: Induding sys/select.h" )
#include <sys/select.h>
#endif

#pragma message ("OSSelectWakeup: Ending including OSSelectWakeup" )

And as you can see is actually not selecting any kind of SELECTOR. Going deeper in the code source I've notice those in openmrn_feature.h:

#ifdef __FreeRTOS__
/// Compiles the FreeRTOS event group based ::select() implementation.
#define OPENMRN_FEATURE_DEVICE_SELECT 1
/// Adds implementations for ::read ::write etc, with fd table.
#define OPENMRN_FEATURE_DEVTAB 1
/// Adds struct reent pointer to the FreeRTOS Task Priv structure and swaps it
/// in when the tasks are swapped in.
#define OPENMRN_FEATURE_REENT 1
#endif

/// @todo this should probably be a whitelist: __linux__ || __MACH__.
#if !defined(__FreeRTOS__) && !defined(__WINNT__) && !defined(ESP32) &&        \
    !defined(ARDUINO) && !defined(ESP_NONOS)
/// Uses ::pselect in the Executor for sleep and pkill for waking up.
#define OPENMRN_HAVE_PSELECT 1
#endif

#if defined(__WINNT__) || defined(ESP32) || defined(ESP_NONOS)
/// Uses ::select in the executor to sleep (unsure how wakeup is handled)
#define OPENMRN_HAVE_SELECT 1
#endif

#if defined(OPENMRN_HAVE_SELECT) || defined(OPENMRN_HAVE_PSELECT) || defined(OPENMRN_FEATURE_DEVICE_SELECT)
#define OPENMRN_FEATURE_EXECUTOR_SELECT
#endif

#if (defined(ARDUINO) && !defined(ESP32)) || defined(ESP_NONOS) ||             \
    defined(__EMSCRIPTEN__)
/// A loop() function is calling the executor in the single-threaded OS context.
#define OPENMRN_FEATURE_SINGLE_THREADED 1
#endif

I've noticed that there is no definition for FreeRTOS in "STM32duino FreeRTOS" or in Arduino RTOS.
Second think I can't find any kind in the combination to match the selectors for OPENMRN. That's why, in my opinion, I can't compile at all on STM32.

Kind regards,
Adrian

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions