Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12746 Discussions

Direct Read/Write of flash from uClinux app

Altera_Forum
Honored Contributor II
1,106 Views

I am trying to use the flash on the development board to store some user settings that remain between boots, but can't figure out how to directly access the flash device. I see that there are functions available for generic NIOS2 apps, or for uCOS apps, but can't find anything on how to do the same thing under uClinux. Are there any examples that I can use as a starting point for this?

0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
392 Views

Why not try those same commands under uCLinux? It's built on top of the HAL, as well, I believe. 

 

Cheers, 

 

- slacker
0 Kudos
Altera_Forum
Honored Contributor II
392 Views

Hi mtmurphy, 

 

There are a bunch of ways to do this. The easiest would probably be to use mtd and do direct 

access via the character mode driver (ie -- through the /dev/mtd inode). You would then be 

able to read/write and use ioctl for erasing. 

 

A step up from there would be to add jffs2 and just create-read-modify-write a file -- more kernel 

config here, but it doesn't get much easier from a programming point-of-view. 

 

Regards, 

--Scott
0 Kudos
Reply