mirror of
https://github.com/anklimov/lighthub
synced 2025-12-06 03:39:49 +03:00
STM32 persistent MVP, cross-compiled & binaries
This commit is contained in:
@@ -9,4 +9,4 @@
|
||||
-DRESTART_LAN_ON_MQTT_ERRORS
|
||||
-D CORS=\"*\"
|
||||
-D REDIRECTION_URL=\"http://lazyhome.ru/pwa\"
|
||||
-DOTA_PORT=80
|
||||
-DOTA_PORT=80
|
||||
|
||||
@@ -9,4 +9,4 @@
|
||||
-DRESTART_LAN_ON_MQTT_ERRORS
|
||||
-D CORS=\"*\"
|
||||
-D REDIRECTION_URL=\"http://lazyhome.ru/pwa\"
|
||||
-DOTA_PORT=80
|
||||
-DOTA_PORT=80
|
||||
|
||||
@@ -9,15 +9,31 @@
|
||||
-DSPILED_DISABLE
|
||||
-DAC_DISABLE
|
||||
-DPID_DISABLE
|
||||
-DdebugSerialPort=SerialUSB
|
||||
-DSerialPortType=USBSerial
|
||||
-DSERIAL_BAUD=0
|
||||
|
||||
-DPIO_FRAMEWORK_ARDUINO_ENABLE_CDC
|
||||
-DUSBCON
|
||||
-DENABLE_HWSERIAL1
|
||||
-DdebugSerialPort=Serial1
|
||||
|
||||
#-DFLASH_BASE_ADDRESS
|
||||
#-DFLASH_DATA_SECTOR
|
||||
#-DFLASH_PAGE_NUMBER
|
||||
|
||||
-D PIO_FRAMEWORK_ARDUINO_ENABLE_MASS_STORAGE
|
||||
-D PIO_FRAMEWORK_ARDUINO_ENABLE_CDC_AND_MSC
|
||||
|
||||
#-DdebugSerialPort=SerialUSB
|
||||
#-DSerialPortType=USBSerial
|
||||
#-DSERIAL_BAUD=0
|
||||
|
||||
#-DPIO_FRAMEWORK_ARDUINO_ENABLE_CDC
|
||||
#-DUSBCON
|
||||
#-DUSBD_VID=0x0483
|
||||
#-DUSBD_PID=0x5740
|
||||
#-DUSB_MANUFACTURER="Unknown"
|
||||
#-DUSB_PRODUCT="\"BLUEPILL_F103C8\""
|
||||
#-DHAL_PCD_MODULE_ENABLED
|
||||
#-D USBD_USE_CDC
|
||||
|
||||
-D HAL_CAN_MODULE_ENABLED
|
||||
#HAL_ETH_MODULE_DISABLED
|
||||
#HAL_SD_MODULE_DISABLED
|
||||
#HAL_DAC_MODULE_DISABLED
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,3 +0,0 @@
|
||||
mode com3:1200,n,8,1
|
||||
pause
|
||||
..\tools\win\tool-bossac\bossac.exe -i --port=com3 -U false -e -w -v -b firmware.bin -R
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
6597
compiled/nrf52840-5500
Normal file
6597
compiled/nrf52840-5500
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
18
ldscripts/bootloader.ld
Normal file
18
ldscripts/bootloader.ld
Normal file
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Linker script for Generic STM32F103RE boards, using the generic bootloader (which takes the lower 8k of memory)
|
||||
*/
|
||||
MEMORY
|
||||
{
|
||||
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 64K
|
||||
rom (rx) : ORIGIN = 0x08002000, LENGTH = 504K
|
||||
}
|
||||
|
||||
|
||||
/* Provide memory region aliases for common.inc */
|
||||
REGION_ALIAS("REGION_TEXT", rom);
|
||||
REGION_ALIAS("REGION_DATA", ram);
|
||||
REGION_ALIAS("REGION_BSS", ram);
|
||||
REGION_ALIAS("REGION_RODATA", rom);
|
||||
|
||||
/* Let common.inc handle the real work. */
|
||||
INCLUDE ldscripts/common.inc
|
||||
220
ldscripts/common.inc
Normal file
220
ldscripts/common.inc
Normal file
@@ -0,0 +1,220 @@
|
||||
/*
|
||||
* Linker script for libmaple.
|
||||
*
|
||||
* Original author "lanchon" from ST forums, with modifications by LeafLabs.
|
||||
*/
|
||||
|
||||
OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
|
||||
|
||||
/*
|
||||
* Configure other libraries we want in the link.
|
||||
*
|
||||
* libgcc, libc, and libm are common across supported toolchains.
|
||||
* However, some toolchains require additional archives which aren't
|
||||
* present everywhere (e.g. ARM's gcc-arm-embedded releases).
|
||||
*
|
||||
* To hack around this, we let the build system specify additional
|
||||
* archives by putting the right extra_libs.inc (in a directory under
|
||||
* toolchains/) in our search path.
|
||||
*/
|
||||
GROUP(libgcc.a libc.a libm.a)
|
||||
INCLUDE ldscripts/extra_libs.inc
|
||||
|
||||
/*
|
||||
* These force the linker to search for vector table symbols.
|
||||
*
|
||||
* These symbols vary by STM32 family (and also within families).
|
||||
* It's up to the build system to configure the link's search path
|
||||
* properly for the target MCU.
|
||||
*/
|
||||
INCLUDE ldscripts/vector_symbols.inc
|
||||
|
||||
/* STM32 vector table. */
|
||||
EXTERN(__stm32_vector_table)
|
||||
|
||||
/* C runtime initialization function. */
|
||||
EXTERN(start_c)
|
||||
|
||||
/* main entry point */
|
||||
EXTERN(main)
|
||||
|
||||
/* Initial stack pointer value. */
|
||||
EXTERN(__msp_init)
|
||||
PROVIDE(__msp_init = ORIGIN(ram) + LENGTH(ram));
|
||||
|
||||
/* Reset vector and chip reset entry point */
|
||||
EXTERN(__start__)
|
||||
ENTRY(__start__)
|
||||
PROVIDE(__exc_reset = __start__);
|
||||
|
||||
/* Heap boundaries, for libmaple */
|
||||
EXTERN(_lm_heap_start);
|
||||
EXTERN(_lm_heap_end);
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.text :
|
||||
{
|
||||
__text_start__ = .;
|
||||
/*
|
||||
* STM32 vector table. Leave this here. Yes, really.
|
||||
*/
|
||||
*(.stm32.interrupt_vector)
|
||||
|
||||
/*
|
||||
* Program code and vague linking
|
||||
*/
|
||||
*(.text .text.* .gnu.linkonce.t.*)
|
||||
*(.plt)
|
||||
*(.gnu.warning)
|
||||
*(.glue_7t) *(.glue_7) *(.vfp11_veneer)
|
||||
|
||||
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
||||
*(.gcc_except_table)
|
||||
*(.eh_frame_hdr)
|
||||
*(.eh_frame)
|
||||
|
||||
. = ALIGN(4);
|
||||
KEEP(*(.init))
|
||||
|
||||
. = ALIGN(4);
|
||||
__preinit_array_start = .;
|
||||
KEEP (*(.preinit_array))
|
||||
__preinit_array_end = .;
|
||||
|
||||
. = ALIGN(4);
|
||||
__init_array_start = .;
|
||||
KEEP (*(SORT(.init_array.*)))
|
||||
KEEP (*(.init_array))
|
||||
__init_array_end = .;
|
||||
|
||||
. = ALIGN(0x4);
|
||||
KEEP (*crtbegin.o(.ctors))
|
||||
KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
|
||||
KEEP (*(SORT(.ctors.*)))
|
||||
KEEP (*crtend.o(.ctors))
|
||||
|
||||
. = ALIGN(4);
|
||||
KEEP(*(.fini))
|
||||
|
||||
. = ALIGN(4);
|
||||
__fini_array_start = .;
|
||||
KEEP (*(.fini_array))
|
||||
KEEP (*(SORT(.fini_array.*)))
|
||||
__fini_array_end = .;
|
||||
|
||||
KEEP (*crtbegin.o(.dtors))
|
||||
KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
|
||||
KEEP (*(SORT(.dtors.*)))
|
||||
KEEP (*crtend.o(.dtors))
|
||||
} > REGION_TEXT
|
||||
|
||||
/*
|
||||
* End of text
|
||||
*/
|
||||
.text.align :
|
||||
{
|
||||
. = ALIGN(8);
|
||||
__text_end__ = .;
|
||||
} > REGION_TEXT
|
||||
|
||||
/*
|
||||
* .ARM.exidx exception unwinding; mandated by ARM's C++ ABI
|
||||
*/
|
||||
__exidx_start = .;
|
||||
.ARM.exidx :
|
||||
{
|
||||
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
||||
} > REGION_RODATA
|
||||
__exidx_end = .;
|
||||
|
||||
/*
|
||||
* .data
|
||||
*/
|
||||
.data :
|
||||
{
|
||||
__data_start__ = .;
|
||||
LONG(0)
|
||||
. = ALIGN(8);
|
||||
|
||||
*(.got.plt) *(.got)
|
||||
*(.data .data.* .gnu.linkonce.d.*)
|
||||
|
||||
. = ALIGN(8);
|
||||
__data_end__ = .;
|
||||
} > REGION_DATA AT> REGION_RODATA
|
||||
|
||||
/*
|
||||
* Read-only data
|
||||
*/
|
||||
.rodata :
|
||||
{
|
||||
*(.rodata .rodata.* .gnu.linkonce.r.*)
|
||||
/* .USER_FLASH: We allow users to allocate into Flash here */
|
||||
*(.USER_FLASH)
|
||||
/* ROM image configuration; for C startup */
|
||||
. = ALIGN(4);
|
||||
_lm_rom_img_cfgp = .;
|
||||
LONG(LOADADDR(.data));
|
||||
/*
|
||||
* Heap: Linker scripts may choose a custom heap by overriding
|
||||
* _lm_heap_start and _lm_heap_end. Otherwise, the heap is in
|
||||
* internal SRAM, beginning after .bss, and growing towards
|
||||
* the stack.
|
||||
*
|
||||
* I'm shoving these here naively; there's probably a cleaner way
|
||||
* to go about this. [mbolivar]
|
||||
*/
|
||||
_lm_heap_start = DEFINED(_lm_heap_start) ? _lm_heap_start : _end;
|
||||
_lm_heap_end = DEFINED(_lm_heap_end) ? _lm_heap_end : __msp_init;
|
||||
} > REGION_RODATA
|
||||
|
||||
/*
|
||||
* .bss
|
||||
*/
|
||||
.bss :
|
||||
{
|
||||
. = ALIGN(8);
|
||||
__bss_start__ = .;
|
||||
*(.bss .bss.* .gnu.linkonce.b.*)
|
||||
*(COMMON)
|
||||
. = ALIGN (8);
|
||||
__bss_end__ = .;
|
||||
_end = __bss_end__;
|
||||
} > REGION_BSS
|
||||
|
||||
/*
|
||||
* Debugging sections
|
||||
*/
|
||||
.stab 0 (NOLOAD) : { *(.stab) }
|
||||
.stabstr 0 (NOLOAD) : { *(.stabstr) }
|
||||
/* DWARF debug sections.
|
||||
* Symbols in the DWARF debugging sections are relative to the beginning
|
||||
* of the section so we begin them at 0. */
|
||||
/* DWARF 1 */
|
||||
.debug 0 : { *(.debug) }
|
||||
.line 0 : { *(.line) }
|
||||
/* GNU DWARF 1 extensions */
|
||||
.debug_srcinfo 0 : { *(.debug_srcinfo) }
|
||||
.debug_sfnames 0 : { *(.debug_sfnames) }
|
||||
/* DWARF 1.1 and DWARF 2 */
|
||||
.debug_aranges 0 : { *(.debug_aranges) }
|
||||
.debug_pubnames 0 : { *(.debug_pubnames) }
|
||||
/* DWARF 2 */
|
||||
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
|
||||
.debug_abbrev 0 : { *(.debug_abbrev) }
|
||||
.debug_line 0 : { *(.debug_line) }
|
||||
.debug_frame 0 : { *(.debug_frame) }
|
||||
.debug_str 0 : { *(.debug_str) }
|
||||
.debug_loc 0 : { *(.debug_loc) }
|
||||
.debug_macinfo 0 : { *(.debug_macinfo) }
|
||||
/* SGI/MIPS DWARF 2 extensions */
|
||||
.debug_weaknames 0 : { *(.debug_weaknames) }
|
||||
.debug_funcnames 0 : { *(.debug_funcnames) }
|
||||
.debug_typenames 0 : { *(.debug_typenames) }
|
||||
.debug_varnames 0 : { *(.debug_varnames) }
|
||||
|
||||
.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }
|
||||
.ARM.attributes 0 : { KEEP (*(.ARM.attributes)) }
|
||||
/DISCARD/ : { *(.note.GNU-stack) }
|
||||
}
|
||||
7
ldscripts/extra_libs.inc
Normal file
7
ldscripts/extra_libs.inc
Normal file
@@ -0,0 +1,7 @@
|
||||
/*
|
||||
* Extra archives needed by ARM's GCC ARM Embedded arm-none-eabi-
|
||||
* releases (https://launchpad.net/gcc-arm-embedded/).
|
||||
*/
|
||||
|
||||
/* This is for the provided newlib. */
|
||||
GROUP(libnosys.a)
|
||||
26
ldscripts/flash.ld
Normal file
26
ldscripts/flash.ld
Normal file
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* libmaple linker script for "Flash" builds.
|
||||
*
|
||||
* A Flash build puts .text (and .rodata) in Flash, and
|
||||
* .data/.bss/heap (of course) in SRAM, but offsets the sections by
|
||||
* enough space to store the Maple bootloader, which lives in low
|
||||
* Flash and uses low memory.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This pulls in the appropriate MEMORY declaration from the right
|
||||
* subdirectory of stm32/mem/ (the environment must call ld with the
|
||||
* right include directory flags to make this happen). Boards can also
|
||||
* use this file to use any of libmaple's memory-related hooks (like
|
||||
* where the heap should live).
|
||||
*/
|
||||
INCLUDE mem-flash.inc
|
||||
|
||||
/* Provide memory region aliases for common.inc */
|
||||
REGION_ALIAS("REGION_TEXT", rom);
|
||||
REGION_ALIAS("REGION_DATA", ram);
|
||||
REGION_ALIAS("REGION_BSS", ram);
|
||||
REGION_ALIAS("REGION_RODATA", rom);
|
||||
|
||||
/* Let common.inc handle the real work. */
|
||||
INCLUDE ldscripts/common.inc
|
||||
31
ldscripts/jtag.ld
Normal file
31
ldscripts/jtag.ld
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* libmaple linker script for "JTAG" builds.
|
||||
*
|
||||
* A "JTAG" build puts .text (and .rodata) in Flash, and
|
||||
* .data/.bss/heap (of course) in SRAM, but links starting at the
|
||||
* Flash and SRAM starting addresses (0x08000000 and 0x20000000
|
||||
* respectively). This will wipe out a Maple bootloader if there's one
|
||||
* on the board, so only use this if you know what you're doing.
|
||||
*
|
||||
* Of course, a "JTAG" build is perfectly usable for upload over SWD,
|
||||
* the system memory bootloader, etc. The name is just a historical
|
||||
* artifact.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This pulls in the appropriate MEMORY declaration from the right
|
||||
* subdirectory of stm32/mem/ (the environment must call ld with the
|
||||
* right include directory flags to make this happen). Boards can also
|
||||
* use this file to use any of libmaple's memory-related hooks (like
|
||||
* where the heap should live).
|
||||
*/
|
||||
INCLUDE mem-jtag.inc
|
||||
|
||||
/* Provide memory region aliases for common.inc */
|
||||
REGION_ALIAS("REGION_TEXT", rom);
|
||||
REGION_ALIAS("REGION_DATA", ram);
|
||||
REGION_ALIAS("REGION_BSS", ram);
|
||||
REGION_ALIAS("REGION_RODATA", rom);
|
||||
|
||||
/* Let common.inc handle the real work. */
|
||||
INCLUDE ldscripts/common.inc
|
||||
46
ldscripts/ldscript.ld
Normal file
46
ldscripts/ldscript.ld
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
!!!!!!!!!!!! STM32Duino default linker script
|
||||
|
||||
* This script extends the default linker script to add a .noinit
|
||||
* section. This section is just mapped to RAM, but it is emitted
|
||||
* separately from the .data and .bss sections (both of which are
|
||||
* initialized by startup code), so any variables in this section are
|
||||
* untouched on startup (so they survive across resets).
|
||||
*
|
||||
* This script is intended to supplied to the linker's -T / --script
|
||||
* option as the primary linker script. When the linker sees an INSERT
|
||||
* command, this will cause it to *also* read the default linker script
|
||||
* (after reading this script) and then executing the INSERT commands
|
||||
* after both scripts have been read.
|
||||
*
|
||||
* Note that parsing of linker scripts is a bit peculiar, e.g. INSERT
|
||||
* does not textually inserts, it inserts any generated output sections.
|
||||
* Also, because this script is read *first*, we cannot refer to things
|
||||
* in the default script. In particular, it would make sense to add >
|
||||
* RAM to the output section below to ensure that the section is mapped
|
||||
* into RAM, but the RAM region is not defined yet (I think it would
|
||||
* work though, but produces warnings). Instead, we just rely on the
|
||||
* defaults used by the linker: If no region is defined for an output
|
||||
* section, it will just map to first address after the previous section
|
||||
* (.bss in this case, which is fine).
|
||||
*/
|
||||
SECTIONS
|
||||
{
|
||||
/* Define a noinit output section and mark it as NOLOAD to prevent
|
||||
* putting its contents into the resulting .bin file (which is the
|
||||
* default). */
|
||||
.noinit (NOLOAD) :
|
||||
{
|
||||
/* Ensure output is aligned */
|
||||
. = ALIGN(4);
|
||||
/* Define a global _snoinit (and _enoinit below) symbol just in case
|
||||
* code wants to iterate over all noinit variables for some reason */
|
||||
_snoinit = .;
|
||||
/* Actually import the .noinit and .noinit* import sections */
|
||||
*(.noinit)
|
||||
*(.noinit*)
|
||||
. = ALIGN(4);
|
||||
_enoinit = .;
|
||||
}
|
||||
}
|
||||
INSERT AFTER .bss;
|
||||
5
ldscripts/mem-flash.inc
Normal file
5
ldscripts/mem-flash.inc
Normal file
@@ -0,0 +1,5 @@
|
||||
MEMORY
|
||||
{
|
||||
ram (rwx) : ORIGIN = 0x20000C00, LENGTH = 61K
|
||||
rom (rx) : ORIGIN = 0x08005000, LENGTH = 492K
|
||||
}
|
||||
5
ldscripts/mem-jtag.inc
Normal file
5
ldscripts/mem-jtag.inc
Normal file
@@ -0,0 +1,5 @@
|
||||
MEMORY
|
||||
{
|
||||
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 64K
|
||||
rom (rx) : ORIGIN = 0x08000000, LENGTH = 512K
|
||||
}
|
||||
5
ldscripts/mem-ram.inc
Normal file
5
ldscripts/mem-ram.inc
Normal file
@@ -0,0 +1,5 @@
|
||||
MEMORY
|
||||
{
|
||||
ram (rwx) : ORIGIN = 0x20000C00, LENGTH = 61K
|
||||
rom (rx) : ORIGIN = 0x08005000, LENGTH = 0K
|
||||
}
|
||||
25
ldscripts/ram.ld
Normal file
25
ldscripts/ram.ld
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* libmaple linker script for RAM builds.
|
||||
*
|
||||
* A Flash build puts .text, .rodata, and .data/.bss/heap (of course)
|
||||
* in SRAM, but offsets the sections by enough space to store the
|
||||
* Maple bootloader, which uses low memory.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This pulls in the appropriate MEMORY declaration from the right
|
||||
* subdirectory of stm32/mem/ (the environment must call ld with the
|
||||
* right include directory flags to make this happen). Boards can also
|
||||
* use this file to use any of libmaple's memory-related hooks (like
|
||||
* where the heap should live).
|
||||
*/
|
||||
INCLUDE mem-ram.inc
|
||||
|
||||
/* Provide memory region aliases for common.inc */
|
||||
REGION_ALIAS("REGION_TEXT", ram);
|
||||
REGION_ALIAS("REGION_DATA", ram);
|
||||
REGION_ALIAS("REGION_BSS", ram);
|
||||
REGION_ALIAS("REGION_RODATA", ram);
|
||||
|
||||
/* Let common.inc handle the real work. */
|
||||
INCLUDE ldscripts/common.inc
|
||||
18
ldscripts/stm32f103rb.ld
Normal file
18
ldscripts/stm32f103rb.ld
Normal file
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Linker script for Generic STM32F103RB boards.
|
||||
*/
|
||||
MEMORY
|
||||
{
|
||||
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 20K
|
||||
rom (rx) : ORIGIN = 0x08000000, LENGTH = 128K
|
||||
}
|
||||
|
||||
|
||||
/* Provide memory region aliases for common.inc */
|
||||
REGION_ALIAS("REGION_TEXT", rom);
|
||||
REGION_ALIAS("REGION_DATA", ram);
|
||||
REGION_ALIAS("REGION_BSS", ram);
|
||||
REGION_ALIAS("REGION_RODATA", rom);
|
||||
|
||||
/* Let common.inc handle the real work. */
|
||||
INCLUDE ldscripts/common.inc
|
||||
17
ldscripts/stm32f103rb_bootloader.ld
Normal file
17
ldscripts/stm32f103rb_bootloader.ld
Normal file
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Linker script for Generic STM32F103RB boards, using the generic bootloader (which takes the lower 8k of memory)
|
||||
*/
|
||||
MEMORY
|
||||
{
|
||||
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 20K
|
||||
rom (rx) : ORIGIN = 0x08002000, LENGTH = 120K
|
||||
}
|
||||
|
||||
/* Provide memory region aliases for common.inc */
|
||||
REGION_ALIAS("REGION_TEXT", rom);
|
||||
REGION_ALIAS("REGION_DATA", ram);
|
||||
REGION_ALIAS("REGION_BSS", ram);
|
||||
REGION_ALIAS("REGION_RODATA", rom);
|
||||
|
||||
/* Let common.inc handle the real work. */
|
||||
INCLUDE ldscripts/common.inc
|
||||
18
ldscripts/stm32f103rc.ld
Normal file
18
ldscripts/stm32f103rc.ld
Normal file
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Linker script for Generic STM32F103RC boards.
|
||||
*/
|
||||
MEMORY
|
||||
{
|
||||
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 48K
|
||||
rom (rx) : ORIGIN = 0x08000000, LENGTH = 256K
|
||||
}
|
||||
|
||||
|
||||
/* Provide memory region aliases for common.inc */
|
||||
REGION_ALIAS("REGION_TEXT", rom);
|
||||
REGION_ALIAS("REGION_DATA", ram);
|
||||
REGION_ALIAS("REGION_BSS", ram);
|
||||
REGION_ALIAS("REGION_RODATA", rom);
|
||||
|
||||
/* Let common.inc handle the real work. */
|
||||
INCLUDE ldscripts/common.inc
|
||||
18
ldscripts/stm32f103rc_bootloader.ld
Normal file
18
ldscripts/stm32f103rc_bootloader.ld
Normal file
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Linker script for Generic STM32F103RC boards, using the generic bootloader (which takes the lower 8k of memory)
|
||||
*/
|
||||
|
||||
MEMORY
|
||||
{
|
||||
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 48K
|
||||
rom (rx) : ORIGIN = 0x08002000, LENGTH = 248K
|
||||
}
|
||||
|
||||
/* Provide memory region aliases for common.inc */
|
||||
REGION_ALIAS("REGION_TEXT", rom);
|
||||
REGION_ALIAS("REGION_DATA", ram);
|
||||
REGION_ALIAS("REGION_BSS", ram);
|
||||
REGION_ALIAS("REGION_RODATA", rom);
|
||||
|
||||
/* Let common.inc handle the real work. */
|
||||
INCLUDE ldscripts/common.inc
|
||||
18
ldscripts/stm32f103re.ld
Normal file
18
ldscripts/stm32f103re.ld
Normal file
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Linker script for Generic STM32F103RE boards.
|
||||
*/
|
||||
MEMORY
|
||||
{
|
||||
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 64K
|
||||
rom (rx) : ORIGIN = 0x08000000, LENGTH = 512K
|
||||
}
|
||||
|
||||
|
||||
/* Provide memory region aliases for common.inc */
|
||||
REGION_ALIAS("REGION_TEXT", rom);
|
||||
REGION_ALIAS("REGION_DATA", ram);
|
||||
REGION_ALIAS("REGION_BSS", ram);
|
||||
REGION_ALIAS("REGION_RODATA", rom);
|
||||
|
||||
/* Let common.inc handle the real work. */
|
||||
INCLUDE ldscripts/common.inc
|
||||
78
ldscripts/vector_symbols.inc
Normal file
78
ldscripts/vector_symbols.inc
Normal file
@@ -0,0 +1,78 @@
|
||||
EXTERN(__msp_init)
|
||||
EXTERN(__exc_reset)
|
||||
EXTERN(__exc_nmi)
|
||||
EXTERN(__exc_hardfault)
|
||||
EXTERN(__exc_memmanage)
|
||||
EXTERN(__exc_busfault)
|
||||
EXTERN(__exc_usagefault)
|
||||
EXTERN(__stm32reservedexception7)
|
||||
EXTERN(__stm32reservedexception8)
|
||||
EXTERN(__stm32reservedexception9)
|
||||
EXTERN(__stm32reservedexception10)
|
||||
EXTERN(__exc_svc)
|
||||
EXTERN(__exc_debug_monitor)
|
||||
EXTERN(__stm32reservedexception13)
|
||||
EXTERN(__exc_pendsv)
|
||||
EXTERN(__exc_systick)
|
||||
|
||||
EXTERN(__irq_wwdg)
|
||||
EXTERN(__irq_pvd)
|
||||
EXTERN(__irq_tamper)
|
||||
EXTERN(__irq_rtc)
|
||||
EXTERN(__irq_flash)
|
||||
EXTERN(__irq_rcc)
|
||||
EXTERN(__irq_exti0)
|
||||
EXTERN(__irq_exti1)
|
||||
EXTERN(__irq_exti2)
|
||||
EXTERN(__irq_exti3)
|
||||
EXTERN(__irq_exti4)
|
||||
EXTERN(__irq_dma1_channel1)
|
||||
EXTERN(__irq_dma1_channel2)
|
||||
EXTERN(__irq_dma1_channel3)
|
||||
EXTERN(__irq_dma1_channel4)
|
||||
EXTERN(__irq_dma1_channel5)
|
||||
EXTERN(__irq_dma1_channel6)
|
||||
EXTERN(__irq_dma1_channel7)
|
||||
EXTERN(__irq_adc)
|
||||
EXTERN(__irq_usb_hp_can_tx)
|
||||
EXTERN(__irq_usb_lp_can_rx0)
|
||||
EXTERN(__irq_can_rx1)
|
||||
EXTERN(__irq_can_sce)
|
||||
EXTERN(__irq_exti9_5)
|
||||
EXTERN(__irq_tim1_brk)
|
||||
EXTERN(__irq_tim1_up)
|
||||
EXTERN(__irq_tim1_trg_com)
|
||||
EXTERN(__irq_tim1_cc)
|
||||
EXTERN(__irq_tim2)
|
||||
EXTERN(__irq_tim3)
|
||||
EXTERN(__irq_tim4)
|
||||
EXTERN(__irq_i2c1_ev)
|
||||
EXTERN(__irq_i2c1_er)
|
||||
EXTERN(__irq_i2c2_ev)
|
||||
EXTERN(__irq_i2c2_er)
|
||||
EXTERN(__irq_spi1)
|
||||
EXTERN(__irq_spi2)
|
||||
EXTERN(__irq_usart1)
|
||||
EXTERN(__irq_usart2)
|
||||
EXTERN(__irq_usart3)
|
||||
EXTERN(__irq_exti15_10)
|
||||
EXTERN(__irq_rtcalarm)
|
||||
EXTERN(__irq_usbwakeup)
|
||||
|
||||
EXTERN(__irq_tim8_brk)
|
||||
EXTERN(__irq_tim8_up)
|
||||
EXTERN(__irq_tim8_trg_com)
|
||||
EXTERN(__irq_tim8_cc)
|
||||
EXTERN(__irq_adc3)
|
||||
EXTERN(__irq_fsmc)
|
||||
EXTERN(__irq_sdio)
|
||||
EXTERN(__irq_tim5)
|
||||
EXTERN(__irq_spi3)
|
||||
EXTERN(__irq_uart4)
|
||||
EXTERN(__irq_uart5)
|
||||
EXTERN(__irq_tim6)
|
||||
EXTERN(__irq_tim7)
|
||||
EXTERN(__irq_dma2_channel1)
|
||||
EXTERN(__irq_dma2_channel2)
|
||||
EXTERN(__irq_dma2_channel3)
|
||||
EXTERN(__irq_dma2_channel4_5)
|
||||
@@ -8,7 +8,7 @@
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(ARDUINO_ARCH_AVR)
|
||||
#if defined(ARDUINO_ARCH_AVR)
|
||||
#include <EEPROM.h>
|
||||
#endif
|
||||
|
||||
@@ -31,10 +31,13 @@ extern DueFlashStorage EEPROM;
|
||||
extern NRFFlashStorage EEPROM;
|
||||
#endif
|
||||
|
||||
#ifdef ARDUINO_ARCH_STM32
|
||||
#include <NRFFlashStorage.h> //STUB
|
||||
extern NRFFlashStorage EEPROM;
|
||||
#endif
|
||||
//#ifdef ARDUINO_ARCH_STM32
|
||||
//#include <NRFFlashStorage.h> //STUB
|
||||
//extern NRFFlashStorage EEPROM;
|
||||
|
||||
// static char samBuffer[64];
|
||||
// short samBufferPos = 0;
|
||||
//#endif
|
||||
|
||||
|
||||
#if defined(__SAM3X8E__)
|
||||
@@ -48,7 +51,10 @@ NRFFlashStorage EEPROM;
|
||||
#endif
|
||||
|
||||
#ifdef ARDUINO_ARCH_STM32
|
||||
NRFFlashStorage EEPROM;
|
||||
//NRFFlashStorage EEPROM;
|
||||
#include <EEPROM.h>
|
||||
#define DATA_LENGTH E2END
|
||||
//FLASH_PAGE_SIZE = 0x400
|
||||
#endif
|
||||
|
||||
#if defined(FS_STORAGE)
|
||||
@@ -131,11 +137,15 @@ NRFFlashStorage EEPROM;
|
||||
int flashStream::open(short fileNum, char mode)
|
||||
{
|
||||
|
||||
#if defined(__SAM3X8E__)
|
||||
#if defined(__SAM3X8E__) //|| defined (ARDUINO_ARCH_STM32)
|
||||
if (samBufferPos) flush();
|
||||
samBufferPos = 0;
|
||||
#endif
|
||||
|
||||
#if defined (ARDUINO_ARCH_STM32)
|
||||
eeprom_buffer_fill();
|
||||
#endif
|
||||
|
||||
switch (fileNum) {
|
||||
case FN_CONFIG_JSON:
|
||||
pos = 0;
|
||||
@@ -182,9 +192,13 @@ NRFFlashStorage EEPROM;
|
||||
unsigned int flashStream::seek(unsigned int _pos)
|
||||
{
|
||||
|
||||
#if defined(__SAM3X8E__)
|
||||
if (samBufferPos) flush();
|
||||
#endif
|
||||
#if defined(__SAM3X8E__) //|| defined (ARDUINO_ARCH_STM32)
|
||||
if (samBufferPos) flush();
|
||||
#endif
|
||||
|
||||
#if defined (ARDUINO_ARCH_STM32)
|
||||
//eeprom_buffer_flush();
|
||||
#endif
|
||||
|
||||
pos=min(_pos, streamSize);
|
||||
//debugSerial<<F("Seek:")<<pos<<endl;
|
||||
@@ -217,10 +231,12 @@ NRFFlashStorage EEPROM;
|
||||
if (EEPROM.commitReset())
|
||||
infoSerial<<"Commited to FLASH"<<endl;
|
||||
else errorSerial<<"Commit error. len:"<<EEPROM.length()<<endl;
|
||||
#elif defined(__SAM3X8E__)
|
||||
#elif defined(__SAM3X8E__) //|| defined (ARDUINO_ARCH_STM32)
|
||||
if (samBufferPos)
|
||||
EEPROM.write(startPos+pos-samBufferPos,(byte*)samBuffer,samBufferPos);
|
||||
samBufferPos=0;
|
||||
#elif defined (ARDUINO_ARCH_STM32)
|
||||
eeprom_buffer_flush();
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -230,12 +246,13 @@ NRFFlashStorage EEPROM;
|
||||
#if defined(__AVR__)
|
||||
EEPROM.update(startPos+pos++,(char)ch);
|
||||
return 1;
|
||||
#elif defined(__SAM3X8E__)
|
||||
#elif defined(__SAM3X8E__)// || defined (ARDUINO_ARCH_STM32)
|
||||
|
||||
if (samBufferPos==sizeof(samBuffer))
|
||||
{
|
||||
samBufferPos = 0;
|
||||
EEPROM.write(startPos+pos-sizeof(samBuffer),(byte*)samBuffer,sizeof(samBuffer));
|
||||
EEPROM.write(startPos+pos-sizeof(samBuffer),(byte*)samBuffer,sizeof(samBuffer));
|
||||
|
||||
}
|
||||
|
||||
samBuffer[samBufferPos++]=ch;
|
||||
@@ -243,6 +260,17 @@ NRFFlashStorage EEPROM;
|
||||
return 1;
|
||||
// return EEPROM.write(startPos+pos++,(char)ch);
|
||||
|
||||
#elif defined (ARDUINO_ARCH_STM32)
|
||||
if (startPos+pos<=DATA_LENGTH)
|
||||
{
|
||||
eeprom_buffered_write_byte(startPos+pos++,(char)ch);
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
errorSerial<<F("Flash sector exceeded")<<endl;
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
EEPROM.write(startPos+pos++,(char)ch);
|
||||
return 1;
|
||||
|
||||
@@ -48,18 +48,18 @@ void out_AC::getConfig(){
|
||||
case 0: ACSerial=&Serial;
|
||||
|
||||
break;
|
||||
//#if defined (Serial1)
|
||||
#if not defined (AVR) || defined (DMX_DISABLE)
|
||||
case 1: ACSerial=&Serial1;
|
||||
break;
|
||||
//#endif
|
||||
//#if defined (Serial2)
|
||||
#endif
|
||||
#if defined (HAVE_HWSERIAL2) || defined (__SAM3X8E__) || defined (ESP32)
|
||||
case 2: ACSerial=&Serial2;
|
||||
break;
|
||||
//#endif
|
||||
//#if defined (Serial3)
|
||||
#endif
|
||||
#if defined (HAVE_HWSERIAL3) || defined (__SAM3X8E__)
|
||||
case 3: ACSerial=&Serial3;
|
||||
break;
|
||||
//#endif
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -827,13 +827,19 @@ monitor_speed = 115200
|
||||
|
||||
[env:stm32]
|
||||
platform = ststm32
|
||||
board = olimexino
|
||||
board_build.mcu = stm32f103rbt6
|
||||
board = genericSTM32F103RB
|
||||
;olimexino
|
||||
board_build.mcu = stm32f103rbt6
|
||||
;STM32Duino
|
||||
;generic_stm32f103r
|
||||
;board_build.ldscript=ldscripts\stm32f103rb_bootloader.ld
|
||||
board_build.f_cpu = 72000000L
|
||||
framework = arduino
|
||||
|
||||
monitor_dtr = 1
|
||||
upload_protocol = dfu
|
||||
;board_build.core = maple
|
||||
;board_build.core = maple // STM32Duino (DEFAULT) // STM32L0
|
||||
;board_build.core = stm32lo
|
||||
;monitor_dtr = 1
|
||||
upload_protocol = serial
|
||||
;debug_tool = cmsis-dap
|
||||
build_flags = !python get_build_flags.py stm32
|
||||
lib_ignore =
|
||||
@@ -862,19 +868,20 @@ lib_ignore =
|
||||
DS2482_OneWire
|
||||
ModbusMaster
|
||||
Syslog
|
||||
EEPROM
|
||||
NRFFlashStorage
|
||||
ClosedCube HDC1080
|
||||
SparkFun CCS811 Arduino Library
|
||||
M5Stack
|
||||
ArduinoOTA
|
||||
lib_deps =
|
||||
EEPROM
|
||||
https://github.com/anklimov/aJson
|
||||
https://github.com/anklimov/CmdArduino
|
||||
ArduinoHttpClient
|
||||
https://github.com/anklimov/pubsubclient.git
|
||||
Streaming
|
||||
Ethernet
|
||||
https://github.com/anklimov/NRFFlashStorage
|
||||
|
||||
Adafruit NeoPixel
|
||||
Adafruit MCP23017 Arduino Library
|
||||
Adafruit BusIO
|
||||
|
||||
Reference in New Issue
Block a user