diff --git a/engine/HAL/ARDUINO/luos_hal.c b/engine/HAL/ARDUINO/luos_hal.c index 359527279..b3ca5eb16 100644 --- a/engine/HAL/ARDUINO/luos_hal.c +++ b/engine/HAL/ARDUINO/luos_hal.c @@ -138,7 +138,7 @@ void LuosHAL_Reboot(void) { } -#ifdef BOOTLOADER +#if defined(BOOTLOADER) || defined(BOOTLOADER_UPDATER) /****************************************************************************** * @brief Get node id saved in flash memory * @param Address diff --git a/engine/HAL/ATSAMD21_ARDUINO/luos_hal.c b/engine/HAL/ATSAMD21_ARDUINO/luos_hal.c index 025d4dcd5..ad6b697a8 100644 --- a/engine/HAL/ATSAMD21_ARDUINO/luos_hal.c +++ b/engine/HAL/ATSAMD21_ARDUINO/luos_hal.c @@ -159,7 +159,7 @@ void LuosHAL_Reboot(void) { } -#ifdef BOOTLOADER +#if defined(BOOTLOADER) || defined(BOOTLOADER_UPDATER) /****************************************************************************** * @brief Get node id saved in flash memory * @param Address diff --git a/engine/HAL/ATSAMD21_MBED/luos_hal.c b/engine/HAL/ATSAMD21_MBED/luos_hal.c index a4848cd05..096c2c06f 100644 --- a/engine/HAL/ATSAMD21_MBED/luos_hal.c +++ b/engine/HAL/ATSAMD21_MBED/luos_hal.c @@ -224,7 +224,7 @@ void LuosHAL_Reboot(void) { } -#ifdef BOOTLOADER +#if defined(BOOTLOADER) || defined(BOOTLOADER_UPDATER) /****************************************************************************** * @brief Get node id saved in flash memory * @param Address diff --git a/engine/HAL/ESP32/luos_hal.c b/engine/HAL/ESP32/luos_hal.c index 6cbf903b5..d78557a79 100644 --- a/engine/HAL/ESP32/luos_hal.c +++ b/engine/HAL/ESP32/luos_hal.c @@ -174,5 +174,5 @@ void LuosHAL_Reboot(void) { } -#ifdef BOOTLOADER +#if defined(BOOTLOADER) || defined(BOOTLOADER_UPDATER) #endif diff --git a/engine/HAL/STM32F0/luos_hal.c b/engine/HAL/STM32F0/luos_hal.c index e17e14c16..b1e006ecc 100644 --- a/engine/HAL/STM32F0/luos_hal.c +++ b/engine/HAL/STM32F0/luos_hal.c @@ -262,7 +262,7 @@ uint8_t LuosHAL_GetMode(void) return (uint8_t)data; } -#ifdef BOOTLOADER +#if defined(BOOTLOADER) || defined(BOOTLOADER_UPDATER) /****************************************************************************** * @brief DeInit Bootloader peripherals * @param None diff --git a/engine/HAL/STM32F0/luos_hal.h b/engine/HAL/STM32F0/luos_hal.h index 585376cfe..92867ac20 100644 --- a/engine/HAL/STM32F0/luos_hal.h +++ b/engine/HAL/STM32F0/luos_hal.h @@ -49,7 +49,7 @@ void LuosHAL_SaveNodeID(uint16_t); void LuosHAL_JumpToAddress(uint32_t); uint8_t LuosHAL_GetMode(void); -#ifdef BOOTLOADER +#if defined(BOOTLOADER) || defined(BOOTLOADER_UPDATER) void LuosHAL_DeInit(void); uint16_t LuosHAL_GetNodeID(void); void LuosHAL_EraseMemory(uint32_t, uint16_t); diff --git a/engine/HAL/STM32F4/luos_hal.c b/engine/HAL/STM32F4/luos_hal.c index 05decfa0a..b65e49b1e 100644 --- a/engine/HAL/STM32F4/luos_hal.c +++ b/engine/HAL/STM32F4/luos_hal.c @@ -248,7 +248,7 @@ uint8_t LuosHAL_GetMode(void) return (uint8_t)data; } -#ifdef BOOTLOADER +#if defined(BOOTLOADER) || defined(BOOTLOADER_UPDATER) /****************************************************************************** * @brief DeInit Bootloader peripherals * @param None diff --git a/engine/HAL/STM32F4/luos_hal.h b/engine/HAL/STM32F4/luos_hal.h index 834e312b6..1659f4a03 100644 --- a/engine/HAL/STM32F4/luos_hal.h +++ b/engine/HAL/STM32F4/luos_hal.h @@ -48,7 +48,7 @@ void LuosHAL_SaveNodeID(uint16_t); void LuosHAL_JumpToAddress(uint32_t); uint8_t LuosHAL_GetMode(void); -#ifdef BOOTLOADER +#if defined(BOOTLOADER) || defined(BOOTLOADER_UPDATER) void LuosHAL_DeInit(void); uint16_t LuosHAL_GetNodeID(void); void LuosHAL_EraseMemory(uint32_t, uint16_t); diff --git a/engine/HAL/STM32G4/luos_hal.c b/engine/HAL/STM32G4/luos_hal.c index aee4a330b..f157de109 100644 --- a/engine/HAL/STM32G4/luos_hal.c +++ b/engine/HAL/STM32G4/luos_hal.c @@ -249,7 +249,7 @@ uint8_t LuosHAL_GetMode(void) return (uint8_t)data; } -#ifdef BOOTLOADER +#if defined(BOOTLOADER) || defined(BOOTLOADER_UPDATER) /****************************************************************************** * @brief DeInit Bootloader peripherals * @param None diff --git a/engine/HAL/STM32G4/luos_hal.h b/engine/HAL/STM32G4/luos_hal.h index a15ffcd97..41582213d 100644 --- a/engine/HAL/STM32G4/luos_hal.h +++ b/engine/HAL/STM32G4/luos_hal.h @@ -52,7 +52,7 @@ void LuosHAL_SaveNodeID(uint16_t); void LuosHAL_JumpToAddress(uint32_t); uint8_t LuosHAL_GetMode(void); -#ifdef BOOTLOADER +#if defined(BOOTLOADER) || defined(BOOTLOADER_UPDATER) void LuosHAL_DeInit(void); uint16_t LuosHAL_GetNodeID(void); void LuosHAL_EraseMemory(uint32_t, uint16_t); diff --git a/engine/HAL/STM32L0/luos_hal.c b/engine/HAL/STM32L0/luos_hal.c index bf3de181d..6d81c692b 100644 --- a/engine/HAL/STM32L0/luos_hal.c +++ b/engine/HAL/STM32L0/luos_hal.c @@ -262,7 +262,7 @@ uint8_t LuosHAL_GetMode(void) return (uint8_t)data; } -#ifdef BOOTLOADER +#if defined(BOOTLOADER) || defined(BOOTLOADER_UPDATER) /****************************************************************************** * @brief DeInit Bootloader peripherals * @param None diff --git a/engine/HAL/STM32L0/luos_hal.h b/engine/HAL/STM32L0/luos_hal.h index 585376cfe..92867ac20 100644 --- a/engine/HAL/STM32L0/luos_hal.h +++ b/engine/HAL/STM32L0/luos_hal.h @@ -49,7 +49,7 @@ void LuosHAL_SaveNodeID(uint16_t); void LuosHAL_JumpToAddress(uint32_t); uint8_t LuosHAL_GetMode(void); -#ifdef BOOTLOADER +#if defined(BOOTLOADER) || defined(BOOTLOADER_UPDATER) void LuosHAL_DeInit(void); uint16_t LuosHAL_GetNodeID(void); void LuosHAL_EraseMemory(uint32_t, uint16_t); diff --git a/engine/HAL/STM32L4/luos_hal.c b/engine/HAL/STM32L4/luos_hal.c index 64bf46e69..e5afd4c4b 100644 --- a/engine/HAL/STM32L4/luos_hal.c +++ b/engine/HAL/STM32L4/luos_hal.c @@ -246,7 +246,7 @@ uint8_t LuosHAL_GetMode(void) return (uint8_t)data; } -#ifdef BOOTLOADER +#if defined(BOOTLOADER) || defined(BOOTLOADER_UPDATER) /****************************************************************************** * @brief DeInit Bootloader peripherals * @param None diff --git a/engine/HAL/STM32L4/luos_hal.h b/engine/HAL/STM32L4/luos_hal.h index c5d384281..cf1c81909 100644 --- a/engine/HAL/STM32L4/luos_hal.h +++ b/engine/HAL/STM32L4/luos_hal.h @@ -52,7 +52,7 @@ void LuosHAL_SaveNodeID(uint16_t); void LuosHAL_JumpToAddress(uint32_t); uint8_t LuosHAL_GetMode(void); -#ifdef BOOTLOADER +#if defined(BOOTLOADER) || defined(BOOTLOADER_UPDATER) void LuosHAL_DeInit(void); uint16_t LuosHAL_GetNodeID(void); void LuosHAL_EraseMemory(uint32_t, uint16_t); diff --git a/engine/HAL/template/luos_hal.h b/engine/HAL/template/luos_hal.h index fdf3fa0c3..1712d4734 100644 --- a/engine/HAL/template/luos_hal.h +++ b/engine/HAL/template/luos_hal.h @@ -46,7 +46,7 @@ uint64_t LuosHAL_GetTimestamp(void); void LuosHAL_StartTimestamp(void); void LuosHAL_StopTimestamp(void); -#ifdef BOOTLOADER +#if defined(BOOTLOADER) || defined(BOOTLOADER_UPDATER) // bootloader functions void LuosHAL_SetMode(uint8_t mode); void LuosHAL_Reboot(void); diff --git a/engine/bootloader/luos_bootloader.c b/engine/bootloader/luos_bootloader.c index 73dc4c69a..a4e669398 100644 --- a/engine/bootloader/luos_bootloader.c +++ b/engine/bootloader/luos_bootloader.c @@ -16,7 +16,7 @@ /******************************************************************************* * Definitions ******************************************************************************/ -#ifdef BOOTLOADER +#if defined(BOOTLOADER) || defined(BOOTLOADER_UPDATER) #define MAX_FRAME_SIZE (MAX_DATA_MSG_SIZE - 1) #define BUFFER_SIZE 0x800 // 2kB buffer to store received data diff --git a/examples/projects/NUCLEO-F072RB/bootloader/linker/custom_new_bootloader_script.ld b/examples/projects/NUCLEO-F072RB/bootloader/linker/custom_new_bootloader_script.ld deleted file mode 100644 index 4baac8d22..000000000 --- a/examples/projects/NUCLEO-F072RB/bootloader/linker/custom_new_bootloader_script.ld +++ /dev/null @@ -1,189 +0,0 @@ -/** - ****************************************************************************** - * @file LinkerScript.ld - * @author Auto-generated by STM32CubeIDE - * @brief Linker script for STM32F072RBTx Device from STM32F0 series - * 128Kbytes FLASH - * 16Kbytes RAM - * - * Set heap size, stack size and stack location according - * to application requirements. - * - * Set memory bank area and size if external memory is used - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2020 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Entry Point */ -ENTRY(Reset_Handler) - -/* Highest address of the user mode stack */ -_estack = ORIGIN(RAM) + LENGTH(RAM); /* end of "RAM" Ram type memory */ - -_Min_Heap_Size = 0x200; /* required amount of heap */ -_Min_Stack_Size = 0x400; /* required amount of stack */ - -/* Memories definition */ -MEMORY -{ - RAM_RSVD (xrw) : ORIGIN = 0x20000000, LENGTH = 1K - RAM (xrw) : ORIGIN = 0x20000400, LENGTH = 15K - FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 48K - SHRD_MEM (rx) : ORIGIN = 0x800C000, LENGTH = 2K -} - -/* Sections */ -SECTIONS -{ - /* placing my boot flags section at given address: */ - .boot_flags : - { - KEEP(*(.boot_flags)) /* keep my variable even if not referenced */ - } > SHRD_MEM - - /* The startup code into "FLASH" Rom type memory */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - . = ALIGN(4); - } >FLASH - - /* The program code and other data into "FLASH" Rom type memory */ - .text : - { - . = ALIGN(4); - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.glue_7) /* glue arm to thumb code */ - *(.glue_7t) /* glue thumb to arm code */ - *(.eh_frame) - - KEEP (*(.init)) - KEEP (*(.fini)) - - . = ALIGN(4); - _etext = .; /* define a global symbols at end of code */ - } >FLASH - - /* Constant data into "FLASH" Rom type memory */ - .rodata : - { - . = ALIGN(4); - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - . = ALIGN(4); - } >FLASH - - .ARM.extab : { - . = ALIGN(4); - *(.ARM.extab* .gnu.linkonce.armextab.*) - . = ALIGN(4); - } >FLASH - - .ARM : { - . = ALIGN(4); - __exidx_start = .; - *(.ARM.exidx*) - __exidx_end = .; - . = ALIGN(4); - } >FLASH - - .preinit_array : - { - . = ALIGN(4); - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array*)) - PROVIDE_HIDDEN (__preinit_array_end = .); - . = ALIGN(4); - } >FLASH - - .init_array : - { - . = ALIGN(4); - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT(.init_array.*))) - KEEP (*(.init_array*)) - PROVIDE_HIDDEN (__init_array_end = .); - . = ALIGN(4); - } >FLASH - - .fini_array : - { - . = ALIGN(4); - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP (*(SORT(.fini_array.*))) - KEEP (*(.fini_array*)) - PROVIDE_HIDDEN (__fini_array_end = .); - . = ALIGN(4); - } >FLASH - - /* Used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* Initialized data sections into "RAM" Ram type memory */ - .data : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start */ - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end */ - - } >RAM AT> FLASH - - /* Uninitialized data section into "RAM" Ram type memory */ - . = ALIGN(4); - .bss : - { - /* This is used by the startup in order to initialize the .bss section */ - _sbss = .; /* define a global symbol at bss start */ - __bss_start__ = _sbss; - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end */ - __bss_end__ = _ebss; - } >RAM - - /* User_heap_stack section, used to check that there is enough "RAM" Ram type memory left */ - ._user_heap_stack : - { - . = ALIGN(8); - PROVIDE ( end = . ); - PROVIDE ( _end = . ); - . = . + _Min_Heap_Size; - . = . + _Min_Stack_Size; - . = ALIGN(8); - } >RAM - - .boot_data : - { - *(.rsvd.data) - *(.rsvd.data*) - } > RAM_RSVD - - /* Remove information from the compiler libraries */ - /DISCARD/ : - { - libc.a ( * ) - libm.a ( * ) - libgcc.a ( * ) - } - - .ARM.attributes 0 : { *(.ARM.attributes) } -} diff --git a/examples/projects/NUCLEO-F072RB/bootloader/platformio.ini b/examples/projects/NUCLEO-F072RB/bootloader/platformio.ini index a4aaf4315..25ce0a007 100644 --- a/examples/projects/NUCLEO-F072RB/bootloader/platformio.ini +++ b/examples/projects/NUCLEO-F072RB/bootloader/platformio.ini @@ -39,7 +39,6 @@ board_build.ldscript = linker/custom_bootloader_updater_script.ld build_unflags = -Os build_flags = -include node_config.h - -DBOOTLOADER -DBOOTLOADER_UPDATER -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER @@ -49,18 +48,3 @@ upload_protocol = custom upload_flags = -t2 upload_command = pyluos-bootloader flash $UPLOAD_PORT $UPLOAD_FLAGS -b $SOURCE - -[env:nucleo_f072rb_new_boot] -board_build.ldscript = linker/custom_new_bootloader_script.ld -build_unflags = -Os -build_flags = - -include node_config.h - -DBOOTLOADER - -DUSE_HAL_DRIVER - -DUSE_FULL_LL_DRIVER - -DLUOSHAL=STM32F0 - -O1 -upload_protocol = custom -upload_flags = - -t2 -upload_command = pyluos-bootloader flash $UPLOAD_PORT $UPLOAD_FLAGS -b $SOURCE diff --git a/examples/projects/NUCLEO-F401RE/bootloader/platformio.ini b/examples/projects/NUCLEO-F401RE/bootloader/platformio.ini index 20b46fb7c..10eb597c5 100644 --- a/examples/projects/NUCLEO-F401RE/bootloader/platformio.ini +++ b/examples/projects/NUCLEO-F401RE/bootloader/platformio.ini @@ -40,7 +40,6 @@ build_unflags = -Os build_flags = -O1 -include node_config.h - -DBOOTLOADER -DBOOTLOADER_UPDATER -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER diff --git a/examples/projects/NUCLEO-F410RB/bootloader/platformio.ini b/examples/projects/NUCLEO-F410RB/bootloader/platformio.ini index ca1bb4c50..590f72b24 100644 --- a/examples/projects/NUCLEO-F410RB/bootloader/platformio.ini +++ b/examples/projects/NUCLEO-F410RB/bootloader/platformio.ini @@ -40,7 +40,6 @@ build_unflags = -Os build_flags = -O1 -include node_config.h - -DBOOTLOADER -DBOOTLOADER_UPDATER -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER diff --git a/examples/projects/NUCLEO-G431KB/bootloader/platformio.ini b/examples/projects/NUCLEO-G431KB/bootloader/platformio.ini index 9b500d707..c697fca60 100644 --- a/examples/projects/NUCLEO-G431KB/bootloader/platformio.ini +++ b/examples/projects/NUCLEO-G431KB/bootloader/platformio.ini @@ -39,7 +39,6 @@ board_build.ldscript = linker/custom_bootloader_updater_script.ld build_unflags = -Os build_flags = -O1 - -DBOOTLOADER -DBOOTLOADER_UPDATER -include node_config.h -DUSE_HAL_DRIVER diff --git a/examples/projects/NUCLEO-G474RE/bootloader/platformio.ini b/examples/projects/NUCLEO-G474RE/bootloader/platformio.ini index dc1c83a12..ef662b9f9 100644 --- a/examples/projects/NUCLEO-G474RE/bootloader/platformio.ini +++ b/examples/projects/NUCLEO-G474RE/bootloader/platformio.ini @@ -40,7 +40,6 @@ build_unflags = -Os build_flags = -O1 -include node_config.h - -D BOOTLOADER -D BOOTLOADER_UPDATER -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER diff --git a/examples/projects/NUCLEO-L073RZ/bootloader/linker/custom_new_bootloader_script.ld b/examples/projects/NUCLEO-L073RZ/bootloader/linker/custom_new_bootloader_script.ld deleted file mode 100644 index 95ca5cec1..000000000 --- a/examples/projects/NUCLEO-L073RZ/bootloader/linker/custom_new_bootloader_script.ld +++ /dev/null @@ -1,200 +0,0 @@ -/* -****************************************************************************** -** -** @file : LinkerScript.ld -** -** @author : Auto-generated by STM32CubeIDE -** -** @brief : Linker script for STM32L073RZTx Device from STM32L0 series -** 192Kbytes FLASH -** 20Kbytes RAM -** -** Set heap size, stack size and stack location according -** to application requirements. -** -** Set memory bank area and size if external memory is used -** -** Target : STMicroelectronics STM32 -** -** Distribution: The file is distributed as is, without any warranty -** of any kind. -** -****************************************************************************** -** @attention -** -**

