全站数据
8 4 2 0 5 8 1

Stm8单片机怎样让程序运行在内存里

造价工程师说 | 简单学习,快乐成才!         
问题更新日期:2024-10-16 03:43:39

问题描述

Stm8单片机怎样让程序运行在内存里,在线求解答
精选答案
最佳答案

这个的话一般程序的运行都是在内存里的

其他回答

我正在写stm8的IAP程序,打算用IAP程序通过串口升级自己(IAP程序)单片的的RAM有6K我在.LKF文件里定义了:#include

"STM8S.h

"#include

"stm8s_type.h

"#include

"lcd1602.h

"#include

"stm8s_flash.h

"#include

"vec.h

"#include

"main.h

"# Segment Ram:+seg .CODE_IN_RAM -a .bss -n .CODE_IN_RAM -ic在main.c里也写了int _fctcpy(char name);#pragma section(CODE_IN_RAM)void Tim4_INIT(void) { ……}void UART1_INIT(void) { ……}void Uart1_send(unsigned char com_data) { ……}void DeInit_Gpio(void) { ……}void IAP_command(void) { ……}@far @interrupt void Uart1_Recv_IRQHandler(void) { ……}@far @interrupt void TIM4_UPD_OVF_IRQHandler(void) { ……}// 为了方便观看{ ……}里面的程序省略#pragma section()main(){ _fctcpy('C');while(1)IAP_command();}IAP程序存放在0x8000-0x9fff里面,我在IAP升级时,到了一半被卡住了中断向量表我是写到源代码最后完成后才写的,可能是main没运行在RAM里面,程序刚好写到main的位置被卡死了,请问用什么方法能让全部代码在RAM里运行