使用 make 命令编译引导加载程序 (ATMEGA2560) 时出现问题

问题描述

从上周开始,我正在为 arduino mega 工作 OTA 系统。我有一个引导加载程序,它可以从 SD 卡刷新固件。这是 github 存储库 https://github.com/FleetProbe/MicroBridge-Arduino-ATMega2560/tree/master/hardware/microbridge 的链接。

根据引导加载程序 SD 卡芯片选择引脚的自述文件,应连接到 arduino mega 的数字引脚 53。当我为 SD 卡的芯片选择定义 pin D53 时,它工作正常。问题是我想将 SD 卡的默认芯片选择引脚从 D53 更改为 D44。

并且自述文件(click here 读取自述文件)说,如果您想从默认值(即 53)更改 CS 引脚,则需要更改 asmfunc.S 中的引脚排列并重新编译引导加载程序。

要编译引导加载程序,我使用 microchip studio 命令提示符并生成命令。 make命令如下:

  • 清理干净
  • 做一切。

但它给出了我不明白的错误。这是命令提示符的屏幕截图。

enter image description here

以下是我用来完成 OTA 系统的东西:

  • 开发板:Arduino Mega (ATMEGA 2560)
  • 程序员:AVR-ISP-MK2
  • 开发 IDE:Arduino IDE(版本:1.8.13)

这是我在刻录引导加载程序后使用的代码片段:

#include <SPI.h>
#include <SD.h>
#include <avr/wdt.h>
#include "EEPROM.h"

#define sdcs 44

void setup()
{
   Serial.begin(9600);

   /*----(Initialise sd Module)-----*/
   if (!SD.begin(sdcs)) 
   {                       
      Serial.println(F("Card failed,or not present"));
   }
   else
   {
      Serial.println(F("card initialized."));
   }

   Serial.println("Press 'F' and 'enter' to set flagbit in eeprom 0x1FF to 0xF0 ");
   Serial.println("also to induce watchdog timeout which triggers the bootloader ");
   Serial.println("and flashes the new firmware on the sd card");
}
void loop()
{
   char inChar = '\0';

   while (Serial.available() > 0) 
   {
     inChar = Serial.read();
   }
   wdt_enable(WDTO_500MS); // have the wdt reset the chip

   // if 500ms passes without a reset
   if (inChar == 'F') {
   Serial.println("");
   Serial.println("rebooting and flashing with firmware.bin on sdcard");
   EEPROM.write(0x1FF,0xF0);
   wdt_reset();
   delay(600); // wait 600ms to timeout wdt
   }
}

以下是引导加载程序目录中的文件:

enter image description here

需要帮助。提前致谢!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)