【20210427】CRX
梳理main程序,去除程序中的goto语句
【20210331】
04_GEC
void ** component_fun;声明移到gec.c
gec.h修改为extern void ** component_fun;
增加NumToStr构件
原OsFunc.h文件删除,05文件夹增加Os_Self_API.h和Os_United_API.h文件
去除多余的警告
删除gec.h中多余的包含关系
注意02文件夹已经清理,直接复制这边02_CPU替换
【20200225】V6.1 jjl
03_GEC
gec.c:增加flash_init初始化步骤,增强flash写入稳定性。
【20210216】
(1)02_CPU文件夹除cpu.h之外,其他文件BIOS工程与User工程相同,故参照BIOS修改
移除了mpu_armv7.h、cmsis.h、cmsis_nvic.h文件
(2)user.h文件中对使用的各构件进行包含,故移除gec.h中多余的包含关系
#include "printf.h"
#include "flash.h"
#include "emuart.h"
【20210203】V6.0
一、操作系统启动说明:
① 修改前
(1)首先要在gec.c文件中通过Vectors_Init函数继承BIOS中PendSV_Handler与SysTick_Handler
中断向量,使得在User这边能正常使用操作系统进行调度
(2)在Vectors_Init函数中给component_fun赋值,指向BIOS的接口函数列表,以便User能
调用BIOS中存在的接口函数
(3)在06文件夹下OsFunc.h文件中对BIOS中操作系统接口函数进行重映射
(4)main中调用OsFunc.h文件中的OS_start函数启动操作系统
② 修改后
启动过程不变,只是添加了RTThread_Start宏条件编译,方便切换程序是否带操作系统内核源码,修改说明见下面二。
对于RTThread_Start宏条件,若User程序中无RT-Thread内核源码,从BIOS中启动RT-Thread需要继承
BIOS中PendSV_Handler与SysTick_Handler中断向量函数,RT-Thread才能正常运行;
若User程序中有RT-Thread内核源码,此时再继承BIOS中对应中断向量,会替换掉本该需要的User自身的PendSV_Handler
与SysTick_Handler中断向量函数,使得程序无法正常运转。
因此需要作出区分,故在OsFunc.h文件中添加RTThread_Start宏条件:
0=从BIOS启动RT-Thread,User程序中无RT-Thread内核源码;
非0=从User启动RT-Thread,User程序中包含RT-Thread内核源码。
二、程序修改说明:
① 不包含RT-Thread内核源码程序修改说明
(1)更新OsFunc.h文件中所有RT-Thread函数接口为系统原函数接口
(2)OsFunc.h文件中添加操作系统所有结构类型定义,添加RTThread_Start宏条件定义
(3)gec文件添加RTThread_Start宏条件编译,方便切换选择从BIOS启动还是从User启动RT-Thread
#if (RTThread_Start==0)
user[BIOS_SVC_IRQn]=(uint32_t)bios[BIOS_SVC_IRQn];
user[BIOS_PendSV_Handler]=(uint32_t)bios[BIOS_PendSV_Handler];
user[BIOS_SysTick_Handler]=(uint32_t)bios[BIOS_SysTick_Handler];
#endif
(4)切换需要从包含RT-Thread内核源码的User程序中复制06文件下RT-Thread_Src文件进行替换:
从BIOS启动RT-Thread:只需OsFunc.h
从User启动RT-Thread:只需RT-Thread_Src文件
② 包含RT-Thread内核源码程序修改说明
(1)增加RTOS启动入口文件OsFunc.c与OsFunc.h
(2)07文件夹中main函数修改为:
OS_start(app_init); //启动RTOS并执行主线程app_init
(3)07文件夹中includes.h文件注释#include "rtthread.h",添加#include "OsFunc.h"
(4)03_MCU文件夹中启动文件“../xxx.s”修改“bl entry”为“bl main”
(5)..src/components.c文件中
注释原有rtthread_startup函数、rt_application_init函数、entry函数
(6)OsFunc.c与OsFunc.h文件、02_CPU文件夹下context_gcc.S、与原有RT-Thread源代码08_RT-Thread文件夹全部
移到06_SoftComponent文件夹RT-Thread_Src下
(7)修改gec.c,添加
#if (RTThread_Start==0)
user[BIOS_SVC_IRQn]=(uint32_t)bios[BIOS_SVC_IRQn];
user[BIOS_PendSV_Handler]=(uint32_t)bios[BIOS_PendSV_Handler];
user[BIOS_SysTick_Handler]=(uint32_t)bios[BIOS_SysTick_Handler];
#endif
gec.h文件中添加
#define BIOS_SVC_IRQn (11)
#define BIOS_PendSV_Handler (14)
#define BIOS_SysTick_Handler (15)
(9)09文件夹内容移到07文件夹,修改07文件夹为07_AppPrg
三、把User程序改为直接从零启动程序
(1)从包含RT-Thread内核源码的User程序中复制06文件下RT-Thread_Src文件替换掉OsFunc.h文件
(2)03_MCU文件夹中的.ld中,
GEC_USER_SECTOR_START =0; /*USER程序开始扇区号*/
(3)04_GEC文件夹中gec.h文件
#define GEC_USER_SECTOR_START (0)
(4)若使用到printf函数,则添加对printf需要的串口的初始化
uart_init(UART_Debug,115200);
这样的程序,删除Debug,重新编译后,使用SWD写入器下载,直接运行,不需要BIOS
---【程序说明】---
(1)程序摘要:基于BIOS的STM32L431工程
(2)运行芯片:本工程基于BIOS运行,不从0启动
(3)软件环境:AHL-GEC-IDE,兼容STM32cubeIDE
(4)硬件环境:AHL-STM32L431,实质是只要是STM32L431即可,
接AHL-GEC扩展板,有三色灯指示
(5)硬件连接:见"..\05_UserBoard\user"文件
(6)功能简述:
① 红灯每5秒闪烁一次,绿灯每10秒闪烁一次,蓝灯每20秒闪烁一次
② 连接Debug串口,可以查看红绿蓝三色灯亮暗提示
备份原函数接口
//(2)RT-Thread相关函数声明===================================================
//#define OS_start ((void (*)(void (*func)(void)))(component_fun[34]))
//#define thread_create ((uint8_t (*)(const char *name,void (*entry)(void *parameter),\
// void *parameter,uint32_t stack_size,uint8_t priority,\
// uint32_t tick))(component_fun[35]))
//#define thread_start ((void (*)(uint8_t threadIndex))(component_fun[36]))
//#define thread_wait ((void (*)(uint32_t millisec))(component_fun[37]))
//#define heap_init ((void (*)(uint32_t userHeapBase))(component_fun[33]))
//#define get_thread_self ((uint32_t (*)(void))(component_fun[38]))
////事件
//#define event_create ((uint8_t (*)(const char *name, uint8_t flag))(component_fun[41]))
//#define event_recv ((void (*)(uint8_t EventIndex, uint32_t set, uint8_t option,\
// uint32_t timeout,uint32_t *recved))(component_fun[42]))
//#define event_send ((void (*)(uint8_t EventIndex,uint32_t set))(component_fun[43]))
////信号量
//#define rt_sem_create ((uint8_t (*)(const char *name, uint32_t value, uint8_t flag))(component_fun[46]))
//#define rt_sem_take ((void (*)(uint8_t SpIndex, uint32_t time))(component_fun[47]))
//#define rt_sem_release ((void (*)(uint8_t SpIndex))(component_fun[48]))
//#define sem_getNum ((uint8_t (*)(uint8_t SpIndex))(component_fun[49]))
////互斥量
//#define rt_mutex_create ((uint8_t (*)(const char *name,uint8_t flag))(component_fun[52]))
//#define rt_mutex_take ((void (*)(uint8_t MutexIndex, uint32_t time))(component_fun[53]))
//#define rt_mutex_release ((void (*)(uint8_t MutexIndex))(component_fun[54]))
////消息队列
//#define rt_mq_create ((uint8_t (*)(const char *name,uint32_t msg_size,\
// uint32_t max_msgs,uint8_t flag))(component_fun[57]))
//#define rt_mq_send ((uint32_t (*)(uint8_t MqIndex, void *buffer, uint32_t size))(component_fun[58]))
//#define rt_mq_recv ((uint8_t (*)(uint8_t MqIndex, void *buffer,\
// uint32_t size,uint32_t timeout))(component_fun[59]))
//#define rt_malloc ((char* (*)(uint32_t size))(component_fun[60]))
//#define rt_sprintf ((void (*)(char *buf, const char *format, ...))(component_fun[61]))
//#define mq_getIndex ((uint8_t (*)(uint8_t MqIndex))(component_fun[62]))
////系统时间函数
//#define rt_tick_get ((uint32_t (*)(void))(component_fun[63]))
【20201115】V3.8 lq
1.flash构件更新。
【20201027】V3.7 lq cc
1.flash构件更新。
2.构件函数列表宏定义相应BIOS做更新。
3.版本号MCU型号更新。
---【程序说明】---
(1)程序摘要:基于BIOS的STM32L431工程
(2)运行芯片:本工程基于BIOS运行,不从0启动
(3)软件环境:AHL-GEC-IDE,兼容STM32cubeIDE
(4)硬件环境:AHL-STM32L431,实质是只要是STM32L431即可,
接AHL-GEC扩展板,有三色灯指示
(5)硬件连接:见"..\05_UserBoard\user"文件
(6)功能简述:
① 红灯每5秒闪烁一次,绿灯每10秒闪烁一次,蓝灯每20秒闪烁一次
② 连接Debug串口,可以查看红绿蓝三色灯亮暗提示
【20200915】叶柯阳改
本工程与未驻留的User工程相比
1.做了以下修改
(1)STM32L431RCTX_FLASH.ld文件
更改USER程序开始扇区号为“GEC_USER_SECTOR_START =31;”
(2)startup_stm32l431rctx.s文件
更改语句“bl entry”为“bl main”
(2)gec.
没有合适的资源?快使用搜索试试~ 我知道了~
stm32嵌入式实验考核20
共106个文件
c:30个
h:26个
o:17个
需积分: 0 0 下载量 80 浏览量
2024-01-25
13:53:17
上传
评论
收藏 1.04MB 7Z 举报
温馨提示
利用 STM32 小板实现和 LCD 屏幕实现:LCD 屏幕显示一个圆 形。
资源推荐
资源详情
资源评论
收起资源包目录
stm32嵌入式实验考核20 (106个子文件)
printf.c 16KB
printf.c 16KB
lcd.c 15KB
lcd.c 15KB
gpio.c 15KB
gpio.c 15KB
system_stm32l4xx.c 14KB
system_stm32l4xx.c 14KB
uart.c 14KB
uart.c 14KB
flash.c 13KB
flash.c 13KB
emuart.c 11KB
emuart.c 11KB
spi.c 9KB
spi.c 9KB
timer.c 6KB
timer.c 6KB
gec.c 5KB
gec.c 5KB
adc.c 5KB
adc.c 5KB
isr.c 4KB
isr.c 4KB
main.c 3KB
main.c 3KB
NumToStr.c 2KB
NumToStr.c 2KB
wdog.c 1KB
wdog.c 1KB
.cproject 29KB
main.d 2KB
13.2.elf 728KB
stm32l431xx.h 1.1MB
core_cm4.h 118KB
cmsis_gcc.h 59KB
lcd.h 20KB
mpu_armv7.h 11KB
printf.h 9KB
cmsis_compiler.h 9KB
gpio.h 8KB
stm32l4xx.h 7KB
spi.h 7KB
flash.h 6KB
uart.h 5KB
adc.h 3KB
emuart.h 3KB
timer.h 3KB
system_stm32l4xx.h 3KB
cpu.h 2KB
cmsis_nvic.h 2KB
user.h 2KB
includes.h 2KB
wdog.h 2KB
cmsis_version.h 2KB
mcu.h 1KB
gec.h 1KB
NumToStr.h 968B
cmsis.h 288B
13.2.hex 26KB
STM32L431RCTX_FLASH.ld 5KB
13.2.lst 143KB
makefile 6KB
13.2.map 121KB
.mxproject 7KB
uecom.o 819KB
spi.o 776KB
gec.o 770KB
isr.o 767KB
lcd.o 764KB
printf.o 757KB
NumToStr.o 756KB
gpio.o 750KB
uart.o 748KB
emuart.o 746KB
main.o 746KB
flash.o 746KB
timer.o 745KB
adc.o 740KB
system_stm32l4xx.o 715KB
wdog.o 712KB
startup_stm32l431rctx.o 6KB
com.processorexpert.core.ide.newprojectwizard.prefs 87B
org.eclipse.core.resources.prefs 55B
.project 1KB
startup_stm32l431rctx.s 13KB
startup_stm32l431rctx.s 13KB
uecom.su 1KB
lcd.su 768B
flash.su 486B
gpio.su 451B
uart.su 407B
NumToStr.su 332B
printf.su 312B
emuart.su 305B
spi.su 248B
timer.su 194B
system_stm32l4xx.su 154B
isr.su 148B
wdog.su 97B
共 106 条
- 1
- 2
资源评论
橙汁333
- 粉丝: 30
- 资源: 49
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功