How to make/complie MYSBootloader


  • Contest Winner

    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.



  • @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.



  • 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 😞



  • @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 😞

    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.



  • 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.)


  • Contest Winner

    @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 🙂



  • 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



  • @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.


  • Contest Winner

    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.


  • Contest Winner

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


  • Admin

    @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!


Log in to reply
 

Suggested Topics

  • 1
  • 1
  • 2
  • 5
  • 2
  • 2

0
Online

11.2k
Users

11.1k
Topics

112.5k
Posts