stm8开发环境建立

上传人:san****019 文档编号:70758380 上传时间:2019-01-18 格式:PPT 页数:36 大小:708.51KB
返回 下载 相关 举报
stm8开发环境建立_第1页
第1页 / 共36页
stm8开发环境建立_第2页
第2页 / 共36页
stm8开发环境建立_第3页
第3页 / 共36页
stm8开发环境建立_第4页
第4页 / 共36页
stm8开发环境建立_第5页
第5页 / 共36页
点击查看更多>>
资源描述

《stm8开发环境建立》由会员分享,可在线阅读,更多相关《stm8开发环境建立(36页珍藏版)》请在金锄头文库上搜索。

1、STM8 开发环境建立,http:/,STM8 开发环境建立,STM8处理器特点,通用特点 Max fCPU: Up to 24 MHz。 1.6 cycles/instruction。 up to 128 Kbytes Flash。 up to 2 Kbytes true data EPROM。 up to 6 Kbytes。 Up to 70 user I/Os。,STM8处理器特点,CAN 控制器特点 High speed 1 Mbit/s active CAN 2.0B interface。 3 transmit mailboxes。 1 receive FIFO with three

2、 stages。 6 scalable filter banks。 Time Stamp on SOF reception and transmission。 Error management。,STM8处理器特点,MEMORY MAP,开发工具,软件: 编译器:CXSTM8(cpstm8, cgstm8, costm8, castm8) 连接器:CLNK 编程支持工具:chex,clabs,clib,cobj,cv695,cvdwarf 调试器:ST Visual Develop 编程器:ST Visual Programmer 硬件: 仿真器Rlink 仿真器STICE,CXSTM8,Co

3、mpiler Architecture(CXSTM8): cpstm8:the C preprocessor and language parser. cpstm8 expands directives in your C source and parses the resulting text. cgstm8 - the code generator. cgstm8 accepts the output of cpstm8 and generates assembly language statements.,CXSTM8,costm8 - the assembly language opt

4、imizer. costm8 optimizes the assembly language code that cgstm8 generates. castm8 - the assembler. castm8 converts the assembly language output of costm8 to a relocatable object module.,CLNK,CLINK clnk combines all the object modules that make the appropriate modules from the C library.,PROGRAMMING,

5、编程支持工具: chex - absolute hex file generator. clabs - absolute listing utility. clib - build and maintain object module libraries. cobj - object module inspector. cv695 - IEEE695 format converter. cvdwarf - ELF/DWARF format converter.,COMPILER,File Naming Conventions,COMPILER,Memory Models Zero Page:0

6、x000xff, more efficient than Long Range variables. long range:0x10017ff。,COMPILER,Step 1: Compiling cxstm8 options .c|s Step 2: Linking clnk options Step 3: Generating hex file chex options file Step 4: Generating updata file,COMPILER,BUILD.BAT cxstm8 options: -l :create listing +debug :produce debu

7、g information +modsl :select the Stack Long mode. +warn :enable warnings. +strict :enforce stronger type checking.,COMPILER,ce*:specify a path for the error files. -e :log errors file. t* :specify path for temporary files. -co*:specify a path for the object files.,CLNK,Clnk option: -bs# :bank size -

8、m* :map file name -o* :output file name -sa :sort symbol by address,CLNK,SV64E0_M8.lkf +seg -a* :make the current segment follow the segment * -b* :set the physical start address of the segment to * -ic: mark this segment as moveable segment -m*:set the maximum size of the segment to * bytes.,CLNK,-

9、n:set the output name of the segment to *.,CLNK,Segment type: .text:code (or program) section .fconst:large constant and literal data .const:constant and literal data .data:initialized data in long addressing range memory .bss:all non initialized data in long range memory,CLNK,.bsct:initialized data

10、 in the first 256 bytes .ubsct:non initialized data in the zero page .fdata:large variables .eeprom:any variable in eeprom .bit:bit variables in the zero page,Runtime Startup,Runtime Startup(crtsxf.s): Establish a runtime environment for C. Include: Initialization of the data section if any, ROM int

11、o RAM copy if required, Initialization of the stack pointer, main or other program entry point call, An exit sequence to return from the C environment.,Runtime Startup,ROM COPY TO RAM Automatic Data Initialization Moveable Code,Runtime Startup,Automatic Data Initialization The linker is able to conf

12、igure the executable for an automatic data initialization.This mechanism is initiated automatically when the linker finds the symbol _idesc_ in the symbol table.,Runtime Startup,Moveable Code The linker allows a code segment to be stored in the ROM part, but linked at another address which is suppos

13、ed to be located in RAM. This feature is specially designed to allow an application to run FLASH programming routines or bootloader from the RAM space.,Runtime Startup,Descriptor:The starting address and length of each segment to be copyed to RAM. Format: dc.w start_prom_address; dc.b flag ; segment

14、 type dc.w start_ram_address dc.w end_prom_address dc.b 0 ;end of the descriptor,Runtime Startup,_idesc_:The address of the descriptor, built by clnk 。,clabs,clabs options file -v :be verbose. The name of each module of the application is output to STDOUT.,chex,chex options inputfile outfile -f? :de

15、fine output file format. Default -fm,cvdwarf,cvdwarf options inputfile -o* :output file name,DEBUG,Debug 1.Run ST Visual Develop. 2.File| New Workspace,Select Wrap Executable.Select SV64E0.elf.,DEBUG,3.Enter ok!,DEBUG,4.Select MCU STM8AF51AA.,DEBUG,5. Insert files into project. Project | Insert file

16、s into project. Select all the *.c , *.h *.s files of the project in the open window.,DEBUG,6.Select the emluator. By pressing Debug instrument | Target Settings.The dialog for choose the emulutor will be opened.,DEBUG,.Select Swim Rlink for the Rlink emluator. .Select Swim STice for the STice emluator. .Target Port Selection: usb:/usb,DEBUG,7 .Start Debug. By pressing Debug | Start

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 高等教育 > 大学课件

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号