Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Hardware
  3. Get STM32 blue pill to run

Get STM32 blue pill to run

Scheduled Pinned Locked Moved Hardware
5 Posts 2 Posters 109 Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • karlheinz2000K Offline
    karlheinz2000K Offline
    karlheinz2000
    wrote on last edited by
    #1

    I struggle since 2 days to get a node based on STM32 to run. It is my first test with STM32. I installed the arduino libs. I can upload "blink" and this works, serial output also.
    But when I include <MySensors.h> the STM seems not to start/run. LED doesn't blink, no output on serial. I would expect some some lib prints on serial, but nothing.
    Compile and upload is with no error.
    It doesn't matter if radio is connected or not.
    Any special things need to be considered for STM32?

    #define MY_DEBUG            //MYSENSOR Lib
    
    #define   MY_TRANSPORT_WAIT_READY_MS   100
    
    #define MY_NODE_ID 49 // id of the node
    //#define MY_PARENT_NODE_ID 55
    //#define MY_PARENT_NODE_IS_STATIC
    
    
    
    // ++++++++++++++ NRF24 +++++++++++++++++
    #define MY_RADIO_NRF24
    
    // This is needed if you use an STM32 board:
    #define MY_RF24_CE_PIN PB0
    
    
    #define MY_DEBUGDEVICE Serial1
    
    #include "MySensors.h"
    #include <SPI.h>
    
    
    /////////////////////////////////////////////////////////////////////////////////////////////////////////////
    ///////////////////////////////// BEFORE ////////////////////////////////////////////////////////////////////
    /////////////////////////////////////////////////////////////////////////////////////////////////////////////
    
    void before()
    {
      Serial1.begin(115200);
      Serial1.print("before");
    }
    
    /////////////////////////////////////////////////////////////////////////////////////////////////////////////
    /////////////////////////////////////// SETUP ///////////////////////////////////////////////////////////////
    /////////////////////////////////////////////////////////////////////////////////////////////////////////////
    
    void setup()
    {
      Serial1.begin(115200);
      Serial1.print("setup");
      
      pinMode(PC13, OUTPUT);
    }
    
    /////////////////////////////////////////////////////////////////////////////////////////////////////////////
    /////////////////////////////////////// LOOP ////////////////////////////////////////////////////////////////
    /////////////////////////////////////////////////////////////////////////////////////////////////////////////
    
    void loop()
    {
    
      digitalWrite(PC13, HIGH);   // turn the LED on (HIGH is the voltage level)
      delay(1000);              // wait for a second
      digitalWrite(PC13, LOW);    // turn the LED off by making the voltage LOW
      delay(1000);              // wait for a second
    
    
    }
    
    1 Reply Last reply
    0
    • fritsF Offline
      fritsF Offline
      frits
      wrote on last edited by
      #2

      Hi,
      I wasn't aware of a MY_DEBUGDEVICE, so I was courious and found this thread:
      https://forum.mysensors.org/topic/9381/no-my_debugdevice-begin
      It basically says you should add MY_DEBUGDEVICE.begin ( baud ) in preHwInit(), then wait until ready...

      1 Reply Last reply
      0
      • karlheinz2000K Offline
        karlheinz2000K Offline
        karlheinz2000
        wrote on last edited by
        #3

        This helped a lot! Got the serial to work. But...

        13:29:37.828 ->  __  __       ____
        13:29:37.828 -> |  \/  |_   _/ ___|  ___ _ __  ___  ___  _ __ ___
        13:29:37.862 -> | |\/| | | | \___ \ / _ \ `_ \/ __|/ _ \| `__/ __|
        13:29:37.862 -> | |  | | |_| |___| |  __/ | | \__ \  _  | |  \__ \
        13:29:37.862 -> |_|  |_|\__, |____/ \___|_| |_|___/\___/|_|  |___/
        13:29:37.862 ->         |___/                      2.4.0-alpha
        13:29:37.862 -> 
        13:29:37.862 -> 18 MCO:BGN:INIT NODE,CP=RNNNM---,FQ=72,REL=0,VER=2.4.0-alpha
        13:29:37.862 -> 29 !MCO:BGN:HW ERR
        

        Looks like these cheap blue pills have some issue with EEPROM?

        I later connected a Maple Mini board, which goes straight to "loop" as expected.

        1 Reply Last reply
        0
        • fritsF Offline
          fritsF Offline
          frits
          wrote on last edited by
          #4

          STM32F1, like SAMD, has no EEPROM as far as I know.

          1 Reply Last reply
          0
          • karlheinz2000K Offline
            karlheinz2000K Offline
            karlheinz2000
            wrote on last edited by
            #5

            Yes, no real EERPOM, but emulation in flash. EEPROM failure was the first finding when checking for this error message. Maybe somthing else...
            Now complete sketch is ported from AVR ProMini to STM32 and is runnig fine :+1:

            1 Reply Last reply
            1
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            31

            Online

            11.7k

            Users

            11.2k

            Topics

            113.1k

            Posts


            Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • MySensors
            • OpenHardware.io
            • Categories
            • Recent
            • Tags
            • Popular