Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8081347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:42:12+00:00 2026-06-05T16:42:12+00:00

I have made a code that read data from flash Nand (without filesystem). fd

  • 0

I have made a code that read data from flash Nand (without filesystem).

fd = open("/dev/mtd0", O_RDONLY)

It works, then I want to try to read write it..
So I change the code to:

fd = open("/dev/mtd0", O_RDWR)

But It returns -1, means can not open. But for others MTD, it works.

Then I see cat /proc/mtd said that MTD0 is RO and the other is RW (i think it’s Read-Only and Read-Write)

I tried to use MEMUNLOCK

ioctl(fd, MEMUNLOCK, &mtdLockInfo)

Because it needs fd, needs open so i use O_RDONLY not O_RDWR(return -1).

But it returns error Bad file description. It must be because of O_RDONLY,, have to use O_WRONLY or O_RDWR.

Is there any way to UNLOCK this MTD0, or to write on it without unlock it??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T16:42:14+00:00Added an answer on June 5, 2026 at 4:42 pm

    I have tried to change the partition of my NAND flash in the Device Tree Source(DTS).

    There’s an read-only option.
    But, I only changed their size.

    ANd it’s done.. My NAND flash can be accessed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some SerialPort code that constantly needs to read data from a serial
my question is that I have made multimap.Here is the partial code. if(binary_search(final.begin() ,
I have made this code to open a database(created in SQLite browser) stored in
I'm learning java and I have made simple program that simply reads value from
EDIT: I made something much better to fill and read data from a view
I have a program that load data from a file using std::ifstream and store
I have an ArrayList that needs to be read from and written to from
I have a bug in my code that made me think I don't fully
I have some socket connection code that makes use of boost::asio which reads from
I have a process that will be called rather frequently from cron to read

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.