需要确认注册邮箱后才能开通博客,立即确认我的邮箱
文章 搜索 高级搜索 ?3? ?3?
  • 滤波器new!
  • LED驱动 new!
  • 新能源 new!
  • PLL
  • PCIE协议
  • 可穿戴
  • LSI
  • FCI
文章 论坛 博客 小组 研讨会
EDN电子技术论坛>博客 >stephen100博客 >Accessing EPCS from NIOS II

stephen100的博客——stephen100's Blog

博主:stephen100???? ???? ????
介绍: The world is just awesome !?
文章(62)???? 访问(147919)???? 评论(22)???? 投票(6)???? 订阅本博??

博文列表查看方式: ???

Accessing EPCS from NIOS II
发布时间:2009-01-19 15:11:23
技术类别:嵌入式
需要确认注册邮箱后才能下载,立即确认我的邮箱
If you are wondering how to access the EPCS from the NIOS II directly, you have come to the right place. I believe you might have tried to read the NIOS II handbook that covers almost 600 pages to find out the answer. Nevertheless, it seems like there is no straight answer to the question in the NIOS II handbook. You might have even tried to look into the?Software Files?mentioned in the chapter named?EPCS Device Controller Core with Avalon Interface, which are?altera_avalon_epcs_controller_flash.c,altera_avalon_epcs_controller_flash.h,?epcs_commands.c?andepcs_commands.h. However, still, none of these files give you much clue how to access the EPCS from the NIOS II processor.

In fact, the handler that gives you the access to the EPCS device is notalt_flash_epcs_dev?(as you see inaltera_avalon_epcs_controller_flash.h), but?alt_flash_fd, which is the exact same handler that you use to access the common flash device like Spansion and Intel flash device. To my surprise, the NIOS II handbook does not mention about this. Perhaps this is a common sense to everybody else that the Spansion/Intel flash and the SPI Serial Flash should have a same handler, but NOT to a dummy user like me! After asking around, I believe I am not the only one who thinks like this! Therefore, I still see that there is some room for improvement in the next version of NIOS II handbook. Not every NIOS II user is a hardware designer. Not every NIOS II user is a software developer, either. Some NIOS II users like me have to do co-hardware/software design and development at the same time. Sometimes I just feel that the handbook couldn’t link me very well between?the hardware and software. For an example, my earlier frustration could have been resolved if there is a small piece of C code like the following included in the Chapter 3 of the Quartus II Handbook Volume 5 (a.k.a. NIOS II Handbook Volume 3).

////////////////////////////////////////////
// hello_epcs.cpp
// date created: March 30, 2006
// author:?
http://fpgaforum.blogspot.com
////////////////////////////////////////////
#include?<iostream>
#include?"system.h"
#include?"sys/alt_flash.h"
#include?"sys/alt_flash_dev.h"
using namespace?std;

int?main()
{
?? ?alt_flash_fd* my_epcs;
?? ?char?my_data[256];

//check your (EPCS_CONTROLLER_NAME) from system.h
my_epcs = alt_flash_open_dev(EPCS_CONTROLLER_NAME);

if(my_epcs)
{
?? ?cout << "EPCS opened successfully!" << endl;

??//example application, read general data from epcs address 0x70000
int ?ret_code = alt_read_flash(my_epcs, 0x70000, my_data, 256);
if(!ret_code)
{
?? ? ? cout << my_data << endl;
?? ? ?return ?0;
}
else
?? ? ?return?-1;
}
else
{
?? ?cout << "Error! EPCS not opened!" << endl;
?? ?return?-2;
}
}
// The end
/////////////////////////////////////////////////////////

Anyway, I just found out that if you are lucky, you might still be able to find out the code very similar like above from the software example calledmemtest.c?in the?&ltNIOS II Path>\examples\software\memtest?folder. By the way, you can only view the code after installing the NIOS II software tool.




标签:??
分享到:? 新浪微博 ?? 微信 ??


打开微信“扫一扫”,打开网页后点击屏幕右上角分享按钮

1.扫描左侧二维码
2.点击右上角的分享按钮
3.选择分享给朋友
qq空间 ?? 腾讯微博 ?? 人人网 ?? 百度搜藏 ??
??????有[ 0 ]名读者喜欢此文
阅读(2115)?? 评论(1)?? 收藏??I?? 打印??I?? 推荐到小组??I?? 转发到我的博客 (0)
对不起,您还没有登录,请先登录注册
上一篇:加菲猫语录

下一篇:伽玛校正

最近到访博主
京城一沙鸥
牛人有话说 - Accessing EPCS from NIOS II
美国的游客 (您将以游客身份发表,请登录 | ?注册)
?
你还可以输入1000
验证码:
分享: 新浪微博?? qq空间?? qq微博?? 人人网?? 百度搜藏??
?
有 [ 1 ] 名读者发表评论 - Accessing EPCS from NIOS II
请问,问什么经过 my_epcs = alt_flash_open_dev(EPCS_CONTROLLER_NAME); 我读出来的my_epcs是0 请楼主多多指教
(0) ???? (0) ???? 回复(0)
对不起,您还没有登录,请先登录注册
???? 2010-01-29 00:33
转发到我的博客
评论?@stephen100's Blog?的“Accessing EPCS from NIOS II”
IfyouarewonderinghowtoaccesstheEPCSfromtheNIOSIIdirectly,youhavecometotherightplace.IbelieveyoumighthavetriedtoreadtheNIOSIIhandbookthatcoversalmost60...
你还可以输入30000
同时评论给?stephen100
????
快速回复
?
你还可以输入1000
????
引用回复
引用评论?
?
你还可以输入1000
????
文章存档
最新评论
阅读排行
stephen100的小组???? 加入小组
FPGA讨论组
成员3308名
创建者:stephen100 图像视频讨论区 成员140名
创建者:stephen100 The SOPC Builders 成员437名
创建者:riple 成员2004名
创建者:emot EDN助学—CAN学习小组与书友会 成员4533名
创建者:PIAE MSP430讨论小组 成员1409名
创建者:ruanwentao 模拟器件技术小组 成员4021名
创建者:彩云 usb cy68013 成员992名
创建者:ares007 Numonyx存储小组 成员427名
创建者:younglew Windows Embedded 成员699名
创建者:彩云 MCU天地 成员292名
创建者:kkssdd
展开
最新网络博文
TQ210 WINCE 大分辨率不启动的问题
决战在即:量子点与OLED谁主沉浮?
基于HDRS平台的太阳能发电设备远程故...
例说FPGA连载4:FPGA语言与厂商介绍
加速创新,努比亚突破摩尔定律
? 更多博文>>
返回博客首页
有问题请反馈