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. General Discussion
  3. STM32 - 2. SPI-Bus

STM32 - 2. SPI-Bus

Scheduled Pinned Locked Moved General Discussion
3 Posts 2 Posters 1.2k 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.
  • H Offline
    H Offline
    hyx
    wrote on last edited by
    #1

    Hi,
    I have an RFM69 and an MFRC522 card reader (with different SS) on the STM32. Unfortunately, the RFM has some problems as soon as the card reader is attached to the SPI.
    Now the STM32 has several SPI, unfortunately I lack some programming knowledge to change the source code of the affected libraries to change one to port 2.
    I have seen the example of the STM32 Arduino library, but I don't know how I could "incorporate" it into the mysensors.
    Maybe it's quite simple (if you know how)?
    greetings

    Hyx

    mfalkviddM 1 Reply Last reply
    0
    • H hyx

      Hi,
      I have an RFM69 and an MFRC522 card reader (with different SS) on the STM32. Unfortunately, the RFM has some problems as soon as the card reader is attached to the SPI.
      Now the STM32 has several SPI, unfortunately I lack some programming knowledge to change the source code of the affected libraries to change one to port 2.
      I have seen the example of the STM32 Arduino library, but I don't know how I could "incorporate" it into the mysensors.
      Maybe it's quite simple (if you know how)?
      greetings

      Hyx

      mfalkviddM Offline
      mfalkviddM Offline
      mfalkvidd
      Mod
      wrote on last edited by mfalkvidd
      #2

      Hi @hyx, welcome to the forum!

      I have not tried it, but it might not be harder than adding

      #include <SPI.h>
      
      SPIClass SPI_2(2); //Create an SPI2 object.
      #define RFM69_SPI SPI_2
      

      before including MySensors.h

      And modify line 108 in https://github.com/mysensors/MySensors/blob/development/drivers/RFM69/new/RFM69_new.h so RFM69_SPI doesn't get redefined (add an ifndef around it).

      Reference: https://www.stm32duino.com/viewtopic.php?t=278

      An alternative (less elegant but maybe easier) could be to use softspi.

      1 Reply Last reply
      0
      • H Offline
        H Offline
        hyx
        wrote on last edited by
        #3

        Hi,

        wow, quick answer.
        I'm on the way right now, I'm testing it Friday.
        (It would be a real shame to take softspi by this controller. ;-) )
        Thank you, hyx

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


        11

        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