-
Notifications
You must be signed in to change notification settings - Fork 0
/
notes.txt
130 lines (102 loc) · 4.35 KB
/
notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
main.c
--------------------------------------------------------------------------------
MX_ThreadX_Init(&handles);
hrtc.Init.BinMode = RTC_BINARY_MIX;
Delete RTC alarm config
Delete Timer IRQ callback
--------------------------------------------------------------------------------
app_azure_rtos_config.h
--------------------------------------------------------------------------------
#define TX_APP_MEM_POOL_SIZE 744032
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
tx_user.h
#define TX_ENABLE_STACK_CHECKING
#define TX_MAX_PRIORITIES 32
#define TX_INLINE_THREAD_RESUME_SUSPEND
--------------------------------------------------------------------------------
app_threadx.c
--------------------------------------------------------------------------------
void MX_ThreadX_Init(device_handles_t *handles)
--------------------------------------------------------------------------------
app_threadx.h
--------------------------------------------------------------------------------
void MX_ThreadX_Init(device_handles_t *handles)
--------------------------------------------------------------------------------
tx_user.h
--------------------------------------------------------------------------------
#define TX_TIMER_TICKS_PER_SECOND 10 <or whatever>
--------------------------------------------------------------------------------
app_azure_rtos.c
--------------------------------------------------------------------------------
/* Private variables ---------------------------------------------------------*/
/* USER CODE BEGIN PV */
#define WAVES_MEM_POOL_SIZE 600000
/* USER CODE END PV */
#if (USE_STATIC_ALLOCATION == 1)
/* USER CODE BEGIN TX_Pool_Buffer */
/* USER CODE END TX_Pool_Buffer */
#if defined ( __ICCARM__ )
#pragma data_alignment=4
#endif
__ALIGN_BEGIN static UCHAR tx_byte_pool_buffer[TX_APP_MEM_POOL_SIZE - WAVES_MEM_POOL_SIZE] __ALIGN_END;
__ALIGN_BEGIN static UCHAR waves_byte_pool_buffer[WAVES_MEM_POOL_SIZE] __ALIGN_END;
static TX_BYTE_POOL tx_app_byte_pool;
static TX_BYTE_POOL waves_byte_pool;
#endif
/* Private function prototypes -----------------------------------------------*/
/* USER CODE BEGIN PFP */
extern void shut_it_all_down(void);
/* USER CODE END PFP */
/**
* @brief Define the initial system.
* @param first_unused_memory : Pointer to the first unused memory
* @retval None
*/
VOID tx_application_define(VOID *first_unused_memory)
{
/* USER CODE BEGIN tx_application_define_1*/
/* USER CODE END tx_application_define_1 */
#if (USE_STATIC_ALLOCATION == 1)
UINT status = TX_SUCCESS;
VOID *memory_ptr;
if (tx_byte_pool_create(&tx_app_byte_pool, "Tx App memory pool", tx_byte_pool_buffer,
TX_APP_MEM_POOL_SIZE - WAVES_MEM_POOL_SIZE) != TX_SUCCESS)
{
/* USER CODE BEGIN TX_Byte_Pool_Error */
shut_it_all_down();
HAL_NVIC_SystemReset();
/* USER CODE END TX_Byte_Pool_Error */
}
else if (memory_pool_init(&waves_byte_pool, waves_byte_pool_buffer, WAVES_MEM_POOL_SIZE) != TX_SUCCESS)
{
/* USER CODE BEGIN TX_Byte_Pool_Error */
shut_it_all_down();
HAL_NVIC_SystemReset();
/* USER CODE END TX_Byte_Pool_Error */
}
else
{
/* USER CODE BEGIN TX_Byte_Pool_Success */
/* USER CODE END TX_Byte_Pool_Success */
memory_ptr = (VOID *)&tx_app_byte_pool;
status = App_ThreadX_Init(memory_ptr);
if (status != TX_SUCCESS)
{
/* USER CODE BEGIN App_ThreadX_Init_Error */
// Something went wrong along the way, reset and try again
shut_it_all_down();
HAL_NVIC_SystemReset();
/* USER CODE END App_ThreadX_Init_Error */
}
/* USER CODE BEGIN App_ThreadX_Init_Success */
/* USER CODE END App_ThreadX_Init_Success */
}
#else
--------------------------------------------------------------------------------
!!!!!!!!!!!!!!!!!!!!!!
TODOs:
* Add a thread_control_flags push/get for watchdog and end_of_cycle_thread -- make sure the watchdog can continue to keep track of total elapsed time
* Have some persistent indication of error flags to prevent sending more thn 1 error message per failure
* Check if there is a busy bit for UART which can be used to sync Tx for CT, GNSS
* !!! Must check that config is still good for GNSS if power cycled. VBCKP is ties directly to 3v3 bus and should retain config