h7 flash, guard against no CAN (#2317)
* h7 flash * guard some other stuff * I guess it just builds now? * maybe ci too
This commit is contained in:
parent
d05edd2a3d
commit
8cc6ef83f9
|
@ -12,7 +12,7 @@ jobs:
|
||||||
matrix:
|
matrix:
|
||||||
# What boards should we build for? In the 'include' section below,
|
# What boards should we build for? In the 'include' section below,
|
||||||
# set up what each of these boards needs to build.
|
# set up what each of these boards needs to build.
|
||||||
build-target: [hellen72, cypress, frankenso_na6, kinetis, mre_f4, mre_f4_recovery, mre_f4_hardware_QC_special_build, mre_f7, prometheus_405, prometheus_469, proteus_f4, proteus_f4_hardware_QC_special_build, proteus_f7, stm32f767_nucleo]
|
build-target: [hellen72, cypress, frankenso_na6, kinetis, mre_f4, mre_f4_recovery, mre_f4_hardware_QC_special_build, mre_f7, prometheus_405, prometheus_469, proteus_f4, proteus_f4_hardware_QC_special_build, proteus_f7, stm32f767_nucleo, stm32h743_nucleo]
|
||||||
|
|
||||||
include:
|
include:
|
||||||
# Board configurations
|
# Board configurations
|
||||||
|
@ -76,6 +76,11 @@ jobs:
|
||||||
console-settings: firmware/config/boards/nucleo_f767/rusefi_console_properties.xml
|
console-settings: firmware/config/boards/nucleo_f767/rusefi_console_properties.xml
|
||||||
skip-config: yes
|
skip-config: yes
|
||||||
|
|
||||||
|
- build-target: stm32h743_nucleo
|
||||||
|
folder: nucleo_h743
|
||||||
|
ini-file: no
|
||||||
|
skip-config: yes
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
with:
|
with:
|
||||||
|
|
|
@ -4,8 +4,6 @@
|
||||||
BOARDINC = $(PROJECT_DIR)/config/stm32h7ems
|
BOARDINC = $(PROJECT_DIR)/config/stm32h7ems
|
||||||
CONFDIR = config/stm32h7ems
|
CONFDIR = config/stm32h7ems
|
||||||
|
|
||||||
LDSCRIPT = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/ld/STM32H743xI.ld
|
|
||||||
|
|
||||||
# Shared variables
|
# Shared variables
|
||||||
ALLCPPSRC += $(BOARDCPPSRC)
|
ALLCPPSRC += $(PROJECT_DIR)/config/boards/nucleo_h743/board_configuration.cpp
|
||||||
ALLINC += $(BOARDINC)
|
ALLINC += $(BOARDINC)
|
||||||
|
|
|
@ -0,0 +1,45 @@
|
||||||
|
#include "adc_inputs.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Board-specific configuration code overrides.
|
||||||
|
* @todo Add your board-specific code, if any.
|
||||||
|
*/
|
||||||
|
void setBoardConfigurationOverrides(void) {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Board-specific pin configuration code overrides. Needed by bootloader code.
|
||||||
|
* @todo Add your board-specific code, if any.
|
||||||
|
*/
|
||||||
|
void setPinConfigurationOverrides(void) {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Board-specific Serial configuration code overrides. Needed by bootloader code.
|
||||||
|
* @todo Add your board-specific code, if any.
|
||||||
|
*/
|
||||||
|
void setSerialConfigurationOverrides(void) {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Board-specific SD card configuration code overrides. Needed by bootloader code.
|
||||||
|
* @todo Add your board-specific code, if any.
|
||||||
|
*/
|
||||||
|
void setSdCardConfigurationOverrides(void) {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Board-specific ADC channel configuration code overrides.
|
||||||
|
* @todo Add your board-specific code, if any.
|
||||||
|
*/
|
||||||
|
void setAdcChannelOverrides(void) {
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: fix analog inputs so we don't need these stubs
|
||||||
|
float getVoltage(const char*, adc_channel_e) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
float getVoltageDivided(const char*, adc_channel_e) {
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -9,14 +9,12 @@ export PROJECT_BOARD=nucleo_h743
|
||||||
export PROJECT_CPU=ARCH_STM32H7
|
export PROJECT_CPU=ARCH_STM32H7
|
||||||
export USE_LIS302=no
|
export USE_LIS302=no
|
||||||
export USE_FATFS=no
|
export USE_FATFS=no
|
||||||
export EXTRA_PARAMS="-DDUMMY -DSTM32H743xx \
|
export EXTRA_PARAMS="-DDUMMY \
|
||||||
-DEFI_INJECTOR_PIN3=GPIO_UNASSIGNED \
|
-DEFI_INJECTOR_PIN3=GPIO_UNASSIGNED \
|
||||||
-DFIRMWARE_ID=\\\"nucleoH743\\\" \
|
-DFIRMWARE_ID=\\\"nucleoH743\\\" \
|
||||||
-DEFI_COMMUNICATION_PIN=GPIOB_7 \
|
-DEFI_COMMUNICATION_PIN=GPIOB_7 \
|
||||||
-DSTATUS_LOGGING_BUFFER_SIZE=1400 \
|
-DSTATUS_LOGGING_BUFFER_SIZE=1400 \
|
||||||
-DLED_CRITICAL_ERROR_BRAIN_PIN=GPIOB_14 \
|
-DLED_CRITICAL_ERROR_BRAIN_PIN=GPIOB_14"
|
||||||
-DEFI_ENABLE_ASSERTS=FALSE \
|
|
||||||
-DCH_DBG_ENABLE_CHECKS=FALSE -DCH_DBG_ENABLE_ASSERTS=FALSE -DCH_DBG_ENABLE_STACK_CHECK=FALSE -DCH_DBG_FILL_THREADS=FALSE -DCH_DBG_THREADS_PROFILING=FALSE"
|
|
||||||
export DEBUG_LEVEL_OPT="-O2"
|
export DEBUG_LEVEL_OPT="-O2"
|
||||||
|
|
||||||
bash ../common_make.sh
|
bash ../common_make.sh
|
||||||
|
|
|
@ -257,7 +257,7 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
if (widebandUpdatePending) {
|
if (widebandUpdatePending) {
|
||||||
#if EFI_WIDEBAND_FIRMWARE_UPDATE
|
#if EFI_WIDEBAND_FIRMWARE_UPDATE && HAL_USE_CAN
|
||||||
updateWidebandFirmware(logger);
|
updateWidebandFirmware(logger);
|
||||||
#endif
|
#endif
|
||||||
widebandUpdatePending = false;
|
widebandUpdatePending = false;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
|
|
||||||
#if EFI_WIDEBAND_FIRMWARE_UPDATE
|
#if EFI_WIDEBAND_FIRMWARE_UPDATE && HAL_USE_CAN
|
||||||
|
|
||||||
#include "ch.h"
|
#include "ch.h"
|
||||||
#include "can_msg_tx.h"
|
#include "can_msg_tx.h"
|
||||||
|
@ -95,4 +95,4 @@ void updateWidebandFirmware(Logging* logging) {
|
||||||
waitingBootloaderThread = nullptr;
|
waitingBootloaderThread = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // EFI_WIDEBAND_FIRMWARE_UPDATE
|
#endif // EFI_WIDEBAND_FIRMWARE_UPDATE && HAL_USE_CAN
|
||||||
|
|
|
@ -87,6 +87,10 @@
|
||||||
|
|
||||||
/* Includes ------------------------------------------------------------------*/
|
/* Includes ------------------------------------------------------------------*/
|
||||||
//#include "stm32h7xx_hal.h"
|
//#include "stm32h7xx_hal.h"
|
||||||
|
#include "stm32h7xx_hal_flash_ex.h"
|
||||||
|
#include "stm32h7xx_hal_flash.h"
|
||||||
|
|
||||||
|
#define assert_param(expr) ((void)0)
|
||||||
|
|
||||||
/** @addtogroup STM32H7xx_HAL_Driver
|
/** @addtogroup STM32H7xx_HAL_Driver
|
||||||
* @{
|
* @{
|
||||||
|
@ -729,7 +733,7 @@ void HAL_FLASH_IRQHandler(void)
|
||||||
__weak void HAL_FLASH_EndOfOperationCallback(uint32_t ReturnValue)
|
__weak void HAL_FLASH_EndOfOperationCallback(uint32_t ReturnValue)
|
||||||
{
|
{
|
||||||
/* Prevent unused argument(s) compilation warning */
|
/* Prevent unused argument(s) compilation warning */
|
||||||
UNUSED(ReturnValue);
|
(void)ReturnValue;
|
||||||
|
|
||||||
/* NOTE : This function Should not be modified, when the callback is needed,
|
/* NOTE : This function Should not be modified, when the callback is needed,
|
||||||
the HAL_FLASH_EndOfOperationCallback could be implemented in the user file
|
the HAL_FLASH_EndOfOperationCallback could be implemented in the user file
|
||||||
|
@ -747,7 +751,7 @@ __weak void HAL_FLASH_EndOfOperationCallback(uint32_t ReturnValue)
|
||||||
__weak void HAL_FLASH_OperationErrorCallback(uint32_t ReturnValue)
|
__weak void HAL_FLASH_OperationErrorCallback(uint32_t ReturnValue)
|
||||||
{
|
{
|
||||||
/* Prevent unused argument(s) compilation warning */
|
/* Prevent unused argument(s) compilation warning */
|
||||||
UNUSED(ReturnValue);
|
(void)ReturnValue;
|
||||||
|
|
||||||
/* NOTE : This function Should not be modified, when the callback is needed,
|
/* NOTE : This function Should not be modified, when the callback is needed,
|
||||||
the HAL_FLASH_OperationErrorCallback could be implemented in the user file
|
the HAL_FLASH_OperationErrorCallback could be implemented in the user file
|
||||||
|
@ -988,13 +992,15 @@ uint32_t HAL_FLASH_GetError(void)
|
||||||
*/
|
*/
|
||||||
HAL_StatusTypeDef FLASH_WaitForLastOperation(uint32_t Timeout, uint32_t Bank)
|
HAL_StatusTypeDef FLASH_WaitForLastOperation(uint32_t Timeout, uint32_t Bank)
|
||||||
{
|
{
|
||||||
|
(void)Timeout;
|
||||||
|
|
||||||
/* Wait for the FLASH operation to complete by polling on QW flag to be reset.
|
/* Wait for the FLASH operation to complete by polling on QW flag to be reset.
|
||||||
Even if the FLASH operation fails, the QW flag will be reset and an error
|
Even if the FLASH operation fails, the QW flag will be reset and an error
|
||||||
flag will be set */
|
flag will be set */
|
||||||
|
|
||||||
uint32_t bsyflag = FLASH_FLAG_QW_BANK1;
|
uint32_t bsyflag = FLASH_FLAG_QW_BANK1;
|
||||||
uint32_t errorflag = FLASH->SR1 & FLASH_FLAG_ALL_ERRORS_BANK1;
|
uint32_t errorflag = FLASH->SR1 & FLASH_FLAG_ALL_ERRORS_BANK1;
|
||||||
uint32_t tickstart = HAL_GetTick();
|
//uint32_t tickstart = HAL_GetTick();
|
||||||
|
|
||||||
assert_param(IS_FLASH_BANK_EXCLUSIVE(Bank));
|
assert_param(IS_FLASH_BANK_EXCLUSIVE(Bank));
|
||||||
|
|
||||||
|
@ -1013,10 +1019,11 @@ HAL_StatusTypeDef FLASH_WaitForLastOperation(uint32_t Timeout, uint32_t Bank)
|
||||||
{
|
{
|
||||||
if(Timeout != HAL_MAX_DELAY)
|
if(Timeout != HAL_MAX_DELAY)
|
||||||
{
|
{
|
||||||
if(((HAL_GetTick() - tickstart) > Timeout) || (Timeout == 0U))
|
// todo: implement rusEfi own timeout
|
||||||
{
|
// if(((HAL_GetTick() - tickstart) > Timeout) || (Timeout == 0U))
|
||||||
return HAL_TIMEOUT;
|
// {
|
||||||
}
|
// return HAL_TIMEOUT;
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1062,19 +1069,21 @@ HAL_StatusTypeDef FLASH_WaitForLastOperation(uint32_t Timeout, uint32_t Bank)
|
||||||
*/
|
*/
|
||||||
HAL_StatusTypeDef FLASH_OB_WaitForLastOperation(uint32_t Timeout)
|
HAL_StatusTypeDef FLASH_OB_WaitForLastOperation(uint32_t Timeout)
|
||||||
{
|
{
|
||||||
|
(void)Timeout;
|
||||||
/* Get timeout */
|
/* Get timeout */
|
||||||
uint32_t tickstart = HAL_GetTick();
|
//uint32_t tickstart = HAL_GetTick();
|
||||||
|
|
||||||
/* Wait for the FLASH Option Bytes change operation to complete by polling on OPT_BUSY flag to be reset */
|
/* Wait for the FLASH Option Bytes change operation to complete by polling on OPT_BUSY flag to be reset */
|
||||||
while(READ_BIT(FLASH->OPTSR_CUR, FLASH_OPTSR_OPT_BUSY) != 0U)
|
while(READ_BIT(FLASH->OPTSR_CUR, FLASH_OPTSR_OPT_BUSY) != 0U)
|
||||||
{
|
{
|
||||||
if(Timeout != HAL_MAX_DELAY)
|
// TODO: rusefi own timeout
|
||||||
|
/*if(Timeout != HAL_MAX_DELAY)
|
||||||
{
|
{
|
||||||
if(((HAL_GetTick() - tickstart) > Timeout) || (Timeout == 0U))
|
if(((HAL_GetTick() - tickstart) > Timeout) || (Timeout == 0U))
|
||||||
{
|
{
|
||||||
return HAL_TIMEOUT;
|
return HAL_TIMEOUT;
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check option byte change error */
|
/* Check option byte change error */
|
||||||
|
@ -1102,7 +1111,8 @@ HAL_StatusTypeDef FLASH_OB_WaitForLastOperation(uint32_t Timeout)
|
||||||
HAL_StatusTypeDef FLASH_CRC_WaitForLastOperation(uint32_t Timeout, uint32_t Bank)
|
HAL_StatusTypeDef FLASH_CRC_WaitForLastOperation(uint32_t Timeout, uint32_t Bank)
|
||||||
{
|
{
|
||||||
uint32_t bsyflag;
|
uint32_t bsyflag;
|
||||||
uint32_t tickstart = HAL_GetTick();
|
(void)Timeout;
|
||||||
|
//uint32_t tickstart = HAL_GetTick();
|
||||||
|
|
||||||
assert_param(IS_FLASH_BANK_EXCLUSIVE(Bank));
|
assert_param(IS_FLASH_BANK_EXCLUSIVE(Bank));
|
||||||
|
|
||||||
|
@ -1119,13 +1129,14 @@ HAL_StatusTypeDef FLASH_CRC_WaitForLastOperation(uint32_t Timeout, uint32_t Bank
|
||||||
/* Wait for the FLASH CRC computation to complete by polling on CRC_BUSY flag to be reset */
|
/* Wait for the FLASH CRC computation to complete by polling on CRC_BUSY flag to be reset */
|
||||||
while(__HAL_FLASH_GET_FLAG(bsyflag))
|
while(__HAL_FLASH_GET_FLAG(bsyflag))
|
||||||
{
|
{
|
||||||
if(Timeout != HAL_MAX_DELAY)
|
// TODO: rusefi own timeout
|
||||||
{
|
// if(Timeout != HAL_MAX_DELAY)
|
||||||
if(((HAL_GetTick() - tickstart) > Timeout) || (Timeout == 0U))
|
// {
|
||||||
{
|
// if(((HAL_GetTick() - tickstart) > Timeout) || (Timeout == 0U))
|
||||||
return HAL_TIMEOUT;
|
// {
|
||||||
}
|
// return HAL_TIMEOUT;
|
||||||
}
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check FLASH CRC read error flag */
|
/* Check FLASH CRC read error flag */
|
||||||
|
|
|
@ -75,6 +75,10 @@
|
||||||
|
|
||||||
/* Includes ------------------------------------------------------------------*/
|
/* Includes ------------------------------------------------------------------*/
|
||||||
//#include "stm32h7xx_hal.h"
|
//#include "stm32h7xx_hal.h"
|
||||||
|
#include "stm32h7xx_hal_flash_ex.h"
|
||||||
|
#include "stm32h7xx_hal_flash.h"
|
||||||
|
|
||||||
|
#define assert_param(expr) ((void)0)
|
||||||
|
|
||||||
/** @addtogroup STM32H7xx_HAL_Driver
|
/** @addtogroup STM32H7xx_HAL_Driver
|
||||||
* @{
|
* @{
|
||||||
|
|
Loading…
Reference in New Issue