mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-24 13:55:51 +08:00
[chibios] Bootloader support for Lisa/Lia M/MX and PX4FMU
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
|
||||
<firmware name="rotorcraft">
|
||||
|
||||
<target name="ap" board="px4fmu_2.4" />
|
||||
<target name="ap" board="px4fmu_2.4_chibios" />
|
||||
<configure name="PERIODIC_FREQUENCY" value="200"/>
|
||||
<configure name="TELEMETRY_FREQUENCY" value="60"/>
|
||||
|
||||
@@ -121,7 +121,7 @@
|
||||
|
||||
<modules main_freq="PERIODIC_FREQUENCY">
|
||||
<!-- allow flashing FBW target through AP -->
|
||||
<module name="px4_flash"/>
|
||||
<!--module name="px4_flash"/-->
|
||||
|
||||
<!-- CPU utilization monitor -->
|
||||
<module name="sys_mon"/>
|
||||
|
||||
@@ -11,6 +11,7 @@ RP3 Lisa MX
|
||||
<module name="radio_control" type="sbus">
|
||||
<configure name="SBUS_PORT" value="UART5"/>
|
||||
</module>
|
||||
<configure name="HAS_LUFTBOOT" value="1"/>
|
||||
</target>
|
||||
|
||||
<!-- NOTE: if you want to use extra_dl module for HITL
|
||||
|
||||
@@ -25,7 +25,7 @@ PROJECT = $(TARGET)
|
||||
|
||||
# Project specific files and paths (see Makefile.chibios for details)
|
||||
CHIBIOS_BOARD_PLATFORM = STM32F1xx/platform.mk
|
||||
# CHIBIOS_BOARD_LINKER script depends on whether we use a bootloader or not, see below
|
||||
CHIBIOS_BOARD_LINKER = STM32F107xC.ld
|
||||
CHIBIOS_BOARD_STARTUP = startup_stm32f1xx.mk
|
||||
|
||||
##############################################################################
|
||||
@@ -39,8 +39,7 @@ FLASH_MODE ?= DFU
|
||||
|
||||
HAS_LUFTBOOT ?= 1
|
||||
ifeq (,$(findstring $(HAS_LUFTBOOT),0 FALSE))
|
||||
$(TARGET).CFLAGS+=-DLUFTBOOT -DCORTEX_VTOR_INIT=0x00002000
|
||||
CHIBIOS_BOARD_LINKER = STM32F107xC_luftboot.ld
|
||||
else
|
||||
CHIBIOS_BOARD_LINKER = STM32F107xC.ld
|
||||
$(TARGET).CFLAGS+=-DLUFTBOOT
|
||||
DFU_ADDR = 0x8002000
|
||||
DFU_PRODUCT = Lisa/Lia
|
||||
endif
|
||||
|
||||
@@ -30,11 +30,16 @@ CHIBIOS_BOARD_PLATFORM = STM32F4xx/platform.mk
|
||||
CHIBIOS_BOARD_LINKER = STM32F407xG.ld
|
||||
CHIBIOS_BOARD_STARTUP = startup_stm32f4xx.mk
|
||||
|
||||
HAS_LUFTBOOT ?= 0
|
||||
ifeq (,$(findstring $(HAS_LUFTBOOT),0 FALSE))
|
||||
$(TARGET).CFLAGS+=-DLUFTBOOT
|
||||
DFU_ADDR = 0x8004000
|
||||
DFU_PRODUCT = Lisa/Lia
|
||||
endif
|
||||
|
||||
##############################################################################
|
||||
# Compiler settings
|
||||
#
|
||||
MCU = cortex-m4
|
||||
|
||||
HAS_LUFTBOOT = FALSE
|
||||
|
||||
include $(PAPARAZZI_SRC)/conf/boards/lisa_mx_defaults.makefile
|
||||
|
||||
@@ -32,6 +32,14 @@ CHIBIOS_BOARD_PLATFORM = STM32F4xx/platform.mk
|
||||
CHIBIOS_BOARD_LINKER = STM32F407xG.ld
|
||||
CHIBIOS_BOARD_STARTUP = startup_stm32f4xx.mk
|
||||
|
||||
# In this case we dont have LUFTBOOT but PX4_BOOTLOADER, but in order
|
||||
# to correctly initialize the interrupt vector we have to define that
|
||||
# the board has LUFTBOOT
|
||||
HAS_LUFTBOOT ?= 1
|
||||
ifeq (,$(findstring $(HAS_LUFTBOOT),0 FALSE))
|
||||
$(TARGET).CFLAGS+=-DLUFTBOOT
|
||||
endif
|
||||
|
||||
##############################################################################
|
||||
# Compiler settings
|
||||
#
|
||||
|
||||
+85
-85
@@ -1,85 +1,85 @@
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* ST32F107xC memory setup.
|
||||
* with LUFTBOOT offset
|
||||
*/
|
||||
MEMORY
|
||||
{
|
||||
flash0 : org = 0x08002000, len = 256k
|
||||
flash1 : org = 0x00000000, len = 0
|
||||
flash2 : org = 0x00000000, len = 0
|
||||
flash3 : org = 0x00000000, len = 0
|
||||
flash4 : org = 0x00000000, len = 0
|
||||
flash5 : org = 0x00000000, len = 0
|
||||
flash6 : org = 0x00000000, len = 0
|
||||
flash7 : org = 0x00000000, len = 0
|
||||
ram0 : org = 0x20000000, len = 64k
|
||||
ram1 : org = 0x00000000, len = 0
|
||||
ram2 : org = 0x00000000, len = 0
|
||||
ram3 : org = 0x00000000, len = 0
|
||||
ram4 : org = 0x00000000, len = 0
|
||||
ram5 : org = 0x00000000, len = 0
|
||||
ram6 : org = 0x00000000, len = 0
|
||||
ram7 : org = 0x00000000, len = 0
|
||||
}
|
||||
|
||||
/* For each data/text section two region are defined, a virtual region
|
||||
and a load region (_LMA suffix).*/
|
||||
|
||||
/* Flash region to be used for exception vectors.*/
|
||||
REGION_ALIAS("VECTORS_FLASH", flash0);
|
||||
REGION_ALIAS("VECTORS_FLASH_LMA", flash0);
|
||||
|
||||
/* Flash region to be used for constructors and destructors.*/
|
||||
REGION_ALIAS("XTORS_FLASH", flash0);
|
||||
REGION_ALIAS("XTORS_FLASH_LMA", flash0);
|
||||
|
||||
/* Flash region to be used for code text.*/
|
||||
REGION_ALIAS("TEXT_FLASH", flash0);
|
||||
REGION_ALIAS("TEXT_FLASH_LMA", flash0);
|
||||
|
||||
/* Flash region to be used for read only data.*/
|
||||
REGION_ALIAS("RODATA_FLASH", flash0);
|
||||
REGION_ALIAS("RODATA_FLASH_LMA", flash0);
|
||||
|
||||
/* Flash region to be used for various.*/
|
||||
REGION_ALIAS("VARIOUS_FLASH", flash0);
|
||||
REGION_ALIAS("VARIOUS_FLASH_LMA", flash0);
|
||||
|
||||
/* Flash region to be used for RAM(n) initialization data.*/
|
||||
REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0);
|
||||
|
||||
/* RAM region to be used for Main stack. This stack accommodates the processing
|
||||
of all exceptions and interrupts.*/
|
||||
REGION_ALIAS("MAIN_STACK_RAM", ram0);
|
||||
|
||||
/* RAM region to be used for the process stack. This is the stack used by
|
||||
the main() function.*/
|
||||
REGION_ALIAS("PROCESS_STACK_RAM", ram0);
|
||||
|
||||
/* RAM region to be used for data segment.*/
|
||||
REGION_ALIAS("DATA_RAM", ram0);
|
||||
REGION_ALIAS("DATA_RAM_LMA", flash0);
|
||||
|
||||
/* RAM region to be used for BSS segment.*/
|
||||
REGION_ALIAS("BSS_RAM", ram0);
|
||||
|
||||
/* RAM region to be used for the default heap.*/
|
||||
REGION_ALIAS("HEAP_RAM", ram0);
|
||||
|
||||
INCLUDE rules.ld
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* ST32F107xC memory setup.
|
||||
*/
|
||||
MEMORY
|
||||
{
|
||||
flash0 : org = 0x08002000, len = 256k
|
||||
flash1 : org = 0x00000000, len = 0
|
||||
flash2 : org = 0x00000000, len = 0
|
||||
flash3 : org = 0x00000000, len = 0
|
||||
flash4 : org = 0x00000000, len = 0
|
||||
flash5 : org = 0x00000000, len = 0
|
||||
flash6 : org = 0x00000000, len = 0
|
||||
flash7 : org = 0x00000000, len = 0
|
||||
ram0 : org = 0x20000000, len = 64k
|
||||
ram1 : org = 0x00000000, len = 0
|
||||
ram2 : org = 0x00000000, len = 0
|
||||
ram3 : org = 0x00000000, len = 0
|
||||
ram4 : org = 0x00000000, len = 0
|
||||
ram5 : org = 0x00000000, len = 0
|
||||
ram6 : org = 0x00000000, len = 0
|
||||
ram7 : org = 0x00000000, len = 0
|
||||
}
|
||||
|
||||
/* For each data/text section two region are defined, a virtual region
|
||||
and a load region (_LMA suffix).*/
|
||||
|
||||
/* Flash region to be used for exception vectors.*/
|
||||
REGION_ALIAS("VECTORS_FLASH", flash0);
|
||||
REGION_ALIAS("VECTORS_FLASH_LMA", flash0);
|
||||
|
||||
/* Flash region to be used for constructors and destructors.*/
|
||||
REGION_ALIAS("XTORS_FLASH", flash0);
|
||||
REGION_ALIAS("XTORS_FLASH_LMA", flash0);
|
||||
|
||||
/* Flash region to be used for code text.*/
|
||||
REGION_ALIAS("TEXT_FLASH", flash0);
|
||||
REGION_ALIAS("TEXT_FLASH_LMA", flash0);
|
||||
|
||||
/* Flash region to be used for read only data.*/
|
||||
REGION_ALIAS("RODATA_FLASH", flash0);
|
||||
REGION_ALIAS("RODATA_FLASH_LMA", flash0);
|
||||
|
||||
/* Flash region to be used for various.*/
|
||||
REGION_ALIAS("VARIOUS_FLASH", flash0);
|
||||
REGION_ALIAS("VARIOUS_FLASH_LMA", flash0);
|
||||
|
||||
/* Flash region to be used for RAM(n) initialization data.*/
|
||||
REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0);
|
||||
|
||||
/* RAM region to be used for Main stack. This stack accommodates the processing
|
||||
of all exceptions and interrupts.*/
|
||||
REGION_ALIAS("MAIN_STACK_RAM", ram0);
|
||||
|
||||
/* RAM region to be used for the process stack. This is the stack used by
|
||||
the main() function.*/
|
||||
REGION_ALIAS("PROCESS_STACK_RAM", ram0);
|
||||
|
||||
/* RAM region to be used for data segment.*/
|
||||
REGION_ALIAS("DATA_RAM", ram0);
|
||||
REGION_ALIAS("DATA_RAM_LMA", flash0);
|
||||
|
||||
/* RAM region to be used for BSS segment.*/
|
||||
REGION_ALIAS("BSS_RAM", ram0);
|
||||
|
||||
/* RAM region to be used for the default heap.*/
|
||||
REGION_ALIAS("HEAP_RAM", ram0);
|
||||
|
||||
/* Generic rules inclusion.*/
|
||||
INCLUDE rules.ld
|
||||
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* STM32F407xG memory setup.
|
||||
* Note: Use of ram1 and ram2 is mutually exclusive with use of ram0.
|
||||
*/
|
||||
MEMORY
|
||||
{
|
||||
flash0 : org = 0x08004000, len = 1M
|
||||
flash1 : org = 0x00000000, len = 0
|
||||
flash2 : org = 0x00000000, len = 0
|
||||
flash3 : org = 0x00000000, len = 0
|
||||
flash4 : org = 0x00000000, len = 0
|
||||
flash5 : org = 0x00000000, len = 0
|
||||
flash6 : org = 0x00000000, len = 0
|
||||
flash7 : org = 0x00000000, len = 0
|
||||
ram0 : org = 0x20000000, len = 128k /* SRAM1 + SRAM2 */
|
||||
ram1 : org = 0x20000000, len = 112k /* SRAM1 */
|
||||
ram2 : org = 0x2001C000, len = 16k /* SRAM2 */
|
||||
ram3 : org = 0x00000000, len = 0
|
||||
ram4 : org = 0x10000000, len = 64k /* CCM SRAM */
|
||||
ram5 : org = 0x40024000, len = 4k /* BCKP SRAM */
|
||||
ram6 : org = 0x00000000, len = 0
|
||||
ram7 : org = 0x00000000, len = 0
|
||||
}
|
||||
|
||||
/* For each data/text section two region are defined, a virtual region
|
||||
and a load region (_LMA suffix).*/
|
||||
|
||||
/* Flash region to be used for exception vectors.*/
|
||||
REGION_ALIAS("VECTORS_FLASH", flash0);
|
||||
REGION_ALIAS("VECTORS_FLASH_LMA", flash0);
|
||||
|
||||
/* Flash region to be used for constructors and destructors.*/
|
||||
REGION_ALIAS("XTORS_FLASH", flash0);
|
||||
REGION_ALIAS("XTORS_FLASH_LMA", flash0);
|
||||
|
||||
/* Flash region to be used for code text.*/
|
||||
REGION_ALIAS("TEXT_FLASH", flash0);
|
||||
REGION_ALIAS("TEXT_FLASH_LMA", flash0);
|
||||
|
||||
/* Flash region to be used for read only data.*/
|
||||
REGION_ALIAS("RODATA_FLASH", flash0);
|
||||
REGION_ALIAS("RODATA_FLASH_LMA", flash0);
|
||||
|
||||
/* Flash region to be used for various.*/
|
||||
REGION_ALIAS("VARIOUS_FLASH", flash0);
|
||||
REGION_ALIAS("VARIOUS_FLASH_LMA", flash0);
|
||||
|
||||
/* Flash region to be used for RAM(n) initialization data.*/
|
||||
REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0);
|
||||
|
||||
/* RAM region to be used for Main stack. This stack accommodates the processing
|
||||
of all exceptions and interrupts.*/
|
||||
REGION_ALIAS("MAIN_STACK_RAM", ram0);
|
||||
|
||||
/* RAM region to be used for the process stack. This is the stack used by
|
||||
the main() function.*/
|
||||
REGION_ALIAS("PROCESS_STACK_RAM", ram0);
|
||||
|
||||
/* RAM region to be used for data segment.*/
|
||||
REGION_ALIAS("DATA_RAM", ram0);
|
||||
REGION_ALIAS("DATA_RAM_LMA", flash0);
|
||||
|
||||
/* RAM region to be used for BSS segment.*/
|
||||
REGION_ALIAS("BSS_RAM", ram0);
|
||||
|
||||
/* RAM region to be used for the default heap.*/
|
||||
REGION_ALIAS("HEAP_RAM", ram0);
|
||||
|
||||
/* Generic rules inclusion.*/
|
||||
INCLUDE rules.ld
|
||||
Reference in New Issue
Block a user