Skip to Content
Programming Embedded Systems in C and C++
book

Programming Embedded Systems in C and C++

by Michael Barr
January 1999
Beginner to intermediate
200 pages
7h 43m
English
O'Reilly Media, Inc.
Content preview from Programming Embedded Systems in C and C++
80 Chapter 6: Memory
automatically whenever the system is reset; no special initialization sequence is
required to enable reading.
Writing data to a Flash is much harder. Three factors make writes difficult. First,
each memory location must be erased before it can be rewritten. If the old data is
not erased, the result of the write operation will be some logical combination of
the old and new values, and the stored value will usually be something other than
what you intended.
The second thing that makes writes to a Flash difficult is that only one sector, or
block, of the device can be erased at a time; it is impossible to erase a single byte.
The size of an individual sector varies by device, but it is usually on the order of
several thousand bytes. For example, the Flash device on the Arcom board—an
AMD 29F010—has eight sectors, each containing 16 kilobytes.
Finally, the process of erasing the old data and writing the new varies from one
manufacturer to another and is usually rather complicated. These device program-
ming interfaces are so awkward that it is usually best to add a layer of software to
make the Flash memory easier to use. If implemented, this hardware-specific layer
of software is usually called the Flash driver.
Flash Drivers
Because it can be difficult to write data to the Flash device, it often makes sense to
create a Flash driver. The purpose of the Flash driver is to hide
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Embedded Systems Object-Oriented Programming in C and C++

Embedded Systems Object-Oriented Programming in C and C++

Israel Gbati

Publisher Resources

ISBN: 1565923545Catalog PageErrata