PSOC4100S初始化程序

公告

大中华汽车电子生态圈社区并入开发者社区- 更多资讯点击此

Tip / 登入 to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
HaYa_4104701
Level 1
Level 1
Distributor - Arrow(GC)
5 replies posted 5 questions asked First reply posted

1. PSOC初始化程序放在哪个函数里

2. PSOC在启动时,是否会进行堆栈初始化?

请大牛帮忙

0 点赞
1 解答
lock attach
Attachments are accessible only for community members.
LinglingG_46
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 10 questions asked

stack 和 heap的初始化是在cm0gcc.ld(如果是gcc编译器)

以附件工程为例:

1:找到 cm0gcc.ld 文件,

2:找到

    /* The .stack and .heap sections don't contain any symbols.
    * They are only used for linker to calculate RAM utilization.
    */
    .heap (NOLOAD) :
    {
      . = _end;
      . += 0x80;
      __cy_heap_limit = .;
    } >ram

    .stack (__cy_stack - 0x0800) (NOLOAD) :
    {
      __cy_stack_limit = .;
      . += 0x0800;
    } >ram

/* Check if data + heap + stack exceeds RAM limit */

    ASSERT(__cy_stack_limit >= __cy_heap_limit, "region RAM overflowed with stack")

在原帖中查看解决方案

0 点赞
3 回复数
LinglingG_46
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 10 questions asked

1: 程序的初始化,你可以看工程编译之后,生成的文件 cy_boot。

   你可以看一下cyfitter_cfg.c 文件中,有没有想需要的部分。

2: 启动时,会进行堆栈初始化的。

0 点赞
HaYa_4104701
Level 1
Level 1
Distributor - Arrow(GC)
5 replies posted 5 questions asked First reply posted

1. 没找到cyfitter_cfg.c

2. 初始化是把堆栈里的值全都置‘0’,是吗

pastedImage_0.png

0 点赞
lock attach
Attachments are accessible only for community members.
LinglingG_46
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 10 questions asked

stack 和 heap的初始化是在cm0gcc.ld(如果是gcc编译器)

以附件工程为例:

1:找到 cm0gcc.ld 文件,

2:找到

    /* The .stack and .heap sections don't contain any symbols.
    * They are only used for linker to calculate RAM utilization.
    */
    .heap (NOLOAD) :
    {
      . = _end;
      . += 0x80;
      __cy_heap_limit = .;
    } >ram

    .stack (__cy_stack - 0x0800) (NOLOAD) :
    {
      __cy_stack_limit = .;
      . += 0x0800;
    } >ram

/* Check if data + heap + stack exceeds RAM limit */

    ASSERT(__cy_stack_limit >= __cy_heap_limit, "region RAM overflowed with stack")

0 点赞