Add safety disarm in the stack overflow hook and increase stack sizes

This commit is contained in:
Unknown
2019-12-04 00:09:57 -05:00
parent fa0180a601
commit 2c9f43c9ff
6 changed files with 10 additions and 6 deletions
+2 -2
View File
@@ -89,14 +89,14 @@ osSemaphoreId sem_usb_tx;
osSemaphoreId sem_can;
osThreadId usb_irq_thread;
const uint32_t stack_size_usb_irq_thread = 1024; // Bytes
const uint32_t stack_size_usb_irq_thread = 2048; // Bytes
// Place FreeRTOS heap in core coupled memory for better performance
__attribute__((section(".ccmram")))
uint8_t ucHeap[configTOTAL_HEAP_SIZE];
/* USER CODE END Variables */
osThreadId defaultTaskHandle;
const uint32_t stack_size_default_task = 1024; // Bytes
const uint32_t stack_size_default_task = 2048; // Bytes
/* Private function prototypes -----------------------------------------------*/
/* USER CODE BEGIN FunctionPrototypes */
+1 -1
View File
@@ -244,7 +244,7 @@ class Axis {
Endstop& max_endstop_;
osThreadId thread_id_;
const uint32_t stack_size_ = 1024; // Bytes
const uint32_t stack_size_ = 2048; // Bytes
volatile bool thread_id_valid_ = false;
// variables exposed on protocol
+4
View File
@@ -182,6 +182,10 @@ extern "C" int construct_objects(){
extern "C" {
int odrive_main(void);
void vApplicationStackOverflowHook(xTaskHandle *pxTask, signed portCHAR *pcTaskName) {
for(auto& axis : axes){
safety_critical_disarm_motor_pwm(axis->motor_);
}
safety_critical_disarm_brake_resistor();
for (;;); // TODO: safe action
}
void vApplicationIdleHook(void) {
+1 -1
View File
@@ -64,7 +64,7 @@ const uint8_t fw_version_revision = FW_VERSION_REVISION;
const uint8_t fw_version_unreleased = FW_VERSION_UNRELEASED; // 0 for official releases, 1 otherwise
osThreadId comm_thread;
const uint32_t stack_size_comm_thread = 2048; // Bytes
const uint32_t stack_size_comm_thread = 4096; // Bytes
volatile bool endpoint_list_valid = false;
static uint32_t test_property = 0;
+1 -1
View File
@@ -22,7 +22,7 @@ static uint32_t dma_last_rcv_idx;
// static thread_local uint32_t deadline_ms = 0;
osThreadId uart_thread;
const uint32_t stack_size_uart_thread = 2048; // Bytes
const uint32_t stack_size_uart_thread = 4096; // Bytes
class UART4Sender : public StreamSink {
+1 -1
View File
@@ -14,7 +14,7 @@
#include <odrive_main.h>
osThreadId usb_thread;
const uint32_t stack_size_usb_thread = 2048; // Bytes
const uint32_t stack_size_usb_thread = 4096; // Bytes
USBStats_t usb_stats_ = {0};
class USBSender : public PacketSink {