Day 1 - Build 과정
·
IDEC 교육/Embedded C
Keil에서 Buildaxf / bin(optional) / hex(optional)axf: windows에서의 exe와 같은 실행 파일(elf = Executable and Linkable Format 의 변형)Code & Data (bin의 내용): .text(Code) / .ro / .rwDebug 정보: 소스 코드와 기계어 코드 간의 매핑을 위한 라인 번호, 함수 이름, 변수 이름 등의 정보Symbol Table: 프로그램 내의 함수와 변수의 이름 및 주소 정보를 포함Section Header & MetaData: 각 섹션의 시작 주소, 크기, 속성 등 상세 정보를 제공Relocation 정보(optional): 실행 시 주소 조정을 위해 필요한 경우, 코드와 데이터 위치를 재배치할 수 있는 정보..
Day 1 - Variable의 선언 vs 정의
·
IDEC 교육/Embedded C
Declare vs Define선언: Type을 Comiler에게 알려주는 역할 (메모리 할당 X)extern int a;정의: 변수명 지정으로 실체화 (메모리 할당 O)int a;
Day 1 - Keil Settings & Global, Local Variable
·
IDEC 교육/Embedded C
Keil ToolProject SettingsTarget SettingsAddress of Variablemain.c#include #include "ARMCM3.h"#include "core_cm3.h"int gVar;int fputc(int c, FILE * fp){ ITM_SendChar(c); return c;}void MyFunc(){ int a, b; printf("%#010x \r\n", (int)&gVar); printf("%#010x, %#010x \r\n", (int)&a, (int)&b); return ;}void MyFunc2(){ MyFunc(); return ;}int main(){ printf("%#010x \r\n", (int)&gVar); MyFunc(); MyFun..