lua on f407 (#2646)
* lua on f4 * move perf trace to efifeatures * check that it's defined * cypress and kinetis * it would help to define the correct thing * disable buffer if not used * we can work with 2k * turn off ramdisk on mre qc * wow strncpy is useless for truncated strings * turn off for bootloader * lto bootloader
This commit is contained in:
parent
dd6105cfa3
commit
e885526308
|
@ -14,7 +14,7 @@ endif
|
||||||
|
|
||||||
# disable some modules to shrink bootloader binary
|
# disable some modules to shrink bootloader binary
|
||||||
DDEFS += -DEFI_BOOTLOADER
|
DDEFS += -DEFI_BOOTLOADER
|
||||||
DDEFS += -DHAL_USE_EXT=FALSE -DHAL_USE_ICU=FALSE -DHAL_USE_PWM=FALSE -DHAL_USE_RTC=FALSE
|
DDEFS += -DHAL_USE_EXT=FALSE -DHAL_USE_ICU=FALSE -DHAL_USE_PWM=FALSE -DHAL_USE_RTC=FALSE -DEF_LUA=FALSE
|
||||||
#disable ChibiOS flsah driver and prevent header from include
|
#disable ChibiOS flsah driver and prevent header from include
|
||||||
DDEFS += -DHAL_USE_FLASH=FALSE
|
DDEFS += -DHAL_USE_FLASH=FALSE
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ endif
|
||||||
|
|
||||||
# Enable this if you want link time optimizations (LTO)
|
# Enable this if you want link time optimizations (LTO)
|
||||||
ifeq ($(USE_LTO),)
|
ifeq ($(USE_LTO),)
|
||||||
USE_LTO = no
|
USE_LTO = yes
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# If enabled, this option allows to compile the application in THUMB mode.
|
# If enabled, this option allows to compile the application in THUMB mode.
|
||||||
|
|
|
@ -740,10 +740,6 @@
|
||||||
/* Port-specific settings (override port settings defaulted in chcore.h). */
|
/* Port-specific settings (override port settings defaulted in chcore.h). */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
||||||
#undef ENABLE_PERF_TRACE
|
|
||||||
#define ENABLE_PERF_TRACE FALSE
|
|
||||||
#define TRACE_BUFFER_LENGTH 1
|
|
||||||
|
|
||||||
#endif /* CHCONF_H */
|
#endif /* CHCONF_H */
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
|
@ -378,6 +378,7 @@
|
||||||
#define EFI_UART_ECHO_TEST_MODE FALSE
|
#define EFI_UART_ECHO_TEST_MODE FALSE
|
||||||
#define EXTREME_TERM_LOGGING FALSE
|
#define EXTREME_TERM_LOGGING FALSE
|
||||||
#define EFI_PRINTF_FUEL_DETAILS FALSE
|
#define EFI_PRINTF_FUEL_DETAILS FALSE
|
||||||
|
#define ENABLE_PERF_TRACE FALSE
|
||||||
|
|
||||||
#define RAM_UNUSED_SIZE 1
|
#define RAM_UNUSED_SIZE 1
|
||||||
#define CCM_UNUSED_SIZE 1
|
#define CCM_UNUSED_SIZE 1
|
||||||
|
|
|
@ -741,10 +741,6 @@
|
||||||
/* Port-specific settings (override port settings defaulted in chcore.h). */
|
/* Port-specific settings (override port settings defaulted in chcore.h). */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
||||||
#undef ENABLE_PERF_TRACE
|
|
||||||
#define ENABLE_PERF_TRACE FALSE
|
|
||||||
#define TRACE_BUFFER_LENGTH 1
|
|
||||||
|
|
||||||
#endif /* CHCONF_H */
|
#endif /* CHCONF_H */
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
|
@ -344,6 +344,7 @@
|
||||||
#define EFI_UART_ECHO_TEST_MODE FALSE
|
#define EFI_UART_ECHO_TEST_MODE FALSE
|
||||||
#define EXTREME_TERM_LOGGING FALSE
|
#define EXTREME_TERM_LOGGING FALSE
|
||||||
#define EFI_PRINTF_FUEL_DETAILS FALSE
|
#define EFI_PRINTF_FUEL_DETAILS FALSE
|
||||||
|
#define ENABLE_PERF_TRACE FALSE
|
||||||
|
|
||||||
#define RAM_UNUSED_SIZE 1
|
#define RAM_UNUSED_SIZE 1
|
||||||
#define CCM_UNUSED_SIZE 1
|
#define CCM_UNUSED_SIZE 1
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
export PROJECT_BOARD=microrusefi
|
export PROJECT_BOARD=microrusefi
|
||||||
export PROJECT_CPU=ARCH_STM32F4
|
export PROJECT_CPU=ARCH_STM32F4
|
||||||
export EXTRA_PARAMS="-DHW_CHECK_MODE=TRUE -DANALOG_HW_CHECK_MODE=TRUE -DHW_CHECK_ALAWAYS_STIMULATE=TRUE -DSHORT_BOARD_NAME=mre_f4"
|
export EXTRA_PARAMS="-DHW_CHECK_MODE=TRUE -DANALOG_HW_CHECK_MODE=TRUE -DHW_CHECK_ALAWAYS_STIMULATE=TRUE -DSHORT_BOARD_NAME=mre_f4 -DRAMDISK_INVALID"
|
||||||
|
|
||||||
export DEFAULT_ENGINE_TYPE=-DDEFAULT_ENGINE_TYPE=MRE_BOARD_NEW_TEST
|
export DEFAULT_ENGINE_TYPE=-DDEFAULT_ENGINE_TYPE=MRE_BOARD_NEW_TEST
|
||||||
|
|
||||||
|
|
|
@ -264,12 +264,17 @@
|
||||||
|
|
||||||
// F42x has more memory, so we can:
|
// F42x has more memory, so we can:
|
||||||
// - use compressed USB MSD image (requires 32k of memory)
|
// - use compressed USB MSD image (requires 32k of memory)
|
||||||
// - use Lua interpreter (requires ~20k of memory)
|
// - use perf trace (requires ~16k of memory)
|
||||||
#ifdef EFI_IS_F42x
|
#ifdef EFI_IS_F42x
|
||||||
#define EFI_USE_COMPRESSED_INI_MSD
|
#define EFI_USE_COMPRESSED_INI_MSD
|
||||||
#define EFI_LUA TRUE
|
#define ENABLE_PERF_TRACE TRUE
|
||||||
#else
|
#else
|
||||||
#define EFI_LUA FALSE
|
// small memory F40x can't fit perf trace
|
||||||
|
#define ENABLE_PERF_TRACE FALSE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef EFI_LUA
|
||||||
|
#define EFI_LUA TRUE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef EFI_ENGINE_SNIFFER
|
#ifndef EFI_ENGINE_SNIFFER
|
||||||
|
|
|
@ -53,5 +53,5 @@
|
||||||
|
|
||||||
#define EFI_USE_COMPRESSED_INI_MSD
|
#define EFI_USE_COMPRESSED_INI_MSD
|
||||||
|
|
||||||
#undef EFI_LUA
|
#undef ENABLE_PERF_TRACE
|
||||||
#define EFI_LUA TRUE
|
#define ENABLE_PERF_TRACE TRUE
|
||||||
|
|
|
@ -32,5 +32,5 @@
|
||||||
// H7 has dual bank, so flash on its own (low priority) thread so as to not block any other operations
|
// H7 has dual bank, so flash on its own (low priority) thread so as to not block any other operations
|
||||||
#define EFI_FLASH_WRITE_THREAD TRUE
|
#define EFI_FLASH_WRITE_THREAD TRUE
|
||||||
|
|
||||||
#undef EFI_LUA
|
#undef ENABLE_PERF_TRACE
|
||||||
#define EFI_LUA TRUE
|
#define ENABLE_PERF_TRACE TRUE
|
||||||
|
|
|
@ -702,7 +702,7 @@ void initEngineContoller(DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||||
* UNUSED_SIZE constants.
|
* UNUSED_SIZE constants.
|
||||||
*/
|
*/
|
||||||
#ifndef RAM_UNUSED_SIZE
|
#ifndef RAM_UNUSED_SIZE
|
||||||
#define RAM_UNUSED_SIZE 4000
|
#define RAM_UNUSED_SIZE 2000
|
||||||
#endif
|
#endif
|
||||||
#ifndef CCM_UNUSED_SIZE
|
#ifndef CCM_UNUSED_SIZE
|
||||||
#define CCM_UNUSED_SIZE 300
|
#define CCM_UNUSED_SIZE 300
|
||||||
|
|
|
@ -244,7 +244,8 @@ void startLua() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
strncpy(interactiveCmd, str, sizeof(interactiveCmd));
|
strncpy(interactiveCmd, str, sizeof(interactiveCmd) - 1);
|
||||||
|
interactiveCmd[sizeof(interactiveCmd) - 1] = '\0';
|
||||||
|
|
||||||
interactivePending = true;
|
interactivePending = true;
|
||||||
});
|
});
|
||||||
|
|
|
@ -12,11 +12,20 @@
|
||||||
#include "efitime.h"
|
#include "efitime.h"
|
||||||
#include "os_util.h"
|
#include "os_util.h"
|
||||||
|
|
||||||
|
#ifndef ENABLE_PERF_TRACE
|
||||||
|
#error ENABLE_PERF_TRACE must be defined!
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef TRACE_BUFFER_LENGTH
|
#ifndef TRACE_BUFFER_LENGTH
|
||||||
#define TRACE_BUFFER_LENGTH 2048
|
#define TRACE_BUFFER_LENGTH 2048
|
||||||
#endif /* TRACE_BUFFER_LENGTH */
|
#endif /* TRACE_BUFFER_LENGTH */
|
||||||
|
|
||||||
|
// Disable the buffer if we're not enabled at all
|
||||||
|
#if !ENABLE_PERF_TRACE
|
||||||
|
#undef TRACE_BUFFER_LENGTH
|
||||||
|
#define TRACE_BUFFER_LENGTH 1
|
||||||
|
#endif
|
||||||
|
|
||||||
enum class EPhase : char
|
enum class EPhase : char
|
||||||
{
|
{
|
||||||
Start,
|
Start,
|
||||||
|
|
|
@ -16,11 +16,6 @@
|
||||||
|
|
||||||
#define CHPRINTF_USE_FLOAT TRUE
|
#define CHPRINTF_USE_FLOAT TRUE
|
||||||
|
|
||||||
#if !defined(ENABLE_PERF_TRACE) || defined(__DOXYGEN__)
|
|
||||||
// looks like this value could not be defined in efifeatures.h - please define either externally or just change the value here
|
|
||||||
#define ENABLE_PERF_TRACE TRUE
|
|
||||||
#endif /* ENABLE_PERF_TRACE */
|
|
||||||
|
|
||||||
#if !defined(_FROM_ASM_)
|
#if !defined(_FROM_ASM_)
|
||||||
#include "obd_error_codes.h"
|
#include "obd_error_codes.h"
|
||||||
#endif /* _FROM_ASM_ */
|
#endif /* _FROM_ASM_ */
|
||||||
|
|
Loading…
Reference in New Issue