Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FreeRTOS + qemu changes #1

Open
wants to merge 116 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
5d11aea
fix FreeRTOS version to 10.4.6
laroche Feb 20, 2023
d5e97cb
setenv.sh: add new PATH to beginning
laroche Feb 20, 2023
d792859
add a new target "make run" and document it
laroche Feb 20, 2023
59e7712
setenv.sh: list more current toolchain
laroche Feb 20, 2023
6b254fa
better init code, add proper includes, disable unused code
laroche Feb 20, 2023
7047140
use gcc -O2, but not for portISR.c and nostdlib.c (-O1)
laroche Feb 20, 2023
9f2060f
fix all compiler warnings, refactor some code
laroche Feb 22, 2023
0b77595
mall cleanups
laroche Feb 22, 2023
71696b3
ws changes
laroche Feb 22, 2023
f7602a0
nostdlib.c: less conversions
laroche Feb 23, 2023
93abf6a
cleanup
laroche Feb 23, 2023
0447fed
cleanup
laroche Feb 23, 2023
275c8a8
nostdlib: use minimal functions
laroche Feb 23, 2023
580ad86
README.md: add links to make/qemu
laroche Feb 25, 2023
96dbbb9
portmacro.h: set portTICK_TYPE_IS_ATOMIC
laroche Feb 25, 2023
3fc9459
fix some comments, cleanup
laroche Feb 25, 2023
c4233f3
README.md improve docu with more links
laroche Feb 26, 2023
8aad379
README.sh improve docu, one more link
laroche Feb 26, 2023
521c34b
optionally allow to link against newlib as a full libc
laroche Feb 26, 2023
92c4e13
Makefile: also write out a linker mapfile
laroche Feb 26, 2023
de33ade
Makefile: also add -DUSE_NEWLIB=0 if newlib is disabled
laroche Feb 26, 2023
694987d
README.md: also mention "killall qemu-system-arm"
laroche Feb 26, 2023
f7ba439
further prepare debugging flags
laroche Feb 26, 2023
62b4fdd
.gitignore: add image.map
laroche Feb 26, 2023
3141eea
fix compilation with optimization for nostdlib.c
laroche Feb 26, 2023
91bedb5
no need to access ulCriticalNesting and pxCurrentTCB
laroche Feb 26, 2023
afe120e
no prototype needed for ulCriticalNesting
laroche Feb 26, 2023
0a4b255
portmacro.h: adapt to newest upstream
laroche Feb 27, 2023
752a2ed
install docu for Debian/Ubuntu
laroche Feb 27, 2023
a0081ba
interrupt.c: improve data layout to reduce data and code size
laroche Feb 27, 2023
45b54a4
remove names for struct data if not used
laroche Feb 27, 2023
5f24147
disable also configUSE_APPLICATION_TASK_TAG to save some space
laroche Feb 28, 2023
fa5c2dc
for newlib use heap_3.c, mv driver headers into one source dir
laroche Feb 28, 2023
7800baa
add CHECK_TIMER to add debug code
laroche Feb 28, 2023
5e67fc2
for newlib we use "-nostartfiles" as we provide our own startup code
laroche Mar 1, 2023
c8c788a
uart.c/interrupt.c: further reduce size by optionally removing sanity…
laroche Mar 1, 2023
42a3bad
qemu.ld: image with heap is now exactly 128M
laroche Mar 6, 2023
412d15e
qemu.ld: reduce number of variables
laroche Mar 7, 2023
e7418c8
startup.s: reduce size of assembler startup code
laroche Mar 7, 2023
3851521
mv some more files into the "drivers" subdir, call "init" from "main(…
laroche Mar 7, 2023
c78094f
qemu.ld: even more compact file
laroche Mar 7, 2023
2d90a83
nostdlib.c: strcpy() is not used at all, disable
laroche Mar 8, 2023
c5534ec
add compiler/linker options to remove dead code
laroche Mar 8, 2023
5d13fcc
add docu on how to look at assembler output and check image size
laroche Mar 8, 2023
551cb19
reduce header coding size
laroche Mar 8, 2023
9e7d67f
add linker debugging info
laroche Mar 8, 2023
36dadee
add comment about "-flto"
laroche Mar 8, 2023
6b3e1c3
docu update
laroche Mar 8, 2023
1071fee
docu: add a TODO section
laroche Mar 8, 2023
d371816
fix compiler warnings, add new todo
laroche Mar 9, 2023
ab3bda3
update to current development version of FreeRTOS
laroche Mar 9, 2023
40f693e
move source code one level up
laroche Mar 9, 2023
77abca9
add todo for portISR.c compilation with -O1
laroche Mar 10, 2023
92b797b
startup.s: clear bss in 4-bytes steps for faster startup
laroche Mar 10, 2023
909a75c
startup.s: more compact coding for bss
laroche Mar 10, 2023
391cccb
portISR.c: fix vTickISR being miscompiled due to assembler usage
laroche Mar 10, 2023
2bbe4d4
add option to built with "gcc -flto", needs attribute(used) fixes
laroche Mar 10, 2023
0009526
add gcc (un)likely builtin as demo code (doesn't actually change arm …
laroche Mar 15, 2023
fd78ee2
add fast/small timer interrupt code as TODO
laroche Mar 15, 2023
0018d0f
disable more unused code
laroche Mar 15, 2023
b178844
fix gcc compiler warning
laroche Mar 15, 2023
2c7dd9f
improve debugging compile
laroche Mar 15, 2023
183fe01
disable qemu audio, it is not used anyway
laroche Mar 16, 2023
42706b1
FreeRTOS-Kernel update to current upstream
laroche Mar 17, 2023
9429a52
Makefile: create dependency files and use them within the Makefile
laroche Mar 17, 2023
b5f7ce1
Makefile: add deps for obj subdir to all targets
laroche Mar 17, 2023
f571eca
Makefile: remove dep on bsp.h now
laroche Mar 17, 2023
206be2e
document RAM layout as a table
laroche Mar 17, 2023
3b6ac2c
Makefile: no rebuilds due to "obj" dir, simplify
laroche Mar 23, 2023
2316ce5
suppress more gcc warnings, change to "int main(void)"
laroche Mar 23, 2023
52af3ba
Makefile: always also create an assembler listing in "image.lst"
laroche Mar 23, 2023
43c96ac
.gitignore: add image.lst
laroche Mar 23, 2023
4be24d9
mark vFreeRTOS_ISR with attribute interrupt("IRQ"), cleanups
laroche Mar 23, 2023
c6069d7
output the size of the final elf image
laroche Mar 24, 2023
acefcc9
Makefile: add qemu target in addition to "run".
laroche Mar 24, 2023
36df38c
move the volatile definition into "type struct"
laroche Mar 24, 2023
be96358
fix inclusion of Makfile dependency files
laroche Mar 24, 2023
f4a54b5
ws cleanup
laroche Mar 24, 2023
2c52f0f
align bss section to 4 bytes, further minimize linker file
laroche Mar 27, 2023
479c9c9
add malloc() locking for newlib and malloc tracing
laroche Mar 27, 2023
6230fde
typo
laroche Mar 28, 2023
06c396f
update to current upstream FreeRTOS
laroche Mar 28, 2023
b8bfe02
recompile if Makefile is changed. Output qemu debugging errors.
laroche Mar 29, 2023
cfbe3a7
use __OPTIMIZE_SIZE__ to conditionally include strcpy()
laroche Mar 31, 2023
3760662
FreeRTOS upstream update
laroche Apr 3, 2023
8ef8097
Makefile: detect non-Windows OS and run parallel make
laroche Apr 3, 2023
5e3665c
TODO: Can we run on Windows?
laroche Apr 3, 2023
ee8c489
qemu.ld: more compact linker file, ws change
laroche Apr 14, 2023
44b21de
ws change consistency
laroche Apr 14, 2023
1ef7c73
FreeRTOS devel update
laroche May 1, 2023
935396d
uart.c: use always_inline
laroche May 7, 2023
72b640d
FreeRTOS upstream update
laroche May 9, 2023
5a4b3ed
update to FreeRTOS upstream
laroche May 26, 2023
88b8e41
update to current FreeRTOS
laroche Jun 2, 2023
56bfa3b
update to current FreeRTOS
laroche Jun 13, 2023
20fbb06
FreeRTOS upstream
laroche Jun 29, 2023
bbe2fb6
optimize for code size, also allows to compile with -Os now
laroche Jun 29, 2023
589f99a
typo in OPTIMIZE_SIZE
laroche Jun 29, 2023
249aeb0
FreeRTOS update
laroche Jul 8, 2023
b924611
FreeRTOS update
laroche Jul 17, 2023
c54f00c
FreeRTOS update
laroche Jul 21, 2023
e4292a9
FreeRTOS upstream
laroche Jul 25, 2023
05a27a6
FreeRTOS update
laroche Jul 26, 2023
795f24a
FreeRTOS update
laroche Jul 28, 2023
d08d246
FreeRTOS update
laroche Jul 31, 2023
15fff71
FreeRTOS update
laroche Aug 3, 2023
4596350
FreeRTOS update
laroche Aug 3, 2023
15d5453
FreeRTOS upstream
laroche Aug 7, 2023
9488580
FreeRTOS update
laroche Aug 8, 2023
3855ab0
FreeRTOS update
laroche Aug 17, 2023
3746147
FreeRTOS update
laroche Aug 23, 2023
1a849f0
FreeRTOS update
laroche Sep 24, 2023
b5fa460
FreeRTOS update
laroche Oct 5, 2023
0e93ff7
FreeRTOS update
laroche Oct 12, 2023
8ccba58
FreeRTOS update
laroche Oct 15, 2023
105a3c4
update FreeRTOS
laroche Oct 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 19 additions & 18 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
# Ignore all intermediate files in obj
obj/

# Object files:
*.o

# Image files:
*.bin
*.img
*.elf

# Backup files of some editors:
*~

# Eclipse files:
.project
.cproject
.settings/
# Ignore all intermediate files in obj
obj/

# Object files:
*.o

# Image files:
image.bin
image.elf
image.map
image.lst

# Backup files of some editors:
*~

# Eclipse files:
.project
.cproject
.settings/
41 changes: 35 additions & 6 deletions Demo/FreeRTOSConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
*
* http://www.FreeRTOS.org
* http://aws.amazon.com/freertos
*
* 1 tab == 4 spaces!
*/

#ifndef FREERTOS_CONFIG_H
Expand Down Expand Up @@ -51,12 +49,45 @@
#define configMINIMAL_STACK_SIZE ( ( StackType_t ) 128 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 20480 ) )
#define configMAX_TASK_NAME_LEN ( 16 )
#define configUSE_TRACE_FACILITY 0
#define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 1
#define configUSE_APPLICATION_TASK_TAG 1

#if USE_NEWLIB == 1
#define configUSE_NEWLIB_REENTRANT 1
#endif

#if USE_LARGE_DEMO == 0
#define configUSE_APPLICATION_TASK_TAG 0
#define configUSE_MUTEXES 0
#else
#define configUSE_APPLICATION_TASK_TAG 1
#define configUSE_MUTEXES 1
#define configUSE_RECURSIVE_MUTEXES 1
#define configUSE_COUNTING_SEMAPHORES 1

#define configUSE_TIMERS 1
#define configTIMER_TASK_PRIORITY 2
#define configTIMER_QUEUE_LENGTH 20
#define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE * 2 )
#endif

#if USE_DEBUG_FLAGS == 1
#define configUSE_MALLOC_FAILED_HOOK 1
#define configCHECK_FOR_STACK_OVERFLOW 2
extern void vAssertCalled( const char *pcFile, uint32_t ulLine );
#define configASSERT( x ) if ( ( x ) == 0 ) vAssertCalled( __FILE__, __LINE__ )
#if 0
#define configUSE_TRACE_FACILITY 1
#define configGENERATE_RUN_TIME_STATS 0
#define configUSE_STATS_FORMATTING_FUNCTIONS 0
#endif
#define traceMALLOC( pvAddress, uiSize ) xtraceMALLOC(pvAddress, uiSize)
#define traceFREE( pvAddress, uiSize ) xtraceFREE(pvAddress, uiSize)
void xtraceMALLOC(void *pvAddress, unsigned int uiSize);
void xtraceFREE(void *pvAddress, unsigned int uiSize);
#else
#define configUSE_MALLOC_FAILED_HOOK 0
#endif

/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0
Expand All @@ -80,12 +111,10 @@ to exclude the API function. */
See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
#define configMAX_SYSCALL_INTERRUPT_PRIORITY 191 /* equivalent to 0xb0, or priority 11. */


/* This is the value being used as per the ST library which permits 16
priority values, 0 to 15. This must correspond to the
configKERNEL_INTERRUPT_PRIORITY setting. Here 15 corresponds to the lowest
NVIC value of 255. */
#define configLIBRARY_KERNEL_INTERRUPT_PRIORITY 15


#endif /* FREERTOS_CONFIG_H */
24 changes: 12 additions & 12 deletions Demo/app_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,44 +38,44 @@
/* Settings for main.c */

/* Uart(s) to print to and/or to receive from */
#define PRINT_UART_NR ( 0 )
#define RECV_UART_NR ( 0 )
#define PRINT_UART_NR ( 0U )
#define RECV_UART_NR ( 0U )

/*
* Priorities of certain tasks.
* Note: priorities should not be greater than configMAX_PRIORITIES - 1,
* defined in FreeRTOSConfig.h (its default value equals 5).
* If any priority is greater than this value, xTasCreate will
* If any priority is greater than this value, xTaskCreate will
* silently reduce it.
*/
#define PRIOR_PERIODIC ( 2 )
#define PRIOR_FIX_FREQ_PERIODIC ( 3 )
#define PRIOR_PRINT_GATEKEEPR ( 1 )
#define PRIOR_RECEIVER ( 1 )
#define PRIOR_PERIODIC ( 2U )
#define PRIOR_FIX_FREQ_PERIODIC ( 3U )
#define PRIOR_PRINT_GATEKEEPR ( 1U )
#define PRIOR_RECEIVER ( 1U )


/* Settings for print.c */

/* Size of the queue with pointers to strings that will be printed */
#define PRINT_QUEUE_SIZE ( 10 )
#define PRINT_QUEUE_SIZE ( 10U )

/* Number of string buffers to print individual characters */
#define PRINT_CHR_BUF_SIZE ( 5 )
#define PRINT_CHR_BUF_SIZE ( 5U )


/* Settings for receive.c */

/* Size of the queue holding received characters, that have not been processed yet. */
#define RECV_QUEUE_SIZE ( 10 )
#define RECV_QUEUE_SIZE ( 10U )

/* Number of string buffers necessary to print received strings */
#define RECV_BUFFER_SIZE ( 3 )
#define RECV_BUFFER_SIZE ( 3U )

/*
* Number of characters in a buffer.
* Note: this limit does not include '\0' and additional extra characters, necessary
* to print the string properly.
*/
#define RECV_BUFFER_LEN ( 50 )
#define RECV_BUFFER_LEN ( 50U )

#endif /* _APP_CONFIG_H_ */
Loading