Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4adcfbd

Browse filesBrowse files
committed
Review size definition
Fix issue raised in issue comment: #39 (comment) when configMEMMANG_HEAP_NB is equal to 1, 2 or 4 Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent 23ba1f9 commit 4adcfbd
Copy full SHA for 4adcfbd

File tree

Expand file treeCollapse file tree

2 files changed

+18
-7
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+18
-7
lines changed

‎src/FreeRTOSConfig_Default.h

Copy file name to clipboardExpand all lines: src/FreeRTOSConfig_Default.h
+12-7Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,26 +79,31 @@
7979
* which is not suitable for the new CMSIS-RTOS v2 priority range
8080
*/
8181
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
82-
82+
/* Require to be a value as used in cmsis_os2.c as array size */
83+
#ifndef configMINIMAL_STACK_SIZE
8384
#define configMINIMAL_STACK_SIZE ((uint16_t)128)
84-
#define configTOTAL_HEAP_SIZE ((size_t)(15 * 1024))
85-
#define configISR_STACK_SIZE_WORDS (0x100)
85+
#endif
8686
#else
87+
#define configMAX_PRIORITIES (7)
88+
#endif /* configUSE_CMSIS_RTOS_V2 */
89+
8790
extern char _end; /* Defined in the linker script */
8891
extern char _estack; /* Defined in the linker script */
8992
extern char _Min_Stack_Size; /* Defined in the linker script */
90-
91-
#define configMAX_PRIORITIES (7)
92-
9393
/*
9494
* _Min_Stack_Size is often set to 0x400 in the linker script
9595
* Use it divided by 8 to set minmimal stack size of a task to 128 by default.
9696
* End user will have to properly configure those value depending to their needs.
9797
*/
98+
#ifndef configMINIMAL_STACK_SIZE
9899
#define configMINIMAL_STACK_SIZE ((uint16_t)((uint32_t)&_Min_Stack_Size/8))
100+
#endif
101+
#ifndef configTOTAL_HEAP_SIZE
99102
#define configTOTAL_HEAP_SIZE ((size_t)(&_estack - _Min_Stack_Size - &_end))
103+
#endif
104+
#ifndef configISR_STACK_SIZE_WORDS
100105
#define configISR_STACK_SIZE_WORDS ((uint32_t)&_Min_Stack_Size/4)
101-
#endif /* configUSE_CMSIS_RTOS_V2 */
106+
#endif
102107

103108
#define configUSE_PREEMPTION 1
104109
#define configUSE_IDLE_HOOK 1

‎src/heap.c

Copy file name to clipboardExpand all lines: src/heap.c
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
#define configMEMMANG_HEAP_NB -1
1616
#endif
1717

18+
#if configMEMMANG_HEAP_NB != -1
19+
/* Need to be redefined as a value as it used in some heap_*.c as array size */
20+
#undef configTOTAL_HEAP_SIZE
21+
#define configTOTAL_HEAP_SIZE ((size_t)(15 * 1024))
22+
#endif
23+
1824
#if (configMEMMANG_HEAP_NB == -1)
1925
#include "../portable/MemMang/heap_useNewlib_ST.c"
2026
#elif (configMEMMANG_HEAP_NB == 1)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.