IAR链接器配置,将ROM复制到RAM进行初始化

时间:2017-11-02 14:10:11

标签: c linker-errors iar linker-scripts

我尝试在IAR链接器配置文件(.icf)中定义一个单独的RAM区域/部分。该部分应包含如下初始化的变量:

  func accept(_ sender: UIButton){
   let buttonTag = sender.tag
    let point = sender.convert(CGPoint.zero, to: friendRequestTableView as UIView)
    let indexPath: IndexPath! = followerReqTableView.indexPathForRow(at: point)
    let user = requestsArray[indexPath.row]

  func decline(_ sender: UIButton){
    let buttonTag = sender.tag
    let point = sender.convert(CGPoint.zero, to: friendRequestTableView as UIView)
    let indexPath: IndexPath! = followerReqTableView.indexPathForRow(at: point)
    let user = requestsArray[indexPath.row]

}


func tableView(_ tableView:UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {

    guard let cell = friendRequestTableView.dequeueReusableCell(withIdentifier: "FriendRequestTableViewCell") as? FriendRequestTableViewCell else { return UITableViewCell() }


    let user = requestsArray[indexPath.row]

    let image = cell.viewWithTag(1) as! UIImageView



    cell.confCell(///some user details)

    cell.decline.tag = 2
    cell.accept.tag = 3

    cell.decline.addTarget(self, action:#selector(self.decline(_:)), for: .touchUpInside)
    cell.decline.addTarget(self, action:#selector(self.accept(_:)), for: .touchUpInside)


    return cell

}

这是我在icf文件中尝试过的:

#pragma default_variable_attributes = @ "MY_SECTION"

int a = 0;
int b = 666;

#pragma default_variable_attributes =

如果没有通过复制线进行初始化,那么每件事都可以正常工作。但是我被迫将所有变量初始化为0.我想自由选择初始值,这就是为什么我尝试使用复制ROM进行RAM初始化。

通过上面的代码,我不断收到警告:

define symbol MY_REG_START = PREVIOUS_REGION_END + 1;
define symbol MY_REG_END   = MY_REG_START + SIZE_16K - 1;

define region MY_REGION = mem:[from MY_REG_START to MY_REG_END];

initialize by copy { section MY_SECTION };

place in MY_REGION { section MY_SECTION };

我的配置有什么问题?

0 个答案:

没有答案