全部学习汇总: GreyZhang/g_FreeRTOS: learning notes about FreeRTOS. (github.com)
计划学习一下FreeRTOS,而且想从QEMU的版本开始。因为这样可以了解一个新的技术——QEMU的使用。或许,对于很多人来说这个工具太过寻常。但是,我自己的工作经历中大部分还是直接买开发板,类似的“时髦”技术接触的的确是不多。
前面编号1245的笔记“1245_FreeRTOS的源代码组织形式”中大概了解了一下FreeRTOS下载下来的发布包中工程文件的组织形式。具体涉及到的内容有一个FreeRTOS官方的网页: FreeRTOS - Free RTOS Source Code Directory Structure
根据这样的介绍,我自己整理出来了一个独立的QEMU工程。工程之中尽量保留了所需要的文件,删除了不相关的文件。因为在整理的时候发现,其实除了上面的网页中提到的部分之外可能还有一些其他的目录或者文件会与工程相关。我仅仅是整理完了保证默认的一个例子能够编译通过可运行。
为什么要整理出来一个这样的工程呢?因为直接下载解压的代码包中的例程工程其实是很多的,如果想要做学习,学习的过程中就免不了会有代码修改的尝试。而独立的工程在修改的时候会更容易锁定修改的对象。
梳理出来的工程是否正确,验证的一个简单方式就是直接编译运行。之前,相关的验证例子以及环境搭建的知识也梳理过了。以下是之前的相关笔记:
(28条消息) 1172_FreeRTOS QEMU项目信息梳理_grey_csdn的博客-CSDN博客
(28条消息) 1173_FreeRTOS_QEMU+gcc例程环境搭建_grey_csdn的博客-CSDN博客
整理出来的完整的目录树信息,我会在笔记的最后附加上。
这一次,整理完之后的测试效果如下:
以上是编译的效果,编译以及链接都没有问题。生成的文件并不是.elf文件,而是.out文件。
以上是运行的效果。
运行的方式跟前文中引用的笔记采用的方式是相同的,但是考虑到后续可能会有很多次这样的动作重复,我直接把执行命令写入到了一个批处理中,运行会更加便捷。
接下来,附加一下这次我自己梳理出来的整个工程的全部的目录信息。
.
├── ./Demo
│ ├── ./Demo/CORTEX_MPS2_QEMU_IAR_GCC
│ │ ├── ./Demo/CORTEX_MPS2_QEMU_IAR_GCC/CMSIS
│ │ │ ├── ./Demo/CORTEX_MPS2_QEMU_IAR_GCC/CMSIS/CMSDK_CM3.h
│ │ │ ├── ./Demo/CORTEX_MPS2_QEMU_IAR_GCC/CMSIS/SMM_MPS2.h
│ │ │ ├── ./Demo/CORTEX_MPS2_QEMU_IAR_GCC/CMSIS/cmsis.h
│ │ │ ├── ./Demo/CORTEX_MPS2_QEMU_IAR_GCC/CMSIS/cmsis_compiler.h
│ │ │ ├── ./Demo/CORTEX_MPS2_QEMU_IAR_GCC/CMSIS/cmsis_gcc.h
│ │ │ ├── ./Demo/CORTEX_MPS2_QEMU_IAR_GCC/CMSIS/cmsis_iccarm.h
│ │ │ ├── ./Demo/CORTEX_MPS2_QEMU_IAR_GCC/CMSIS/cmsis_version.h
│ │ │ ├── ./Demo/CORTEX_MPS2_QEMU_IAR_GCC/CMSIS/core_cm3.h
│ │ │ └── ./Demo/CORTEX_MPS2_QEMU_IAR_GCC/CMSIS/mpu_armv7.h
│ │ ├── ./Demo/CORTEX_MPS2_QEMU_IAR_GCC/FreeRTOSConfig.h
│ │ ├── ./Demo/CORTEX_MPS2_QEMU_IAR_GCC/Instructions.url
│ │ ├── ./Demo/CORTEX_MPS2_QEMU_IAR_GCC/IntQueueTimer.c
│ │ ├── ./Demo/CORTEX_MPS2_QEMU_IAR_GCC/IntQueueTimer.h
│ │ ├── ./Demo/CORTEX_MPS2_QEMU_IAR_GCC/build
│ │ │ └── ./Demo/CORTEX_MPS2_QEMU_IAR_GCC/build/gcc
│ │ │ ├── ./Demo/CORTEX_MPS2_QEMU_IAR_GCC/build/gcc/FreeRTOSDemo Default.launch
│ │ │ ├── ./Demo/CORTEX_MPS2_QEMU_IAR_GCC/build/gcc/Makefile
│ │ │ ├── ./Demo/CORTEX_MPS2_QEMU_IAR_GCC/build/gcc/mps2_m3.ld
│ │ │ ├── ./Demo/CORTEX_MPS2_QEMU_IAR_GCC/build/gcc/output
│ │ │ │ ├── ./Demo/CORTEX_MPS2_QEMU_IAR_GCC/build/gcc/output/RTOSDemo.map
│ │ │ │ └── ./Demo/CORTEX_MPS2_QEMU_IAR_GCC/build/gcc/output/placeholder.txt
│ │ │ ├── ./Demo/CORTEX_MPS2_QEMU_IAR_GCC/build/gcc/printf-stdarg.c
│ │ │ ├── ./Demo/CORTEX_MPS2_QEMU_IAR_GCC/build/gcc/run.bat
│ │ │ └── ./Demo/CORTEX_MPS2_QEMU_IAR_GCC/build/gcc/startup_gcc.c
│ │ ├── ./Demo/CORTEX_MPS2_QEMU_IAR_GCC/main.c
│ │ ├── ./Demo/CORTEX_MPS2_QEMU_IAR_GCC/main_blinky.c
│ │ └── ./Demo/CORTEX_MPS2_QEMU_IAR_GCC/main_full.c
│ └── ./Demo/Common
│ ├── ./Demo/Common/Full
│ │ ├── ./Demo/Common/Full/BlockQ.c
│ │ ├── ./Demo/Common/Full/PollQ.c
│ │ ├── ./Demo/Common/Full/comtest.c
│ │ ├── ./Demo/Common/Full/death.c
│ │ ├── ./Demo/Common/Full/dynamic.c
│ │ ├── ./Demo/Common/Full/events.c
│ │ ├── ./Demo/Common/Full/flash.c
│ │ ├── ./Demo/Common/Full/flop.c
│ │ ├── ./Demo/Common/Full/integer.c
│ │ ├── ./Demo/Common/Full/print.c
│ │ └── ./Demo/Common/Full/semtest.c
│ ├── ./Demo/Common/Minimal
│ │ ├── ./Demo/Common/Minimal/AbortDelay.c
│ │ ├── ./Demo/Common/Minimal/BlockQ.c
│ │ ├── ./Demo/Common/Minimal/EventGroupsDemo.c
│ │ ├── ./Demo/Common/Minimal/GenQTest.c
│ │ ├── ./Demo/Common/Minimal/IntQueue.c
│ │ ├── ./Demo/Common/Minimal/IntSemTest.c
│ │ ├── ./Demo/Common/Minimal/MessageBufferAMP.c
│ │ ├── ./Demo/Common/Minimal/MessageBufferDemo.c
│ │ ├── ./Demo/Common/Minimal/PollQ.c
│ │ ├── ./Demo/Common/Minimal/QPeek.c
│ │ ├── ./Demo/Common/Minimal/QueueOverwrite.c
│ │ ├── ./Demo/Common/Minimal/QueueSet.c
│ │ ├── ./Demo/Common/Minimal/QueueSetPolling.c
│ │ ├── ./Demo/Common/Minimal/StaticAllocation.c
│ │ ├── ./Demo/Common/Minimal/StreamBufferDemo.c
│ │ ├── ./Demo/Common/Minimal/StreamBufferInterrupt.c
│ │ ├── ./Demo/Common/Minimal/TaskNotify.c
│ │ ├── ./Demo/Common/Minimal/TaskNotifyArray.c
│ │ ├── ./Demo/Common/Minimal/TimerDemo.c
│ │ ├── ./Demo/Common/Minimal/blocktim.c
│ │ ├── ./Demo/Common/Minimal/comtest.c
│ │ ├── ./Demo/Common/Minimal/comtest_strings.c
│ │ ├── ./Demo/Common/Minimal/countsem.c
│ │ ├── ./Demo/Common/Minimal/crflash.c
│ │ ├── ./Demo/Common/Minimal/crhook.c
│ │ ├── ./Demo/Common/Minimal/death.c
│ │ ├── ./Demo/Common/Minimal/dynamic.c
│ │ ├── ./Demo/Common/Minimal/flash.c
│ │ ├── ./Demo/Common/Minimal/flash_timer.c
│ │ ├── ./Demo/Common/Minimal/flop.c
│ │ ├── ./Demo/Common/Minimal/integer.c
│ │ ├── ./Demo/Common/Minimal/readme.txt
│ │ ├── ./Demo/Common/Minimal/recmutex.c
│ │ ├── ./Demo/Common/Minimal/semtest.c
│ │ └── ./Demo/Common/Minimal/sp_flop.c
│ ├── ./Demo/Common/ReadMe.txt
│ └── ./Demo/Common/include
│ ├── ./Demo/Common/include/AbortDelay.h
│ ├── ./Demo/Common/include/BlockQ.h
│ ├── ./Demo/Common/include/EventGroupsDemo.h
│ ├── ./Demo/Common/include/GenQTest.h
│ ├── ./Demo/Common/include/IntQueue.h
│ ├── ./Demo/Common/include/IntSemTest.h
│ ├── ./Demo/Common/include/MessageBufferAMP.h
│ ├── ./Demo/Common/include/MessageBufferDemo.h
│ ├── ./Demo/Common/include/PollQ.h
│ ├── ./Demo/Common/include/QPeek.h
│ ├── ./Demo/Common/include/QueueOverwrite.h
│ ├── ./Demo/Common/include/QueueSet.h
│ ├── ./Demo/Common/include/QueueSetPolling.h
│ ├── ./Demo/Common/include/StaticAllocation.h
│ ├── ./Demo/Common/include/StreamBufferDemo.h
│ ├── ./Demo/Common/include/StreamBufferInterrupt.h
│ ├── ./Demo/Common/include/TaskNotify.h
│ ├── ./Demo/Common/include/TaskNotifyArray.h
│ ├── ./Demo/Common/include/TimerDemo.h
│ ├── ./Demo/Common/include/blocktim.h
│ ├── ./Demo/Common/include/comtest.h
│ ├── ./Demo/Common/include/comtest2.h
│ ├── ./Demo/Common/include/comtest_strings.h
│ ├── ./Demo/Common/include/countsem.h
│ ├── ./Demo/Common/include/crflash.h
│ ├── ./Demo/Common/include/crhook.h
│ ├── ./Demo/Common/include/death.h
│ ├── ./Demo/Common/include/dynamic.h
│ ├── ./Demo/Common/include/fileIO.h
│ ├── ./Demo/Common/include/flash.h
│ ├── ./Demo/Common/include/flash_timer.h
│ ├── ./Demo/Common/include/flop.h
│ ├── ./Demo/Common/include/integer.h
│ ├── ./Demo/Common/include/mevents.h
│ ├── ./Demo/Common/include/partest.h
│ ├── ./Demo/Common/include/print.h
│ ├── ./Demo/Common/include/recmutex.h
│ ├── ./Demo/Common/include/semtest.h
│ └── ./Demo/Common/include/serial.h
├── ./Source
│ ├── ./Source/croutine.c
│ ├── ./Source/event_groups.c
│ ├── ./Source/include
│ │ ├── ./Source/include/FreeRTOS.h
│ │ ├── ./Source/include/StackMacros.h
│ │ ├── ./Source/include/atomic.h
│ │ ├── ./Source/include/croutine.h
│ │ ├── ./Source/include/deprecated_definitions.h
│ │ ├── ./Source/include/event_groups.h
│ │ ├── ./Source/include/list.h
│ │ ├── ./Source/include/message_buffer.h
│ │ ├── ./Source/include/mpu_prototypes.h
│ │ ├── ./Source/include/mpu_wrappers.h
│ │ ├── ./Source/include/portable.h
│ │ ├── ./Source/include/projdefs.h
│ │ ├── ./Source/include/queue.h
│ │ ├── ./Source/include/semphr.h
│ │ ├── ./Source/include/stack_macros.h
│ │ ├── ./Source/include/stdint.readme
│ │ ├── ./Source/include/stream_buffer.h
│ │ ├── ./Source/include/task.h
│ │ └── ./Source/include/timers.h
│ ├── ./Source/list.c
│ ├── ./Source/portable
│ │ ├── ./Source/portable/GCC
│ │ │ └── ./Source/portable/GCC/ARM_CM3
│ │ │ ├── ./Source/portable/GCC/ARM_CM3/port.c
│ │ │ └── ./Source/portable/GCC/ARM_CM3/portmacro.h
│ │ ├── ./Source/portable/MemMang
│ │ │ ├── ./Source/portable/MemMang/ReadMe.url
│ │ │ ├── ./Source/portable/MemMang/heap_1.c
│ │ │ ├── ./Source/portable/MemMang/heap_2.c
│ │ │ ├── ./Source/portable/MemMang/heap_3.c
│ │ │ ├── ./Source/portable/MemMang/heap_4.c
│ │ │ └── ./Source/portable/MemMang/heap_5.c
│ │ └── ./Source/portable/readme.txt
│ ├── ./Source/queue.c
│ ├── ./Source/stream_buffer.c
│ ├── ./Source/tasks.c
│ └── ./Source/timers.c