Compare commits
5 Commits
8f23be6be1
...
full-featu
| Author | SHA1 | Date | |
|---|---|---|---|
|
86f688c0f7
|
|||
|
e46a75f99f
|
|||
|
0195578317
|
|||
|
c6fedbd759
|
|||
|
df13585c01
|
@ -144,6 +144,7 @@ mission_t mission = M_NONE;
|
||||
#ifdef WATCHDOG_STM
|
||||
bool pHeartbeat = false;
|
||||
bool WD_OK = false;
|
||||
bool WD_initialized = false;
|
||||
#endif
|
||||
|
||||
/* USER CODE END PV */
|
||||
@ -190,13 +191,20 @@ int main(void)
|
||||
|
||||
/* USER CODE BEGIN SysInit */
|
||||
|
||||
/* USER CODE END SysInit */
|
||||
MX_GPIO_Init();
|
||||
MX_CAN_Init();
|
||||
|
||||
#if false
|
||||
/* USER CODE END SysInit */
|
||||
/* Initialize all configured peripherals */
|
||||
MX_GPIO_Init();
|
||||
MX_CAN_Init();
|
||||
MX_IWDG_Init();
|
||||
/* USER CODE BEGIN 2 */
|
||||
#endif
|
||||
|
||||
// Freeze WDG when debugging
|
||||
__HAL_DBGMCU_FREEZE_IWDG();
|
||||
|
||||
// Ensure we start with SDC disabled
|
||||
HAL_GPIO_WritePin(Watchdog_GPIO_Port, Watchdog_Pin, GPIO_PIN_RESET);
|
||||
@ -209,7 +217,7 @@ int main(void)
|
||||
canfilterconfig.FilterActivation = CAN_FILTER_ENABLE;
|
||||
canfilterconfig.FilterBank = 0;
|
||||
canfilterconfig.FilterFIFOAssignment = CAN_FILTER_FIFO0;
|
||||
canfilterconfig.FilterIdHigh = 0 << (16 - 11);
|
||||
canfilterconfig.FilterIdHigh = CAN_ID_RX << (16 - 11);
|
||||
canfilterconfig.FilterIdLow = 0;
|
||||
canfilterconfig.FilterMaskIdHigh = 0x7FF << (16 - 11);
|
||||
canfilterconfig.FilterMaskIdLow = 0;
|
||||
@ -244,8 +252,19 @@ int main(void)
|
||||
bool pAMC = false;
|
||||
mission_t new_mission = mission; // By default, don't change mission
|
||||
|
||||
// Important to prevent bus error state while ABX is starting up
|
||||
HAL_Delay(1000);
|
||||
// Wait 1s to prevent bus error state while ABX is starting up
|
||||
// During that time, show loading animation to show LEDs work
|
||||
setMissionLED(M_MANUAL, GPIO_PIN_SET);
|
||||
HAL_Delay(150);
|
||||
setMissionLED(M_MANUAL, GPIO_PIN_RESET);
|
||||
for (mission_t m = M_ACCEL; m != M_MANUAL; m = mission2next[m]) {
|
||||
setMissionLED(m, GPIO_PIN_SET);
|
||||
HAL_Delay(150);
|
||||
setMissionLED(m, GPIO_PIN_RESET);
|
||||
}
|
||||
|
||||
MX_IWDG_Init();
|
||||
WD_initialized = true;
|
||||
|
||||
while (true) {
|
||||
|
||||
@ -485,7 +504,8 @@ void HAL_CAN_RxFifo0MsgPendingCallback(CAN_HandleTypeDef *hcan) {
|
||||
#ifdef WATCHDOG_STM
|
||||
|
||||
if (rxData.signals.heartbeat != pHeartbeat) {
|
||||
HAL_IWDG_Refresh(&hiwdg);
|
||||
if (WD_initialized)
|
||||
HAL_IWDG_Refresh(&hiwdg);
|
||||
WD_OK = true;
|
||||
HAL_GPIO_WritePin(Watchdog_GPIO_Port, Watchdog_Pin, GPIO_PIN_SET);
|
||||
}
|
||||
|
||||
@ -38,7 +38,7 @@
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.stlink_txt_serial_number" value=""/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.watchdog_config" value="none"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlinkenable_rtos" value="false"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlinkrestart_configurations" value="{"fVersion":1,"fItems":[{"fDisplayName":"Reset","fIsSuppressible":false,"fResetAttribute":"Software system reset","fResetStrategies":[{"fDisplayName":"Software system reset","fLaunchAttribute":"system_reset","fGdbCommands":["monitor reset\n"],"fCmdOptions":["-g"]},{"fDisplayName":"Hardware reset","fLaunchAttribute":"hardware_reset","fGdbCommands":["monitor reset hardware\n"],"fCmdOptions":["-g"]},{"fDisplayName":"Core reset","fLaunchAttribute":"core_reset","fGdbCommands":["monitor reset core\n"],"fCmdOptions":["-g"]},{"fDisplayName":"None","fLaunchAttribute":"no_reset","fGdbCommands":[],"fCmdOptions":["-g"]}],"fGdbCommandGroup":{"name":"Additional commands","commands":[]},"fStartApplication":true}]}"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlinkrestart_configurations" value="{"fItems":[{"fDisplayName":"Reset","fIsSuppressible":false,"fResetAttribute":"Software system reset","fResetStrategies":[{"fDisplayName":"Software system reset","fLaunchAttribute":"system_reset","fGdbCommands":["monitor reset\n"],"fCmdOptions":["-g"]},{"fDisplayName":"Hardware reset","fLaunchAttribute":"hardware_reset","fGdbCommands":["monitor reset hardware\n"],"fCmdOptions":["-g"]},{"fDisplayName":"Core reset","fLaunchAttribute":"core_reset","fGdbCommands":["monitor reset core\n"],"fCmdOptions":["-g"]},{"fDisplayName":"None","fLaunchAttribute":"no_reset","fGdbCommands":[],"fCmdOptions":["-g"]}],"fGdbCommandGroup":{"name":"Additional commands","commands":[]}}]}"/>
|
||||
<booleanAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.enableRtosProxy" value="false"/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyCustomProperties" value=""/>
|
||||
<stringAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyDriver" value="threadx"/>
|
||||
|
||||
@ -911,7 +911,7 @@
|
||||
)
|
||||
|
||||
(symbol (lib_id "Device:R") (at 142.24 88.9 180) (unit 1)
|
||||
(in_bom yes) (on_board yes) (dnp no)
|
||||
(in_bom yes) (on_board yes) (dnp yes)
|
||||
(uuid 86666e00-6522-42d9-8c50-ddbe3c590e94)
|
||||
(property "Reference" "R3" (at 140.462 90.0684 0)
|
||||
(effects (font (size 1.27 1.27)) (justify left))
|
||||
@ -989,7 +989,7 @@
|
||||
)
|
||||
|
||||
(symbol (lib_id "Device:C") (at 148.59 93.98 90) (unit 1)
|
||||
(in_bom yes) (on_board yes) (dnp no)
|
||||
(in_bom yes) (on_board yes) (dnp yes)
|
||||
(uuid e0f15250-bd20-4545-ac0d-527fe10e2cdb)
|
||||
(property "Reference" "C17" (at 147.4216 91.059 0)
|
||||
(effects (font (size 1.27 1.27)) (justify left))
|
||||
@ -1042,7 +1042,7 @@
|
||||
)
|
||||
|
||||
(symbol (lib_id "Device:R") (at 142.24 99.06 180) (unit 1)
|
||||
(in_bom yes) (on_board yes) (dnp no)
|
||||
(in_bom yes) (on_board yes) (dnp yes)
|
||||
(uuid fe93d30d-de39-4ca8-8ec8-dbd2cc54f863)
|
||||
(property "Reference" "R7" (at 140.462 100.2284 0)
|
||||
(effects (font (size 1.27 1.27)) (justify left))
|
||||
|
||||
Reference in New Issue
Block a user