由于 Agliex™ 7 FPGA 安全设备管理器 (SDM) 忙于FPGA初始化的问题,Nios®运行 SDM 启动加载程序时, V HAL函数 mailbox_client_flash_open) 在 mailbox_client_open() 后可能无法打开闪存。
要在 Agliex™ 7 FPGA安全设备管理器中解决此问题,请在函数 mailbox_client_flash_open() 之后添加延迟尝试,以在 <项目位置>\top_project\sw\mailbox_bootloader\app\mailbox_bootloader.c 的主函数中打开闪存。
下面显示的最大尝试为 1000,每次尝试延迟 10 毫秒。
attribute_((noreturn)) int main(int argc, char **argv){
intel_mailbox_client* mbox_client = mailbox_client_open(MBOX_NAME);
int record_address_ptr = PAYLOAD_OFFSET;
获得专属闪存访问权限
int 尝试 = 0;
int MAX_ATTEMPTS = 1000;
while((mailbox_client_flash_open(mbox_client)!=0) &&(++attempt < MAX_TRYS)){ usleep(10000);
if (attempt == MAX_TRYS) error();
......