This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] MSP430G2231:".stack "段大小问题

Guru**** 1457880 points
Other Parts Discussed in Thread: MSP430G2231
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/1355307/msp430g2231-stack-section-size-problem

器件型号:MSP430G2231

#include "msp430.h"



void main(void) 
{
    WDTCTL = WDTPW | WDTHOLD;   // stop watchdog timer

    // We need to make a variable to generate a Delay

    volatile unsigned int i;

    P1DIR |= BIT0; //Declare the Direction of P1.0

    while(1){

            P1OUT |= BIT0; //Set P1.0 to logic = 1

            for(i=0; i<100;i++);

            P1OUT &= ~BIT0; //Set P1.0 to logic = 0

            for(i=0; i<100;i++);
            }

 }


您好!  

我正在使用 MSP430G2 Launchpad 和 MSP430G2231微控制器。

我正尝试在 Code Composer Studio 上编译上面的代码、但它不断给出以下 警告:

#10443-D The ".stack" section size is required to be aligned to 4 bytes, but the specified size, 0x32, is not. The aligned size is 0x34		 	C/C++ Problem

我在论坛上搜索同一个问题、但找不到任何有用的解决方案  

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    这应该不是问题。 我不知道为什么它认为需要长字对齐。 字对齐就足够了。

    通过编辑链接器命令脚本、您应该能够解决这个问题。 将0x32更改为0x30应使其保持快乐。 (每个器件都有一个脚本 msp430g2331.cmd 或类似的脚本。 使用首选的文本编辑器。)

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 David:

    感谢您的更新。

    请在回复中单击"这个已解决我的问题"、然后它将关闭该主题。

    如果您还需要讨论其他问题、您可以重新发布此主题或提交新主题。

    B.R.

    萨尔