-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from guillebot/development
Multiple compilation made easy
- Loading branch information
Showing
1,331 changed files
with
174,829 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
/* | ||
* MYSBootloader 1.3.0-rc.1 | ||
* OTA RF24 bootloader for MySensors: https://www.mysensors.org | ||
* Based on MySensors library 2.2 | ||
* Developed and maintained by tekka 2018 | ||
* | ||
* Tested with MYSController https://www.mysensors.org/controller/myscontroller | ||
* MCU: ATmega328p | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* version 2 as published by the Free Software Foundation. | ||
* | ||
* ****************************************************************************************************** | ||
* History | ||
* | ||
* v1.3.0-rc.1 | ||
* - Add message length verification | ||
* - Stripped away RF24 communication driver redundancies and generics | ||
* - General maintenance, .hex update | ||
* | ||
* v1.3.0-beta.4 | ||
* - Code optimization => reintroduction of bootloader commands: Akubi | ||
* | ||
* v1.3.0-beta.3 | ||
* - Optimization / Refactorings | ||
* | ||
* v1.3pre | ||
* - redesign update process | ||
* - implement STK500 protocol / serial upload | ||
* - preferred parent with fallback option | ||
* - save MCUSR, can be retrieved by application | ||
* | ||
* v1.2 | ||
* - internal version, PoC | ||
* | ||
* v1.1 | ||
* - use eeprom_update instead of eeprom_write to reduce wear out | ||
* - bootloader commands: erase eeprom, set node id | ||
* - verify incoming FW blocks for type & address | ||
* - communicate over static parent (if set and found) else broadcast to find nearest node | ||
* - adjusted timings | ||
* | ||
* v1.0 | ||
* - initial release | ||
* | ||
* Info: | ||
* BL size max. 2048 bytes - FLASH segment setting: .text=0x3C00 | ||
* | ||
*/ | ||
|
||
// RF24 communication settings ***************************************************************************************** | ||
#define RF24_CHANNEL (${channel}) // RF channel for the sensor net, 0-127; default 76 | ||
#define RF24_DATARATE RF24_250KBPS // RF24_250KBPS for 250kbs, RF24_1MBPS for 1Mbps, or RF24_2MBPS for 2Mbps | ||
#define RF24_PA_LEVEL RF24_PA_MAX // PA level, RF24_PA_MIN=-18dBm, RF24_PA_LOW=-12dBm, RF24_PA_HIGH=-6dBM, and RF24_PA_MAX=0dBm | ||
#define RF24_ADDR_WIDTH (5) | ||
#define RF24_BASE_RADIO_ID 0x00,0xFC,0xE1,0xA8,0xA8 | ||
#define RF24_ARC (15) // Auto Retransmit Counts, see nRF24L01+ data sheet | ||
#define RF24_ARD (5) // Auto Retransmit Delay, 5=1500us, see nRF24L01+ data sheet | ||
|
||
// Options ************************************************************************************************************* | ||
#define WATCHDOG_ON_SKETCH_START // WDT on when application starts | ||
#define WDT_TIMEOUT WATCHDOG_8S // WDT timeout | ||
#define BOOTLOADER_COMMANDS // Enable low level bootloader commands | ||
|
||
// SPI bus setting ***************************************************************************************************** | ||
#define SPI_PINS_CE9_CSN10 | ||
//define SPI_PINS_CSN7_CE8 | ||
//define SPI_PINS_CE7_CSN10 | ||
|
||
// LED settings ******************************************************************************************************** | ||
#define LED_DDR DDRB | ||
#define LED_PORT PORTB | ||
#define LED_PIN PINB5 //NRFDuino uses PIN 9 (PB1) | ||
|
||
// DEBUG settings ****************************************************************************************************** | ||
//#define DEBUG | ||
#define DEBUG_PORT PORTD | ||
#define DEBUG_DDR DDRD | ||
|
||
#include "Core.h" | ||
|
||
// prototype | ||
int main(void) __attribute__ ((OS_main)) __attribute__ ((section (".init9"))); | ||
|
||
// implementation | ||
int main(void) { | ||
asm volatile ("clr __zero_reg__"); | ||
// save the status register for the reset cause | ||
_save_MCUSR = MCUSR; | ||
// reset status register | ||
MCUSR = 0; | ||
// enable watchdog | ||
watchdogConfig(WDT_TIMEOUT); | ||
#ifdef DEBUG | ||
DEBUG_DDR = 0xFF; | ||
DEBUG_PORT = DEBUG_INIT; | ||
#endif | ||
// signal startup | ||
blinkLed(); | ||
// STK500_bootloader runs only if reset reason was EXTERNAL RESET/POWER ON | ||
if (_save_MCUSR & _BV(EXTRF) ) { | ||
STK500Bootloader(); | ||
} | ||
MySensorsBootloader(); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
MYSBootloader.d MYSBootloader.o: MYSBootloader.c Core.h \ | ||
/usr/avr/sys-root/include/string.h /usr/lib64/gcc/avr/7/include/stddef.h \ | ||
/usr/avr/sys-root/include/stdlib.h \ | ||
/usr/avr/sys-root/include/avr/eeprom.h \ | ||
/usr/avr/sys-root/include/avr/io.h \ | ||
/usr/avr/sys-root/include/avr/sfr_defs.h \ | ||
/usr/avr/sys-root/include/inttypes.h /usr/avr/sys-root/include/stdint.h \ | ||
/usr/avr/sys-root/include/avr/iom328p.h \ | ||
/usr/avr/sys-root/include/avr/portpins.h \ | ||
/usr/avr/sys-root/include/avr/common.h \ | ||
/usr/avr/sys-root/include/avr/version.h \ | ||
/usr/avr/sys-root/include/avr/fuse.h \ | ||
/usr/avr/sys-root/include/avr/lock.h \ | ||
/usr/avr/sys-root/include/util/delay.h \ | ||
/usr/avr/sys-root/include/util/delay_basic.h \ | ||
/usr/avr/sys-root/include/math.h Definitions.h boot.h \ | ||
/usr/lib64/gcc/avr/7/include-fixed/limits.h HW.h MyEepromAddresses.h \ | ||
MyMessage.h RF24.h RF24_registers.h STK500Bootloader.h stk500.h \ | ||
MySensorsBootloader.h | ||
|
||
Core.h: | ||
|
||
/usr/avr/sys-root/include/string.h: | ||
|
||
/usr/lib64/gcc/avr/7/include/stddef.h: | ||
|
||
/usr/avr/sys-root/include/stdlib.h: | ||
|
||
/usr/avr/sys-root/include/avr/eeprom.h: | ||
|
||
/usr/avr/sys-root/include/avr/io.h: | ||
|
||
/usr/avr/sys-root/include/avr/sfr_defs.h: | ||
|
||
/usr/avr/sys-root/include/inttypes.h: | ||
|
||
/usr/avr/sys-root/include/stdint.h: | ||
|
||
/usr/avr/sys-root/include/avr/iom328p.h: | ||
|
||
/usr/avr/sys-root/include/avr/portpins.h: | ||
|
||
/usr/avr/sys-root/include/avr/common.h: | ||
|
||
/usr/avr/sys-root/include/avr/version.h: | ||
|
||
/usr/avr/sys-root/include/avr/fuse.h: | ||
|
||
/usr/avr/sys-root/include/avr/lock.h: | ||
|
||
/usr/avr/sys-root/include/util/delay.h: | ||
|
||
/usr/avr/sys-root/include/util/delay_basic.h: | ||
|
||
/usr/avr/sys-root/include/math.h: | ||
|
||
Definitions.h: | ||
|
||
boot.h: | ||
|
||
/usr/lib64/gcc/avr/7/include-fixed/limits.h: | ||
|
||
HW.h: | ||
|
||
MyEepromAddresses.h: | ||
|
||
MyMessage.h: | ||
|
||
RF24.h: | ||
|
||
RF24_registers.h: | ||
|
||
STK500Bootloader.h: | ||
|
||
stk500.h: | ||
|
||
MySensorsBootloader.h: |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
:1078000011E0A0E0B1E0E2EDFFE702C005900D92CB | ||
:10781000A630B107D9F721E0A6E0B1E001C01D9282 | ||
:10782000AD34B207E1F7CDB7DEB72897DEBFCDBFE5 | ||
:10783000112484B78093270114BE88E180936000EF | ||
:1078400089E280936000259A86E020E295B1922734 | ||
:1078500095B93FEF40E792E0315040409040E1F76A | ||
:1078600000C00000815091F78091270181FF72C014 | ||
:1078700082E08093C00088E18093C10086E080931D | ||
:10788000C20080E18093C40010E000E0D12CC12C44 | ||
:10789000AA24AA94BA2C99249394A895F4D181345B | ||
:1078A00071F4F1D1F82E3DD3E2E8FE1202C083E07C | ||
:1078B00004C0F1E885E6FF12FACF2CD304C082346D | ||
:1078C00021F484E13AD3F12C40C0853411F485E0F1 | ||
:1078D000F9CF853541F4D7D1082FD5D1182F000F16 | ||
:1078E000111F1FD3F0CF863521F484E026D380E02A | ||
:1078F000E4CF8436D9F4C7D1C6D1882EC4D1C80C00 | ||
:10790000D11CF12CF81418F0C801C9D1EACFBBD1B1 | ||
:10791000E82EB9D1F801EF0DF11D982F8E2D0C0135 | ||
:1079200097BEE8951124F394F394ECCF843709F0D3 | ||
:1079300089C0A9D1A8D1F82EA6D1F3D2F80185919A | ||
:107940008F01E8D2FA94F110F9CF80E1E3D2FF2061 | ||
:1079500009F4A3CF8EE284B981E58CBD512C412C72 | ||
:1079600077247394AA24AA94BA2C8824839473E06D | ||
:10797000972EEAE06E2EF999FECF43E050E070E0DA | ||
:1079800060E089E291E003D348E050E06BE171E010 | ||
:10799000CE010196FCD229982A9A63E083E2EBD1CA | ||
:1079A0006EE685E2E8D167E286E2E5D163E780E54D | ||
:1079B000E2D164E08DE3DFD161E082E2DCD161E01D | ||
:1079C00081E2D9D161E08CE3D6D121E041E070E0E1 | ||
:1079D00060E086E0A3D18732F9F480912A01809398 | ||
:1079E00028018FEF80932A0180932B018093080157 | ||
:1079F00063E584E2C0D143E26AE087E083D161E0DD | ||
:107A00008EEFD8D1109208016FE584E2B4D1809155 | ||
:107A10002A018F3F09F0A0C08D819E8124E0880F4C | ||
:107A2000991F2A95E1F74DD12F8138858217930749 | ||
:107A300009F0A1CF1CBCA89580912701282EF20146 | ||
:107A4000099599CF853739F46CD28EE163D285E9F7 | ||
:107A500061D28FE032CF813509F043CFBA82A9825B | ||
:107A6000BC82AB82C601F4E096958795FA95E1F762 | ||
:107A70009E838D83C60125D198878F83CE01019681 | ||
:107A800063D24FD2FF24F39460CF870189819A811A | ||
:107A900090930E0180930D018B819C819093100136 | ||
:107AA00080930F01780181E0E81AF108F092120149 | ||
:107AB000E092110144EC62E382E024D163E083E0D0 | ||
:107AC00079D1882309F46BC046E050E063E371E0AC | ||
:107AD0008DE091E04FD2892BC9F6C8018150904FBB | ||
:107AE000682F62956077ACE2B1E0462F50E04C52CF | ||
:107AF0005140FA01EA0FFB1F1E963C911E971D96FE | ||
:107B00002C911D97090177BEE89511241296E1E0AA | ||
:107B1000AC33BE0771F7611106C044E0880F991FAE | ||
:107B20004A95E1F7BCD0E114F10409F0AECFD88654 | ||
:107B3000CF828D819E8134E0880F991F3A95E1F7BD | ||
:107B4000C0D0C816D90621F01E821D8218861F8259 | ||
:107B5000CE010196F9D10FCF8091290181508E3F3E | ||
:107B6000F0F043E262E083E0CDD063E084E022D134 | ||
:107B7000882391F380912F01869586958695E3E37E | ||
:107B8000F1E060E0815020F490E080E010D2F3CE8C | ||
:107B90009191669D900D1124692F6053F3CF7092DF | ||
:107BA0000D0110920E0143EC62E18FE0ABD060E07A | ||
:107BB0008FE000D18D819E8154E0880F991F5A95E6 | ||
:107BC000E1F77FD098878F8388E0FE013196ADE0A2 | ||
:107BD000B1E001900D928A95E1F7909216018092A2 | ||
:107BE000150144EC62E580E08DD063E081E0E2D0F5 | ||
:107BF000882309F411CF48E050E063E371E0CE013F | ||
:107C00000196B8D1892B09F407CF00913701109163 | ||
:107C100038010115110501F58091390190913A0162 | ||
:107C20008A379A4DE9F48091330190913401813083 | ||
:107C3000910551F46FEFC801BAD10F5F1F4F0115C5 | ||
:107C400034E01307B9F797CE02978230910508F018 | ||
:107C500092CE609135019ACF0038174008F0DCCE03 | ||
:107C600088E0E3E3F1E0DE01119601900D928A9540 | ||
:107C7000E1F7CF80D884B886AF82CE01019664D177 | ||
:107C80000D811E8103CF8091C00087FFFCCF8091C2 | ||
:107C9000C00084FD01C0A8958091C600089523E02E | ||
:107CA000FC0127BFE89507B600FCFDCF25E0FC01ED | ||
:107CB00027BFE89507B600FCFDCF81E187BFE895B7 | ||
:107CC0000895BC01F0E0E0E08FEF9FEFE617F707C3 | ||
:107CD00020F4E11528E7F20708F00895259182279E | ||
:107CE00048E0DC01B695A7958170992722273327B4 | ||
:107CF000281B390B2170307ACD0182279327415000 | ||
:107D000081F7E4CF90912901E6E0F1E0918390833F | ||
:107D10009FEF968385834483638308952A9895E330 | ||
:107D20009A95F1F700008EBD0DB407FEFDCF8EB51C | ||
:107D30009FEF415030F42A9AB5E3BA95F1F700006D | ||
:107D40000895222369F09EBD0DB407FEFDCF8EB5C8 | ||
:107D50006115710571F3DB018C936F5F7F4FE9CF84 | ||
:107D6000FB013196DB018C918EBD0DB407FEFDCF7A | ||
:107D70008EB5BF01DECFCF93DF931F92CDB7DEB7B5 | ||
:107D8000698320E041E0BE016F5F7F4FC7DF0F9046 | ||
:107D9000DF91CF91089520E040E070E060E082EE56 | ||
:107DA000BDDF20E040E070E060E081EEB7DF60E73B | ||
:107DB00087E2E1CFFF920F931F93CF93DF93C82FFA | ||
:107DC000F62ED0910901D695D695D695D95F10910A | ||
:107DD0002A0129986EE080E2CEDF1093000120E0B6 | ||
:107DE00045E060E071E08AE299DF20E045E060E094 | ||
:107DF00071E080E393DF20E04D2F66E071E080EAE0 | ||
:107E00008DDF299A85E18A95F1F7000020E040E0B6 | ||
:107E100070E060E08FEF82DF8073C1F32998BBDFF1 | ||
:107E20006FE080E2A8DF609129018AE2A4DF299A4D | ||
:107E30000FEF1FEFA89521E041E070E060E087E1DF | ||
:107E40006DDF80FF1AC09FEF80E28A95F1F7015045 | ||
:107E5000110919F0C913EECF9C2FFA948FEFF81681 | ||
:107E600019F0C913AECF9C2F81E0C91380E0DF91D8 | ||
:107E7000CF911F910F91FF90089521E041E070E0B4 | ||
:107E800060E080E64BDFD82F813208F0D0E021E0BF | ||
:107E90004D2F6CE271E081E641DF7DDF80912F01A3 | ||
:107EA00086958695869590E00796D817190659F617 | ||
:107EB00090912E01809129019813C5CF90913101A5 | ||
:107EC000809130018770833009F0BECF983009F07F | ||
:107ED000BBCF8091280120912A01281303C08F3F36 | ||
:107EE00009F0B2CF20912D01821304C080932A01A2 | ||
:107EF0009EEFAACF3091330181E0830F809333014D | ||
:107F000040912B01341708F09FCF80932B012093D1 | ||
:107F10002A019ACF9091C00095FFFCCF8093C600B4 | ||
:107F20000895B1DE803239F088E18093600088E006 | ||
:107F300080936000FFCF84E1EDCFCF93C82FA3DE05 | ||
:107F4000C150E9F7CF91EDCF0F931F93CF93DF93FC | ||
:107F50008C01CBE1D1E0F80161918F01CE0127D0F6 | ||
:107F60002196C332F1E0DF07B1F7DF91CF911F9186 | ||
:107F70000F910895FB01DC0104C08D9101908019DF | ||
:107F800021F441505040C8F7881B990B0895DC013B | ||
:107F9000CB01FC01F999FECF06C0F2BDE1BDF89A14 | ||
:107FA000319600B40D9241505040B8F70895262FF5 | ||
:107FB000F999FECF92BD81BDF89A019700B40216DF | ||
:107FC00039F01FBA20BD0FB6F894FA9AF99A0FBE8D | ||
:027FD000089512 | ||
:067FD20000FCE1A8A8007C | ||
:107FD800040000001400000003000000474E550094 | ||
:107FE8003E8AC92FA1513136DC9EA36B26B48FED92 | ||
:047FF80080EE5323A1 | ||
:040000030000780081 | ||
:00000001FF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.