发新帖我要提问
12
返回列表
打印
[STM8]

使用TM2中断没有问题,多加一个中断就异常

[复制链接]
楼主: lizye
手机看帖
扫描二维码
随时随地手机跟帖
21
lizye|  楼主 | 2016-10-30 22:58 | 只看该作者 回帖奖励 |倒序浏览

icf文件,没有修改过
/////////////////////////////////////////////////////////////////
//      Example ILINK command file for
//      STM8 IAR C/C++ Compiler and Assembler.
//
//      Copyright 2014 IAR Systems AB.
//
/////////////////////////////////////////////////////////////////

define memory with size = 16M;

define region TinyData = [from 0x00 to 0xFF];

define region NearData = [from 0x0000 to 0x07FF];

define region Eeprom = [from 0x4000 to 0x43FF];

define region BootROM = [from 0x6000 to 0x67FF];

define region NearFuncCode = [from 0x8000 to 0xFFFF];

define region FarFuncCode = [from 0x8000 to 0xFFFF];

define region HugeFuncCode = [from 0x8000 to 0xFFFF];


/////////////////////////////////////////////////////////////////

define block CSTACK with size = _CSTACK_SIZE  {};

define block HEAP  with size = _HEAP_SIZE {};

define block INTVEC with size = 0x80 { ro section .intvec };

// Initialization
initialize by copy { rw section .far.bss,
                     rw section .far.data,
                     rw section .far_func.textrw,
                     rw section .huge.bss,
                     rw section .huge.data,
                     rw section .huge_func.textrw,
                     rw section .iar.dynexit,
                     rw section .near.bss,
                     rw section .near.data,
                     rw section .near_func.textrw,
                     rw section .tiny.bss,
                     rw section .tiny.data,
                     ro section .tiny.rodata };

initialize by copy with packing = none {section __DLIB_PERTHREAD };

do not initialize  { rw section .eeprom.noinit,
                     rw section .far.noinit,
                     rw section .huge.noinit,
                     rw section .near.noinit,
                     rw section .tiny.noinit,
                     rw section .vregs };

// Placement
place at start of TinyData      { rw section .vregs };
place in TinyData               { rw section .tiny.bss,
                                  rw section .tiny.data,
                                  rw section .tiny.noinit,
                                  rw section .tiny.rodata };

place at end of NearData        { block CSTACK };
place in NearData               { block HEAP,
                                  rw section __DLIB_PERTHREAD,
                                  rw section .far.bss,
                                  rw section .far.data,
                                  rw section .far.noinit,
                                  rw section .far_func.textrw,
                                  rw section .huge.bss,
                                  rw section .huge.data,
                                  rw section .huge.noinit,
                                  rw section .huge_func.textrw,
                                  rw section .iar.dynexit,
                                  rw section .near.bss,
                                  rw section .near.data,
                                  rw section .near.noinit,
                                  rw section .near_func.textrw };

place at start of NearFuncCode  { block INTVEC };
place in NearFuncCode           { ro section __DLIB_PERTHREAD_init,
                                  ro section .far.data_init,
                                  ro section .far_func.textrw_init,
                                  ro section .huge.data_init,
                                  ro section .huge_func.textrw_init,
                                  ro section .iar.init_table,
                                  ro section .init_array,
                                  ro section .near.data_init,
                                  ro section .near.rodata,
                                  ro section .near_func.text,
                                  ro section .near_func.textrw_init,
                                  ro section .tiny.data_init,
                                  ro section .tiny.rodata_init };

place in FarFuncCode            { ro section .far.rodata,
                                  ro section .far_func.text };

place in HugeFuncCode           { ro section .huge.rodata,
                                  ro section .huge_func.text };

place in Eeprom                 {    section .eeprom.noinit };

place in Eeprom                 {    section .eeprom.data };

place in Eeprom                 {    section .eeprom.rodata };

/////////////////////////////////////////////////////////////////

使用特权

评论回复
22
ousj| | 2016-10-30 23:00 | 只看该作者
乱飞的时候,看下stack指针指到哪里去了,看是不是stack 溢出了。

使用特权

评论回复
23
lizye|  楼主 | 2016-10-30 23:03 | 只看该作者
stack 都设到0x200了,还溢出。
EWSTM8有问题吧,唉,本以为用STM8封装小,好焊接

使用特权

评论回复
24
kangzj| | 2016-10-30 23:05 | 只看该作者
不行还的换回STM32了。

使用特权

评论回复
25
小小猫咪| | 2016-10-30 23:08 | 只看该作者
如果怀疑编译器的问题,那用stvd看看

使用特权

评论回复
26
lizye|  楼主 | 2016-10-30 23:10 | 只看该作者
结贴了,多谢大家讨论这么多哈,呵呵

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则