笔者在移植uCOS Ⅲ到stm32f103c8时碰到如下问题

Error: L6407W: Sections of aggregate size 0x6c48 bytes could not fit into .ANY selector(s).初步推定应该是内核服务没有配置导致,在别人提示下查看了以前stm32f103vet6移植编译成功的ucos Ⅲ工程MAP文件。

如下:

考虑到stm32f103c8不用这么多服务,因此拟对内核服务做出裁剪。

事后验证,事实上不用删除uCOS-III\Source下对应服务的C语言文件,只需找到os_cfg.h文件,对其中不用的服务进行置0操作,MEMORY MANAGEMENT 占用内存较多,而且f103c8不需要内存管理,首先可将其服务置零,然后编译发现已经可以编译通过,代码量差不多是27KB左右,后又对其他不用服务进行了相同操作。最终可将代码量控制在8k左右。

os_cfg.h文件最终配置如下所示

#define OS_CFG_APP_HOOKS_EN             0u   /* Enable (1) or Disable (0) application specific hooks                  */
#define OS_CFG_ARG_CHK_EN               1u   /* Enable (1) or Disable (0) argument checking                           */
#define OS_CFG_CALLED_FROM_ISR_CHK_EN   1u   /* Enable (1) or Disable (0) check for called from ISR                   */
#define OS_CFG_DBG_EN                   1u   /* Enable (1) debug code/variables                                       */
#define OS_CFG_ISR_POST_DEFERRED_EN     1u   /* Enable (1) or Disable (0) Deferred ISR posts                          */
#define OS_CFG_OBJ_TYPE_CHK_EN          1u   /* Enable (1) or Disable (0) object type checking                        */
#define OS_CFG_TS_EN                    0u   /* Enable (1) or Disable (0) time stamping                               */

#define OS_CFG_PEND_MULTI_EN            1u   /* Enable (1) or Disable (0) code generation for multi-pend feature      */

#define OS_CFG_PRIO_MAX                32u   /* Defines the maximum number of task priorities (see OS_PRIO data type) */

#define OS_CFG_SCHED_LOCK_TIME_MEAS_EN  0u   /* Include code to measure scheduler lock time                           */
#define OS_CFG_SCHED_ROUND_ROBIN_EN     0u   /* Include code for Round-Robin scheduling                               */
#define OS_CFG_STK_SIZE_MIN            64u   /* Minimum allowable task stack size                                     */

/* ----------------------------- EVENT FLAGS --------------------------- */
#define OS_CFG_FLAG_EN                  0u   /* Enable (1) or Disable (0) code generation for EVENT FLAGS             */
#define OS_CFG_FLAG_DEL_EN              0u   /*     Include code for OSFlagDel()                                      */
#define OS_CFG_FLAG_MODE_CLR_EN         0u   /*     Include code for Wait on Clear EVENT FLAGS                        */
#define OS_CFG_FLAG_PEND_ABORT_EN       0u   /*     Include code for OSFlagPendAbort()                                */

/* -------------------------- MEMORY MANAGEMENT ------------------------ */
#define OS_CFG_MEM_EN                   0u   /* Enable (1) or Disable (0) code generation for MEMORY MANAGER          */

/* --------------------- MUTUAL EXCLUSION SEMAPHORES ------------------- */
#define OS_CFG_MUTEX_EN                 0u   /* Enable (1) or Disable (0) code generation for MUTEX                   */
#define OS_CFG_MUTEX_DEL_EN             0u   /*     Include code for OSMutexDel()                                     */
#define OS_CFG_MUTEX_PEND_ABORT_EN      0u   /*     Include code for OSMutexPendAbort()                               */

/* --------------------------- MESSAGE QUEUES -------------------------- */
#define OS_CFG_Q_EN                     0u   /* Enable (1) or Disable (0) code generation for QUEUES                  */
#define OS_CFG_Q_DEL_EN                 0u   /*     Include code for OSQDel()                                         */
#define OS_CFG_Q_FLUSH_EN               0u   /*     Include code for OSQFlush()                                       */
#define OS_CFG_Q_PEND_ABORT_EN          0u   /*     Include code for OSQPendAbort()                                   */

/* ----------------------------- SEMAPHORES ---------------------------- */
#define OS_CFG_SEM_EN                   1u   /* Enable (1) or Disable (0) code generation for SEMAPHORES              */
#define OS_CFG_SEM_DEL_EN               1u   /*    Include code for OSSemDel()                                        */
#define OS_CFG_SEM_PEND_ABORT_EN        1u   /*    Include code for OSSemPendAbort()                                  */
#define OS_CFG_SEM_SET_EN               1u   /*    Include code for OSSemSet()                                        */

/* -------------------------- TASK MANAGEMENT -------------------------- */
#define OS_CFG_STAT_TASK_EN             0u   /* Enable (1) or Disable(0) the statistics task                          */
#define OS_CFG_STAT_TASK_STK_CHK_EN     0u   /* Check task stacks from statistic task                                 */

#define OS_CFG_TASK_CHANGE_PRIO_EN      0u   /* Include code for OSTaskChangePrio()                                   */
#define OS_CFG_TASK_DEL_EN              0u   /* Include code for OSTaskDel()                                          */
#define OS_CFG_TASK_Q_EN                0u   /* Include code for OSTaskQXXXX()                                        */
#define OS_CFG_TASK_Q_PEND_ABORT_EN     0u   /* Include code for OSTaskQPendAbort()                                   */
#define OS_CFG_TASK_PROFILE_EN          1u   /* Include variables in OS_TCB for profiling                             */
#define OS_CFG_TASK_REG_TBL_SIZE        1u   /* Number of task specific registers                                     */
#define OS_CFG_TASK_SEM_PEND_ABORT_EN   0u   /* Include code for OSTaskSemPendAbort()                                 */
#define OS_CFG_TASK_SUSPEND_EN          1u   /* Include code for OSTaskSuspend() and OSTaskResume()                   */