© Copyright (c) 2021 STMicroelectronics. -** All rights reserved.

-** -** This software component is licensed by ST under BSD 3-Clause license, -** the "License"; You may not use this file except in compliance with the -** License. You may obtain a copy of the License at: -** opensource.org/licenses/BSD-3-Clause -** -****************************************************************************** -*/ - -/* Entry Point */ -ENTRY(Reset_Handler) - -/* Highest address of the user mode stack */ -_estack = ORIGIN(RAM) + LENGTH(RAM); /* end of "RAM" Ram type memory */ - -_Min_Heap_Size = 0x200; /* required amount of heap */ -_Min_Stack_Size = 0x400; /* required amount of stack */ - -/* Memories definition */ -MEMORY -{ - RAM_RSVD (xrw) : ORIGIN = 0x20000000, LENGTH = 1K - RAM (xrw) : ORIGIN = 0x20000400, LENGTH = 19K - FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 48K - SHRD_MEM (rw) : ORIGIN = 0x0800C000, LENGTH = 2K -} - -/* Sections */ -SECTIONS -{ - /* placing my boot flags section at given address: */ - .boot_flags : - { - KEEP(*(.boot_flags)) /* keep my variable even if not referenced */ - } > SHRD_MEM - - /* The startup code into "FLASH" Rom type memory */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - . = ALIGN(4); - } >FLASH - - /* The program code and other data into "FLASH" Rom type memory */ - .text : - { - . = ALIGN(4); - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.glue_7) /* glue arm to thumb code */ - *(.glue_7t) /* glue thumb to arm code */ - *(.eh_frame) - - KEEP (*(.init)) - KEEP (*(.fini)) - - . = ALIGN(4); - _etext = .; /* define a global symbols at end of code */ - } >FLASH - - /* Constant data into "FLASH" Rom type memory */ - .rodata : - { - . = ALIGN(4); - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - . = ALIGN(4); - } >FLASH - - .ARM.extab : { - . = ALIGN(4); - *(.ARM.extab* .gnu.linkonce.armextab.*) - . = ALIGN(4); - } >FLASH - - .ARM : { - . = ALIGN(4); - __exidx_start = .; - *(.ARM.exidx*) - __exidx_end = .; - . = ALIGN(4); - } >FLASH - - .preinit_array : - { - . = ALIGN(4); - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array*)) - PROVIDE_HIDDEN (__preinit_array_end = .); - . = ALIGN(4); - } >FLASH - - .init_array : - { - . = ALIGN(4); - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT(.init_array.*))) - KEEP (*(.init_array*)) - PROVIDE_HIDDEN (__init_array_end = .); - . = ALIGN(4); - } >FLASH - - .fini_array : - { - . = ALIGN(4); - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP (*(SORT(.fini_array.*))) - KEEP (*(.fini_array*)) - PROVIDE_HIDDEN (__fini_array_end = .); - . = ALIGN(4); - } >FLASH - - /* Used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* Initialized data sections into "RAM" Ram type memory */ - .data : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start */ - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - *(.RamFunc) /* .RamFunc sections */ - *(.RamFunc*) /* .RamFunc* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end */ - - } >RAM AT> FLASH - - /* Uninitialized data section into "RAM" Ram type memory */ - . = ALIGN(4); - .bss : - { - /* This is used by the startup in order to initialize the .bss section */ - _sbss = .; /* define a global symbol at bss start */ - __bss_start__ = _sbss; - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end */ - __bss_end__ = _ebss; - } >RAM - - /* User_heap_stack section, used to check that there is enough "RAM" Ram type memory left */ - ._user_heap_stack : - { - . = ALIGN(8); - PROVIDE ( end = . ); - PROVIDE ( _end = . ); - . = . + _Min_Heap_Size; - . = . + _Min_Stack_Size; - . = ALIGN(8); - } >RAM - - .boot_data : - { - *(.rsvd.data) - *(.rsvd.data*) - } > RAM_RSVD - - /* Remove information from the compiler libraries */ - /DISCARD/ : - { - libc.a ( * ) - libm.a ( * ) - libgcc.a ( * ) - } - - .ARM.attributes 0 : { *(.ARM.attributes) } -} diff --git a/examples/projects/NUCLEO-L073RZ/bootloader/platformio.ini b/examples/projects/NUCLEO-L073RZ/bootloader/platformio.ini index 9cf6fec6f..2ccd2c86e 100644 --- a/examples/projects/NUCLEO-L073RZ/bootloader/platformio.ini +++ b/examples/projects/NUCLEO-L073RZ/bootloader/platformio.ini @@ -43,25 +43,8 @@ build_flags = -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER -DLUOSHAL=STM32L0 - -DBOOTLOADER -DBOOTLOADER_UPDATER upload_protocol = custom upload_flags = -t2 upload_command = pyluos-bootloader flash $UPLOAD_PORT $UPLOAD_FLAGS -b $SOURCE - -[env:nucleo_l073rz_new_boot] -board_build.ldscript = linker/custom_new_bootloader_script.ld -build_unflags = -Os -build_flags = - -O1 - -include node_config.h - -DUSE_HAL_DRIVER - -DUSE_FULL_LL_DRIVER - -DLUOSHAL=STM32L0 - -DBOOTLOADER -upload_protocol = custom -upload_flags = - -t2 -upload_command = pyluos-bootloader flash $UPLOAD_PORT $UPLOAD_FLAGS -b $SOURCE - diff --git a/examples/projects/NUCLEO-L432KC/bootloader/platformio.ini b/examples/projects/NUCLEO-L432KC/bootloader/platformio.ini index 1e90565a6..8ce1fcb0c 100644 --- a/examples/projects/NUCLEO-L432KC/bootloader/platformio.ini +++ b/examples/projects/NUCLEO-L432KC/bootloader/platformio.ini @@ -44,7 +44,6 @@ build_flags = -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER -DLUOSHAL=STM32L4 - -DBOOTLOADER -DBOOTLOADER_UPDATER lib_deps = luos_engine@^3.0.0 diff --git a/examples/projects/STM32F4-discovery/bootloader/platformio.ini b/examples/projects/STM32F4-discovery/bootloader/platformio.ini index 3d0645b0b..c8f5addd4 100644 --- a/examples/projects/STM32F4-discovery/bootloader/platformio.ini +++ b/examples/projects/STM32F4-discovery/bootloader/platformio.ini @@ -38,7 +38,6 @@ debug_tool = stlink board_build.ldscript = linker/custom_bootloader_updater_script.ld build_unflags = -Os build_flags = - -DBOOTLOADER -DBOOTLOADER_UPDATER -include node_config.h -O1 diff --git a/examples/projects/STM32L4S5_discovery/bootloader/platformio.ini b/examples/projects/STM32L4S5_discovery/bootloader/platformio.ini index 6197201e9..e42b0486e 100644 --- a/examples/projects/STM32L4S5_discovery/bootloader/platformio.ini +++ b/examples/projects/STM32L4S5_discovery/bootloader/platformio.ini @@ -40,7 +40,6 @@ build_unflags = -Os build_flags = -O1 -include node_config.h - -DBOOTLOADER -DBOOTLOADER_UPDATER -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER diff --git a/examples/projects/l0/bootloader/platformio.ini b/examples/projects/l0/bootloader/platformio.ini index a17f313f8..c3252a96e 100644 --- a/examples/projects/l0/bootloader/platformio.ini +++ b/examples/projects/l0/bootloader/platformio.ini @@ -36,22 +36,9 @@ board_build.ldscript = linker/custom_bootloader_updater_script.ld build_unflags = -Os build_flags = -include node_config.h - -D BOOTLOADER -O1 -D BOOTLOADER_UPDATER upload_protocol = custom upload_flags = -t2 upload_command = pyluos-bootloader flash $UPLOAD_PORT $UPLOAD_FLAGS -b $SOURCE - -[env:l0_new_boot] -board_build.ldscript = linker/custom_new_bootloader_script.ld -build_unflags = -Os -build_flags = - -include node_config.h - -D BOOTLOADER - -O1 -upload_protocol = custom -upload_flags = - -t2 -upload_command = pyluos-bootloader flash $UPLOAD_PORT $UPLOAD_FLAGS -b $SOURCE diff --git a/tool_services/gate/TinyJSON/convert.c b/tool_services/gate/TinyJSON/convert.c index c2fba74af..85c687f6b 100644 --- a/tool_services/gate/TinyJSON/convert.c +++ b/tool_services/gate/TinyJSON/convert.c @@ -927,6 +927,24 @@ void Convert_AssertToData(service_t *service, uint16_t source, luos_assert_t ass PipeLink_Send(service, assert_json, strlen(assert_json)); } +// This function generate a Json about service exclusion and send it. +void Convert_DeadServiceToData(service_t *service, uint16_t service_id) +{ + char dead_json[512]; + sprintf(dead_json, "{\"dead_service\":%d}\n", service_id); + // Send the message to pipe + PipeLink_Send(service, dead_json, strlen(dead_json)); +} + +// This function generate a Json about node exclusion and send it. +void Convert_DeadNodeToData(service_t *service, uint16_t node_id) +{ + char dead_json[512]; + sprintf(dead_json, "{\"dead_node\":%d}\n", node_id); + // Send the message to pipe + PipeLink_Send(service, dead_json, strlen(dead_json)); +} + /******************************************************************************* * Luos routing table information to Json convertion ******************************************************************************/ diff --git a/tool_services/gate/convert.h b/tool_services/gate/convert.h index b97360077..46ad2cfeb 100644 --- a/tool_services/gate/convert.h +++ b/tool_services/gate/convert.h @@ -38,6 +38,8 @@ void Convert_VoidData(service_t *service); // Luos default information to Data convertion void Convert_AssertToData(service_t *service, uint16_t source, luos_assert_t assertion); +void Convert_DeadServiceToData(service_t *service, uint16_t service_id); +void Convert_DeadNodeToData(service_t *service, uint16_t node_id); // Luos routing table information to Json convertion void Convert_RoutingTableData(service_t *service); diff --git a/tool_services/gate/data_manager.c b/tool_services/gate/data_manager.c index cdf26ab8c..f1bf16f95 100644 --- a/tool_services/gate/data_manager.c +++ b/tool_services/gate/data_manager.c @@ -149,6 +149,19 @@ void DataManager_Format(service_t *service) i++; continue; } + if (data_msg.header.cmd == DEADTARGET) + { + dead_target_t *dead_target = (dead_target_t *)data_msg.data; + if (dead_target->node_id != 0) + { + Convert_DeadNodeToData(service, dead_target->node_id); + } + if (dead_target->service_id != 0) + { + Convert_DeadServiceToData(service, dead_target->service_id); + } + continue; + } // check if a node send a bootloader message if (data_msg.header.cmd >= BOOTLOADER_START && data_msg.header.cmd <= BOOTLOADER_ERROR_SIZE) {