Electronic Components Datasheet Search
  English  ▼

X  

UM0851 Datasheet(PDF) 148 Page - STMicroelectronics

Part # UM0851
Description  SPEAr is a family of highly customizable ARM-based embedded
PDF  245 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  STMICROELECTRONICS [STMicroelectronics]
Direct Link  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

UM0851 Datasheet(HTML) 148 Page - STMicroelectronics

Back Button UM0851 Datasheet HTML 144Page - STMicroelectronics UM0851 Datasheet HTML 145Page - STMicroelectronics UM0851 Datasheet HTML 146Page - STMicroelectronics UM0851 Datasheet HTML 147Page - STMicroelectronics UM0851 Datasheet HTML 148Page - STMicroelectronics UM0851 Datasheet HTML 149Page - STMicroelectronics UM0851 Datasheet HTML 150Page - STMicroelectronics UM0851 Datasheet HTML 151Page - STMicroelectronics UM0851 Datasheet HTML 152Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 148 / 245 page
background image
Non-volatile memory device drivers
UM0851
148/245
Doc ID 16604 Rev 2
Raw mode usage from user space
MTD Utils can be used to access NOR Flash via the MTD layer without a file-system. The
MTD project provides a number of helpful tools for handling NOR Flash.
●
flasherase, flasheraseall: erase and format Flash partitions
●
flashcp: Write filesystem images to NOR Flash
NOR Flash does not have bad blocks so normal busy box commands can also be used to
access it. The random access capability of NOR Flash makes it possible to access any
address of NOR Flash from user mode, once that address is properly mapped.
Raw mode usage from kernel space
NOR Flash can be directly accessed. However, MTD calls such as "mtd->read", "mtd-
>erase" and "mtd->write" can be used to read, erase and write to MTD devices. The
following code snippet shows an example where 4 bytes are read and written in the same
location of the MTD partition number 3.
struct mtd_info *mtd;
int ret = 0;
void *buffer;
size_t retlen = 0;
/* Get MTD info of 3rd partition */
mtd = get_mtd_device(NULL, 3);
if (!mtd) {
err( "Err in get mtd\n");
return;
}
/* Read 4 bytes from partition 3 and store in 'buffer' */
ret = mtd->read(mtd, 0, 4, &retlen, buffer);
if (ret < 0) {
err("Err MTD read=%d\n", ret);
return;
}
/* Write 4 bytes into the partition 3 from the 'buffer' */
ret = (*(mtd->write)) (mtd, 0, 4, &retlen, buffer);
if (ret < 0) {
err("Err MTD write=%d\n", ret);
return;
}
Logical mode usage from user space
The MTD partition can be mounted using a file-system and then can be used. The NOR
Flash partition is supported by JFFS2 only, so make sure that a valid JFFS2 image is
already present in the partition to avoid getting a lot of JFFS2 errror messages.
# mount -t jffs2 /dev/mtdblock3 /mnt
#cp /tmp/song.mp3
/mnt/
#ls /mnt
Song.mp3
#



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100  ...More


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com