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. Development
  3. How to make/complie MYSBootloader

How to make/complie MYSBootloader

Scheduled Pinned Locked Moved Development
11 Posts 4 Posters 4.9k 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.
  • D Offline
    D Offline
    Dirk_H
    Contest Winner
    wrote on last edited by
    #1

    Hello,

    I'm trying to make / build the MYSBootloader. There seem to be various problems with the make file and maybe also some parts of the code?

    I altered the makefile:
    1.) changed BINPATH to my bin path (obviously good idea).
    2.) I commented out the Java stuff, since it is not used and I dont have Java installed
    3.) I added the ../libraries/MySensors/utility folder to include because nRF24L01.h was not found (btw. is this ok?)
    4.) I had to change the -x c to -x c++ because I assume c++ is used (class type is unknown to c)
    5.) I exchanged #include arduino.h and Wprogram.h to #include <stdint.h> #include <stddef.h> #include <stdlib.h>

    now my avr-gcc command is:

    "D:/Program Files (x86)/arduino-1.6.1/hardware/tools/avr/bin/avr-gcc" -x c++ -mno-interrupts -funsigned-char -funsigned-bitfields -DF_CPU=16000000L -Os -fno-inline-small-functions -fno-split-wide-types -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -Wall -mmcu=atmega328p -c -std=gnu99 -MD -MP -MF "MYSBootloader.d" -MT"MYSBootloader.d" -MT"MYSBootloader.o"  -I../libraries/MySensors -I../libraries/MySensors/utility MYSBootloader.c -o MYSBootloader.o
    

    It starts to compile but I get tons of errors, some examples:
    MYSBootloaderHW.h:21:17: error: redeclaration of C++ built-in type 'bool'
    MYSBootloaderRF24.h:7:30: error: redeclaration of 'RF24_PA_MIN' (actually the whole typedef rf24_pa_dbm_e seems to get redeclarded)

    Can anyoune (@tekka) give me some hints what I'm doing wrong? Usually I use Atmel Studio where I dont have to bother with makefiles, so I'm no expert here.

    Thanks for your help
    Dirk H.

    OitzuO 1 Reply Last reply
    0
    • D Dirk_H

      Hello,

      I'm trying to make / build the MYSBootloader. There seem to be various problems with the make file and maybe also some parts of the code?

      I altered the makefile:
      1.) changed BINPATH to my bin path (obviously good idea).
      2.) I commented out the Java stuff, since it is not used and I dont have Java installed
      3.) I added the ../libraries/MySensors/utility folder to include because nRF24L01.h was not found (btw. is this ok?)
      4.) I had to change the -x c to -x c++ because I assume c++ is used (class type is unknown to c)
      5.) I exchanged #include arduino.h and Wprogram.h to #include <stdint.h> #include <stddef.h> #include <stdlib.h>

      now my avr-gcc command is:

      "D:/Program Files (x86)/arduino-1.6.1/hardware/tools/avr/bin/avr-gcc" -x c++ -mno-interrupts -funsigned-char -funsigned-bitfields -DF_CPU=16000000L -Os -fno-inline-small-functions -fno-split-wide-types -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -Wall -mmcu=atmega328p -c -std=gnu99 -MD -MP -MF "MYSBootloader.d" -MT"MYSBootloader.d" -MT"MYSBootloader.o"  -I../libraries/MySensors -I../libraries/MySensors/utility MYSBootloader.c -o MYSBootloader.o
      

      It starts to compile but I get tons of errors, some examples:
      MYSBootloaderHW.h:21:17: error: redeclaration of C++ built-in type 'bool'
      MYSBootloaderRF24.h:7:30: error: redeclaration of 'RF24_PA_MIN' (actually the whole typedef rf24_pa_dbm_e seems to get redeclarded)

      Can anyoune (@tekka) give me some hints what I'm doing wrong? Usually I use Atmel Studio where I dont have to bother with makefiles, so I'm no expert here.

      Thanks for your help
      Dirk H.

      OitzuO Offline
      OitzuO Offline
      Oitzu
      wrote on last edited by
      #2

      @Dirk_H i had a hard time compiling it, too. Based on the output I'm assuming you are using the 1.5 library? AFAIK the MYSBootloader code isn't up to date. Try to use the 1.4 library.

      1 Reply Last reply
      0
      • siklosiS Offline
        siklosiS Offline
        siklosi
        wrote on last edited by
        #3

        I also had problems with compiling mysbootloader. I tried now with Dirk's command and 1.4.2 library and it's also displaying a lot of conflicting declarations. If someone find's some solution it would be great. I also tried compiling from linux few days ago without success :disappointed:

        OitzuO 1 Reply Last reply
        0
        • siklosiS siklosi

          I also had problems with compiling mysbootloader. I tried now with Dirk's command and 1.4.2 library and it's also displaying a lot of conflicting declarations. If someone find's some solution it would be great. I also tried compiling from linux few days ago without success :disappointed:

          OitzuO Offline
          OitzuO Offline
          Oitzu
          wrote on last edited by
          #4

          @siklosi said:

          I also had problems with compiling mysbootloader. I tried now with Dirk's command and 1.4.2 library and it's also displaying a lot of conflicting declarations. If someone find's some solution it would be great. I also tried compiling from linux few days ago without success :disappointed:

          I got it compiling about a month ago. I cloned the 1.4.2 libs (https://github.com/mysensors/Arduino/tree/1.4.2). Changed the makefile to include my local copy of the RF24 libs... and done.
          I've done this on a linux box.

          1 Reply Last reply
          0
          • OitzuO Offline
            OitzuO Offline
            Oitzu
            wrote on last edited by
            #5

            I've looked back at the code i compiled. It should be noted that there is also an error in the Makefile.

            Line 36:

            CFLAGS = -x c -mno-interrupts -funsigned-char -funsigned-bitfields -DF_CPU=$(CLK)-Os -fno-inline-small-functions -fno-split-wide-types -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -Wall -mmcu=$(MCU) -c -std=gnu99 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)"
            

            should be:

            CFLAGS = -x c -mno-interrupts -funsigned-char -funsigned-bitfields -DF_CPU=$(CLK) -Os -fno-inline-small-functions -fno-split-wide-types -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -Wall -mmcu=$(MCU) -c -std=gnu99 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)"
            

            (There is a space missing in fron of the -Os option.)

            D 1 Reply Last reply
            0
            • OitzuO Oitzu

              I've looked back at the code i compiled. It should be noted that there is also an error in the Makefile.

              Line 36:

              CFLAGS = -x c -mno-interrupts -funsigned-char -funsigned-bitfields -DF_CPU=$(CLK)-Os -fno-inline-small-functions -fno-split-wide-types -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -Wall -mmcu=$(MCU) -c -std=gnu99 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)"
              

              should be:

              CFLAGS = -x c -mno-interrupts -funsigned-char -funsigned-bitfields -DF_CPU=$(CLK) -Os -fno-inline-small-functions -fno-split-wide-types -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -Wall -mmcu=$(MCU) -c -std=gnu99 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)"
              

              (There is a space missing in fron of the -Os option.)

              D Offline
              D Offline
              Dirk_H
              Contest Winner
              wrote on last edited by
              #6

              @Oitzu said:

              [..]

              CFLAGS = -x c -mno-interrupts -funsigned-char -funsigned-bitfields -DF_CPU=$(CLK) -Os -fno-inline-small-functions -fno-split-wide-types -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -Wall -mmcu=$(MCU) -c -std=gnu99 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)"
              

              (There is a space missing in fron of the -Os option.)

              I already found the space before the -Os, but I'm wondering that the -x c argument is ok..? I left it like that at first but got an error message that "class" in an unknown variable type or something like that. This sounded ok for me because in plain c there are no classes. So I thought I've to switch to -x c++. Any Ideas about that? Or shouldn't it reallly matter?

              At the moment I tried with MYSensors 1.4, where it complains that it cannot find <SPI.h> . I've to search for that one as I dont know where the compiler gets libraries that are in <>. As already said I'm really a rookie in this area...

              See you later, hopefully :)

              OitzuO 1 Reply Last reply
              0
              • siklosiS Offline
                siklosiS Offline
                siklosi
                wrote on last edited by
                #7

                I succeeded compiling MYSBootloader with Oitzu's help. I have compiled MYSbootloader for 8 and 16Mhz for all 127 channels. Here is archive... so you can try it. I have not yet tested it but it should be working
                https://www.dropbox.com/s/0gjxp9wl2uukj4y/Mysbootloader-8-16-1-127.zip?dl=1

                petewillP 1 Reply Last reply
                0
                • D Dirk_H

                  @Oitzu said:

                  [..]

                  CFLAGS = -x c -mno-interrupts -funsigned-char -funsigned-bitfields -DF_CPU=$(CLK) -Os -fno-inline-small-functions -fno-split-wide-types -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -Wall -mmcu=$(MCU) -c -std=gnu99 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)"
                  

                  (There is a space missing in fron of the -Os option.)

                  I already found the space before the -Os, but I'm wondering that the -x c argument is ok..? I left it like that at first but got an error message that "class" in an unknown variable type or something like that. This sounded ok for me because in plain c there are no classes. So I thought I've to switch to -x c++. Any Ideas about that? Or shouldn't it reallly matter?

                  At the moment I tried with MYSensors 1.4, where it complains that it cannot find <SPI.h> . I've to search for that one as I dont know where the compiler gets libraries that are in <>. As already said I'm really a rookie in this area...

                  See you later, hopefully :)

                  OitzuO Offline
                  OitzuO Offline
                  Oitzu
                  wrote on last edited by
                  #8

                  @Dirk_H said:

                  I already found the space before the -Os, but I'm wondering that the -x c argument is ok..? I left it like that at first but got an error message that "class" in an unknown variable type or something like that. This sounded ok for me because in plain c there are no classes. So I thought I've to switch to -x c++. Any Ideas about that? Or shouldn't it reallly matter?

                  I really don't know if the Bootloader will compile in any way against the 1.5 libs. Its written against the 1.4.2 libs.

                  At the moment I tried with MYSensors 1.4, where it complains that it cannot find <SPI.h> . I've to search for that one as I dont know where the compiler gets libraries that are in <>. As already said I'm really a rookie in this area...

                  See you later, hopefully :)

                  Well my SPI.h is under /usr/share/arduino/libraries/SPI/SPI.h.
                  I have the debian packages "arduino-core" and "arduino-mk" installed.

                  1 Reply Last reply
                  0
                  • D Offline
                    D Offline
                    Dirk_H
                    Contest Winner
                    wrote on last edited by Dirk_H
                    #9

                    HI,

                    I don't get it running.... :(
                    At the moment I dont know what I could do. Im trying to build it with the avr-gcc that came with arduino 1.6 and MySensors 1.4.2. Maybe it just dont works with Arduino... I dont know.

                    Can anyone at least sayif it should be "-x c" or "-x c++"?

                    I get tons of "conflicting declaration 'typedef uint8_t boolean" and error: redeclaration of 'RF24_PA_LOW'. maybe I'm including too much or the wrong things?

                    My current command for use with ARduino 1.6 environment (of cause I'm not actually using Arduino) is

                    "D:/Program Files (x86)/arduino-1.6.1/hardware/tools/avr/bin/avr-gcc" -x c++ -mno-interrupts -funsigned-char -funsigned-bitfields -DF_CPU=16000000L -Os -DARDUINO=10601 -fno-inline-small-functions -fno-split-wide-types -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -Wall -mmcu=atmega328p -c -std=gnu99 -MD -MP -MF "MYSBootloader.d" -MT"MYSBootloader.d" -MT"MYSBootloader.o"   -I../libraries/MySensors -I../libraries/MySensors/utility -I"D:/Program Files (x86)/arduino-1.6.1/hardware/arduino/avr/libraries/SPI" -I"D:/Program Files (x86)/arduino-1.6.1/hardware/arduino/avr/cores/arduino" -I"D:/Program Files (x86)/arduino-1.6.1/hardware/arduino/avr/variants/mega" -I"D:/Program Files (x86)/arduino-1.6.1/hardware/arduino/avr/cores/arduino/WInterrupts.c" MYSBootloader.c -o MYSBootloader.o
                    

                    Any help (still) greatly appreciated.
                    Dirk H.

                    1 Reply Last reply
                    0
                    • D Offline
                      D Offline
                      Dirk_H
                      Contest Winner
                      wrote on last edited by
                      #10

                      @siklosi could you please share your makefile and describe your building environment (linux? which packets installed?). I stil dont get any success... :'(

                      1 Reply Last reply
                      0
                      • siklosiS siklosi

                        I succeeded compiling MYSBootloader with Oitzu's help. I have compiled MYSbootloader for 8 and 16Mhz for all 127 channels. Here is archive... so you can try it. I have not yet tested it but it should be working
                        https://www.dropbox.com/s/0gjxp9wl2uukj4y/Mysbootloader-8-16-1-127.zip?dl=1

                        petewillP Offline
                        petewillP Offline
                        petewill
                        Admin
                        wrote on last edited by
                        #11

                        @siklosi said:

                        I succeeded compiling MYSBootloader with Oitzu's help. I have compiled MYSbootloader for 8 and 16Mhz for all 127 channels. Here is archive... so you can try it. I have not yet tested it but it should be working
                        https://www.dropbox.com/s/0gjxp9wl2uukj4y/Mysbootloader-8-16-1-127.zip?dl=1

                        Thanks for posting this! It didn't work for me when I tried with an UNO but it did when I used the USBASP V2.0. Thanks again!

                        My "How To" home automation video channel: https://www.youtube.com/channel/UCq_Evyh5PQALx4m4CQuxqkA

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


                        15

                        Online

                        11.7k

                        Users

                        11.2k

                        Topics

                        113.0k

                        Posts


                        Copyright 2019 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