Forum Replies Created

Viewing 15 posts - 241 through 255 (of 1,033 total)
  • Author
    Posts
  • in reply to: STM32L452 SPI2 port assignation not working #28008
    Renzo Mischianti
    Keymaster

      Hi Nezha,
      your problem. It’s very strange.
      I think you can try to use a “first choice” SPI2 and “second choice” in coherence, like so:

      PB15
      PB14
      PB10

      and

      PC3
      PC2
      PB13

      After that test, you can try the official STMicroelectronics core to check if STM32duino.

      Bye Renzo

      in reply to: STM32L452 SPI2 port assignation not working #27975
      Renzo Mischianti
      Keymaster

        Hi Nezha,
        I write a little article about that and when I do the test, I follow the pinout I retrieve from the STMicroelectronic core code.

        I check your pin selection, and it seems to be ok.

        
        #ifdef HAL_SPI_MODULE_ENABLED
        WEAK const PinMap PinMap_SPI_MOSI[] = {
          {PA_7,      SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
          {PA_12,     SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
          {PB_5,      SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
          {PB_5_ALT1, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
          {PB_15,     SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
          {PC_3,      SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
          {PC_12,     SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
          {NC,        NP,   0}
        };
        #endif
        
        #ifdef HAL_SPI_MODULE_ENABLED
        WEAK const PinMap PinMap_SPI_MISO[] = {
          {PA_6,      SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
          {PA_11,     SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
          {PB_4,      SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
          {PB_4_ALT1, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
          {PB_14,     SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
          {PC_2,      SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
          {PC_11,     SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
          {NC,        NP,   0}
        };
        #endif
        
        #ifdef HAL_SPI_MODULE_ENABLED
        WEAK const PinMap PinMap_SPI_SCLK[] = {
          {PA_1,      SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
          {PA_5,      SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
          {PB_3,      SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
          {PB_3_ALT1, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
          {PB_10,     SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
          {PB_13,     SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
          {PC_10,     SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
          {NC,        NP,   0}
        };
        #endif
        

        The SS isn’t so important but if you can try the default also

        
        // SPI definitions
        #ifndef PIN_SPI_SS
          #define PIN_SPI_SS            PA4
        #endif
        #ifndef PIN_SPI_SS1
          #define PIN_SPI_SS1           PA15
        #endif
        #ifndef PIN_SPI_SS2
          #define PIN_SPI_SS2           PB0
        #endif
        #ifndef PIN_SPI_SS3
          #define PIN_SPI_SS3           PNUM_NOT_DEFINED
        #endif
        #ifndef PIN_SPI_MOSI
          #define PIN_SPI_MOSI          PA7
        #endif
        #ifndef PIN_SPI_MISO
          #define PIN_SPI_MISO          PA6
        #endif
        #ifndef PIN_SPI_SCK
          #define PIN_SPI_SCK           PA1
        #endif
        

        In the code, you begin two times the spi interface, and I think It can generate some problems.
        Try to use a configuration declaration like this

        
        //    SD card attached to the secondary SPI as follows:
        //        SS    = PB2;
        //        MOSI  = PC3;
        //        MISO  = PB15;
        //        SCK   = PB10;
        
        #define SD_CS_PIN PB12
        static SPIClass mySPI2(PC2, PC3, PB10, SD_CS_PIN);
        #define SD2_CONFIG SdSpiConfig(SD_CS_PIN, DEDICATED_SPI, SD_SCK_MHZ(18), &mySPI2)
        

        then only one begin.

        
          // we'll use the initialization code from the utility libraries
          // since we're just testing if the card is working!
          if (!SD.begin(SD2_CONFIG)) {
          // if (!SD.begin(SD_CS_PIN)) {
            Serial.println("initialization failed. Things to check:");
            Serial.println("* is a card inserted?");
            Serial.println("* is your wiring correct?");
            Serial.println("* did you change the chipSelect pin to match your shield or module?");
            while (1);
          } else {
            Serial.println("Wiring is correct and a card is present.");
          }
        
        

        But check the STM32duino core can change the pin.

        Try to use also the example I wrote and tested for the Arduino environment.

        How to use SD card with stm32 and SdFat library

        Bye Renzo

        in reply to: EMailSender not compiling #27964
        Renzo Mischianti
        Keymaster

          Thanks Mark,
          I fixed It.
          Thanks again Renzo

          in reply to: Adapting Lora Water Tank Controller to My Farm #27949
          Renzo Mischianti
          Keymaster

            Hi,
            I share It on PCBWay, not directly Gerber but you can order from PCBWay at the cost of the PCB.
            Bye Renzo

            in reply to: Adapting Lora Water Tank Controller to My Farm #27931
            Renzo Mischianti
            Keymaster

              In the master, you have a Relay with 3 exit
              NO (Normally open) – COM (Input) – NC (Normally close)
              if you put in COM 100v you can use NO e NC to activate an external SSR.

              I think It’s your need.

              in reply to: Adapting Lora Water Tank Controller to My Farm #27926
              Renzo Mischianti
              Keymaster

                Hi John,
                In my farm I using a small pump with high prevalence (70m),

                and it work without problem with the 200w panel I add a charging regulator to send 12v-like specs

                The flow is less than the home water tap, but on a sunny day, fill the 1000l tank.

                Solar panel with voltage regulator and charging battery

                If you follow the indication of the Tank project, you can connect the Master that have two voltage regulator and a batter input connector that can be powered directly from 12v.

                The client has the panel input and a voltage regulator with a rechargeable lithium battery and after it functions It goes into deep sleep.

                This system I think can cover your expectations.

                Bye Renzo

                Renzo Mischianti
                Keymaster

                  Hi DR-DNK,
                  I check the library and it works for me. Try to check your environment.
                  Bye Renzo

                  in reply to: Ambient noise RSSI #27921
                  Renzo Mischianti
                  Keymaster

                    Hi gjb,
                    I wrote a paragraph on how to get RSSI here.
                    Bye Renzo

                    in reply to: Simultaneous use of email + web server #27878
                    Renzo Mischianti
                    Keymaster

                      Hi rs77can,
                      I think there is the possibility that the webserver and email need a good quantity of RAM.
                      What are the specs of the MCU you use?
                      Bye Renzo

                      in reply to: Error compiling Wio_terminal_SdFat code in Arduino IDE. #27877
                      Renzo Mischianti
                      Keymaster

                        Hi,
                        I retest SdFat2 and standard SD, and works correctly.
                        Check if you have some issues in the importing library at compile time.
                        Bye Renzo

                        in reply to: BeePrint and MKS WiFi Firmware releases with ChangeLog #27660
                        Renzo Mischianti
                        Keymaster

                          Hi Jon,
                          I think that there is no response from the firmware, probably the management is different and It can’t work.
                          Bye Renzo

                          in reply to: EByte LoRa Communication encode/decode, crypt/decrypt #27551
                          Renzo Mischianti
                          Keymaster

                            Hi Edge,
                            with some limitation, you can transmit the message, but you must decrypt It I think work only transparent transmission.

                            https://blog.zesanglier.fr/2023/02/11/communiquer-entre-un-module-ebyte-e32-et-un-module-ra01-02-sx1278/

                            not a good idea for a production solution.
                            Bye Renzo

                            in reply to: BeePrint and MKS WiFi Firmware releases with ChangeLog #27550
                            Renzo Mischianti
                            Keymaster

                              Hi jon,
                              you can check on your browser developer tools and go to WS –> Messages and check if the information arrives from the device.
                              Bye Renzo

                              in reply to: E32 Shield on E220 | Help #27435
                              Renzo Mischianti
                              Keymaster

                                Hi Giuseppe,
                                I don’t know which shield you buy, but you can go to the article on the relative shield and get the constructor.
                                Bye Renzo

                                in reply to: looking for a solution to send emails in SSL #27400
                                Renzo Mischianti
                                Keymaster

                                  Hi,
                                  you can find more information on this article.
                                  Bye Renzo

                                Viewing 15 posts - 241 through 255 (of 1,033 total)