/* -------------------------- TIME MANAGEMENT -------------------------- */
#define OS_CFG_TIME_DLY_HMSM_EN         1u   /*     Include code for OSTimeDlyHMSM()                                  */
#define OS_CFG_TIME_DLY_RESUME_EN       1u   /*     Include code for OSTimeDlyResume()                                */

/* ------------------------- TIMER MANAGEMENT -------------------------- */
#define OS_CFG_TMR_EN                   0u   /* Enable (1) or Disable (0) code generation for TIMERS                  */
#define OS_CFG_TMR_DEL_EN               0u   /* Enable (1) or Disable (0) code generation for OSTmrDel()              */

代码编译后规模如下

转载于:https://www.cnblogs.com/siahekai/p/11000826.html

stm32f103c8t6移植uCOS Ⅲ出现Error: L6407W,解决方法:内核配置以减小代码规模相关推荐

  1. Win10 Microsoft Store 微软商店 Error 0x00000193 解决方法

    Win10 Microsoft Store 微软商店 Error 0x00000193 解决方法 参考文章: (1)Win10 Microsoft Store 微软商店 Error 0x0000019 ...

  2. mono-3.4.0 源码安装时出现的问题 [do-install] Error 2 [install-pcl-targets] Error 1 解决方法

    mono-3.4.0 源码安装时出现的问题 [do-install] Error 2 [install-pcl-targets] Error 1 解决方法 参考文章: (1)mono-3.4.0 源码 ...

  3. Win2008上.NET4.0部署出错HTTP 错误 500.21 - Internal Server Error的解决方法

    Win2008上.NET4.0部署出错HTTP 错误 500.21 - Internal Server Error的解决方法 参考文章: (1)Win2008上.NET4.0部署出错HTTP 错误 5 ...

  4. HTTP 错误 500.19- Internal Server Error 错误解决方法

    HTTP 错误 500.19- Internal Server Error 错误解决方法 参考文章: (1)HTTP 错误 500.19- Internal Server Error 错误解决方法 ( ...

  5. Conversion to Dalvik format failed with error 1解决方法:

    Conversion to Dalvik format failed with error 1解决方法: 第一种情况包导入错误.点击工程-->build path-->libraries- ...

  6. linux网卡有很多error,教你设置win7系统虚拟机安装linux提示network error的解决方法...

    很多朋友在使用电脑的过程中,会发现win7系统虚拟机安装linux提示network error的现象,当遇到win7系统虚拟机安装linux提示network error的问题,我们要怎么解决呢?如 ...

  7. mac显示无法连接adobe服务器,Mac安装Adobe软件,如遇Error提示解决方法

    Mac10.15.3 安装Adobe Photoshop 2020的时候一直提示Error错误 The installation cannot continue as the installer fi ...

  8. 【Ansible】Ansible控制windows插件安装及运行error与解决方法

    一. 问:因pip版本问题无法安装kerberos 答:安装提示需要先安装pip升级包 下载pip9.0.1升级包: ![1_2] 二.问:安装kerberos报错 答:需要先安装libkrb5开发包 ...

  9. 安装DotNetCore.1.0.0-VS2015Tools.Preview2.exe 错误Error 0x81f40001 解决方法

    安装DotNetCore.1.0.0-VS2015Tools.Preview2.exe 错误Error 0x81f40001 解决方法 参考文章: (1)安装DotNetCore.1.0.0-VS20 ...

最新文章

  1. 60分钟入门深度学习工具PyTorch
  2. vue2.0 prop的使用
  3. 操作系统之计算机系统概述:6、系统调用
  4. 库克:iPhone 11在中国定价策略很成功 非常受欢迎
  5. mysql求和 子查询_MYSQL 查询方法 统计查询 链接查询 子查询
  6. 如何写好 Java 业务代码?这也是有很多规范的!
  7. python tkinter界面随分辨率自动调整尺寸_如何使pythonttkinter文本在按钮和标签中自动调整大小?...
  8. 新手卖家注意,提高转化率是关键
  9. Glide v4详解
  10. SpringBoot下实现华为云短信验证功能(含代码)
  11. 批量修复自定义标题带来的word题注错误:错误,文档中没有指定样式的文字
  12. linux netstat未找到命令,运行netstat,提示未找到这个命令
  13. CASS11.0新功能介绍(支持AutoCAD2020平台,用户可以体验高雅黑带来的极致眼颜)
  14. Android 集成华为推送,集成小米推送,集成OPPO推送,集成vivo推送
  15. nltk之查找同义词、反义词、指代关系
  16. PR模板 室内装修细节标注介绍线条呼出PR模板
  17. 精彩乱弹,这才是正确的打开方式
  18. 用Tripwire实现系统完整性检查
  19. 【stm32】摇杆模块利用stm32获取摇杆值
  20. pccad2007这台计算机没有正确安装,为什么我的电脑安装不进PCCAD2007

热门文章

  1. Cordova环境搭建
  2. 参数匹配顺序——Python学习之参数(三)
  3. laydate.render报错:日期格式不合法
  4. layui搭配Distpicker实现省市县多级联动
  5. 操作系统(十九)进程互斥的软件实现方法
  6. volatile关键字到底做了什么?
  7. 关于android设备管理器的一些分析
  8. python重复字符串n次_python装饰器听了N次也没印象,读完这篇你就懂了
  9. JZOJ 5441. 【NOIP2017提高A组冲刺11.1】序列
  10. C语言中最常用标准库