compile NodeManager for STM32F103C8 but I get error:



  • Hello, please help me,
    I need to compile NodeManager for STM32F103C8 but I get error:

    In file included from C:\Users\adampr\Documents\arduino-1.8.8\Portable\sketchbook\libraries\MySensors_NodeManager1.9/MySensors_NodeManager.h:91:0,
    
                     from C:\Users\adampr\Documents\arduino-1.8.8\Portable\sketchbook\MyS_NM_GW_STM32F103_RS485-test\MyS_NM_GW_STM32F103_RS485-test.ino:177:
    
    C:\Users\adampr\Documents\arduino-1.8.8\Portable\sketchbook\libraries\MySensors_NodeManager1.9/nodemanager/Timer.cpp: In member function 'bool Timer::isOver()':
    
    C:\Users\adampr\Documents\arduino-1.8.8\Portable\sketchbook\libraries\MySensors_NodeManager1.9/nodemanager/Timer.cpp:82:15: error: 'DO_NOT_REPORT' was not declared in this scope
    
      if (_mode == DO_NOT_REPORT || _mode == NOT_CONFIGURED) return false;
    
                   ^
    
    C:\Users\adampr\Documents\arduino-1.8.8\Portable\sketchbook\libraries\MySensors_NodeManager1.9/nodemanager/Timer.cpp:82:41: error: 'NOT_CONFIGURED' was not declared in this scope
    
      if (_mode == DO_NOT_REPORT || _mode == NOT_CONFIGURED) return false;
    
                                             ^
    
    C:\Users\adampr\Documents\arduino-1.8.8\Portable\sketchbook\libraries\MySensors_NodeManager1.9/nodemanager/Timer.cpp:84:15: error: 'IMMEDIATELY' was not declared in this scope
    
      if (_mode == IMMEDIATELY) return true;
    
                   ^
    
    C:\Users\adampr\Documents\arduino-1.8.8\Portable\sketchbook\libraries\MySensors_NodeManager1.9/nodemanager/Timer.cpp:111:15: error: 'TIME_INTERVAL' was not declared in this scope
    
      if (_mode == TIME_INTERVAL) {
    
                   ^ 
    

    This same code compiled for ArduinoNano make no problem and also standard Sketch from MySensors examples (GatewaySerialRS485) compiled for STM32F103C8 work perfect. Only when I compile NodeManager for STM32F103C8 I got that error.
    Many other sketch compiled for Arduino Uno, Pro Mini with RS485, NRF24 and RFM69, RFM95 with NodeManager are compiled with no errors.

    My Arduino IDE 1.8.8
    My NodeManager 1.9

    Best regards

    Adam.



  • First compilation error problem solved - maple library (STM32duino) use keyword "Timer" and that provide conflict with "Timer" from NodeManager.
    I just changed ALL "Timer" and "timer" to "Tajmer" and "tajmer" (polish speel of "timer" 🙂 ) in NodeManager files - (also Timer.h and Timer.ccp to Tajmer.h and Tajmer.ccp)

    Second problem is with analog reference for ADC converter. In STM32 we have no choice to select external or internal Vref and DEFAULT in Node.h (NodeManager) need to be modified:

    184	uint8_t _analog_reference = DEFAULT;
    

    to

    184 #if defined(ARDUINO_ARCH_STM32F1)
    185	uint8_t _analog_reference = -1;
    186 #else
    187	uint8_t _analog_reference = DEFAULT;
    188 #endif
    

    and in the file SensorAnalogInput.h we need to modify:

    33   int _range_max = 1024;
    

    to

    33   #if defined(ARDUINO_ARCH_STM32F1)
    34	  int _range_max = 4096;
    35   #else
    36	  int _range_max = 1024;
    37   #endif
    

    ADC in STM32 is 12bit with range 0-4096.

    Another thing is that presence of gateway need to by delayed because of USB reset and presence to controller. Without delay, controller (in my situation Domoticz on RaspberryPi) need few seconds to manage "virtual maple com port" on USB, gateway presence message from STM32 is already sent but not received by Domoticz. Simple fixed by uncomment (and modified from 5000 to 2000) :

    define MY_TRANSPORT_WAIT_READY_MS  2000
    

    But still problem when using sensors with interrupts eg. SensorDoor, SensorMotion, SensorInterrupt - also compilation problem with STM32 because of different interrupts constructions as by AVR - need to be solved.

    best regards -
    Adam

    PS. I'm not programmer - more CTRL-C CTRL-V 🙂
    Please feel free to correct and modify.

    why bluepile -

    1. cheap,
    2. USB on board - very simple programming over STM32duino bootloader - hardware serial port,
    3. second hardware serial port for RS485
    4. many pins with 5V compatibility.

  • Contest Winner

    @adampr1 thanks for letting me know. There are definitely a few issues with NodeManager on STM32 that need to be solved (https://github.com/mysensors/NodeManager/issues?utf8=✓&q=stm32)
    and specifically for the first problem I've added a reference to the existing ticket https://github.com/mysensors/NodeManager/issues/460.
    It will for definitely be fixed in the next release. Thanks!



  • Awesome, another STM32 NodeManager user! I've worked on getting a node up on the HiTiny board with several sensors to monitor temperature and humidity in a few rooms while working out some additional hardware configurations to add more sensors to several STM32 boards, both the HyTinys and the Bluepills.

    I'll be interested in hearing more about your adventures! BTW, if your board only has one SPI interface there was a bug in the Arduino_STM32code that would cause the board to crash whenever it tried to synch the clock so be sure to grab the latest of Rodger's code as he just merged in the fix a few weeks ago.

    Mitch


Log in to reply
 

Suggested Topics

  • 2
  • 2
  • 4
  • 2
  • 1
  • 1

11
Online

11.4k
Users

11.1k
Topics

112.7k
Posts