flash-memory

Erasing Flash NOR: ioctl(MEMUNLOCK) return status?

久未见 提交于 2019-12-19 03:08:05
问题 I'm trying to erase a NOR Flash memory with Linux MTD driver in C... I'm confused about the return status from the ioctl(MEMUNLOCK) call which returns an error even if ioctl(MEMERASE) is successful after it. The following code displays the warning message but works (i.e. the Flash block has been erased): int erase_MTD_Pages(int fd, size_t size, off_t offset) { mtd_info_t mtd_info; erase_info_t ei; ioctl(fd, MEMGETINFO, &mtd_info); ei.length = mtd_info.erasesize; for(ei.start = offset; ei

How to write/read to FLASH on STM32F4, Cortex M4

末鹿安然 提交于 2019-12-17 16:23:52
问题 I want to write a variable, for example an integer with the number 5 to the FLASH and then after the power goes away and the device is turned on again read it. I already know that in order to write something I first need to erase the page and then write. In the manual it says: Write OPTKEY1 = 0x0819 2A3B in the Flash option key register (FLASH_OPTKEYR) Write OPTKEY2 = 0x4C5D 6E7F in the Flash option key register (FLASH_OPTKEYR) How do I perform this tasks? Sector 0 has a Block adress from

Allocating memory in Flash for user data (STM32F4 HAL)

心不动则不痛 提交于 2019-12-17 15:35:52
问题 I'm trying to use the internal flash of an STM32F405 to store a bunch of user settable bytes that remain after rebooting. I'm using: uint8_t userConfig[64] __attribute__((at(0x0800C000))); to allocate memory for the data I want to store. When the program starts, I check to see if the first byte is set to 0x42 , if not, i set it using: HAL_FLASH_Unlock(); HAL_FLASH_Program(TYPEPROGRAM_BYTE, &userConfig[0], 0x42); HAL_FLASH_Lock(); After that I check the value in userConfig[0] and I see 0x42 ..

calculating FLASH utilisation by C code

烈酒焚心 提交于 2019-12-13 05:14:37
问题 I want to optimize/reduce memory usage of my software. One of the approaches that I'm looking at is to look for removing redundant and unnecessary code. In my software there are lot of features (up to 3000) which can be activated/deactivated via a Feature Enable mechanism. What I am trying to do is to find how much RAM/FLASH a feature utilizes and then start evaluating with the biggest ones and see if they are required or not (Features not required can be safely deleted from the code). Also

How to recover Intel Edison board

♀尐吖头ヾ 提交于 2019-12-13 02:48:44
问题 I had flashed Intel's pre-built src images on board by replacing u-boot.elf compiled with buildroot(having support for Edison board). But the board is stuck on FSBL(FSBL watchdog is continuously rebooting the board). I tried to flash on board, but on board no listener is present to serve flash operation (usually done by dfu utility in u-boot). So that I am not able to flash pre-built images again. By this present conditions, how can I bring my board up? How can I flash images again? INPUT :

NAND flash programming: granularity of writes?

╄→尐↘猪︶ㄣ 提交于 2019-12-12 10:13:17
问题 is someone in the kow about write accesses on nowadays large NAND flash chips? What is the minimal granularity for writes? I have a microcontroller flash here which requires at least 1 and at most 4 words (16-bit words that is) to be fed to the write statemachine at once. I think that the large (> 1 Gbit) flashes behave differently here for write performance reasons. slarti 回答1: So to be clear, to write a 1 bit you have to clear a whole block of memory, to write a 0 bit you only have to write

ESP8266 cannot read flash after programming

痴心易碎 提交于 2019-12-12 05:04:45
问题 I have written the flash on an ESP-12E, using a custom build with the base modules + OneWire and mDNS. The build is from a website i've used before and the build have always worked. The flash write was apparently successful, yet after the write the ESP started to send garbage data and it hasn't stopped yet. The ESP8266 download tool from Espressif fails to program the flash, and so does esptool. The fun part is: I can actually read the MAC for both the AP and the STATION. GPIO0/2 changes have

Microcontroller and flash memory chip programming development and simulation

一个人想着一个人 提交于 2019-12-12 03:30:08
问题 I just started to learn micro-controller programming and I seem to have a lot of trouble getting started, particularly the simulation part. This is an application I need to program: I need to store a few wave files in a flash memory chip, and use a Cortex-M0 to read in the music from the flash memory, and play them in combination, or run some basic signal processing on them. I am looking for an IDE that supports the end-to-end simulation on this. I looked at CoIDE (because if I google free

Check if certain USB Flash memory is connected to my system

人盡茶涼 提交于 2019-12-11 15:03:25
问题 I want to have a code which it checks if certain USB flash memory is connected to my system. I mean I want to fetch something like product ID and serial Number from the usb flash memory which is connected to my linux based system and check if these numbers match my valid numbers. I also want to know is there a way that someone can fake this numbers? I mean someone uses a invalid flash memory device and generates these numbers to pass my validation process? 回答1: USB devices are described in

Erasing external FLASH

為{幸葍}努か 提交于 2019-12-11 11:58:53
问题 I'm working with a MCF51EM256 Freescale microcontroller and I've some problems to store data in the external flash memory to make it persistent. I need to store this struct: typedef struct { ui64_s Ea_ps; ui64_s Ea_ng; ui64_s Er_q1; ui64_s Er_q2; ui64_s Er_q3; ui64_s Er_q4; uint16 F_ea; uint16 F_er; }Ws_EnergyAcc64; Where: typedef union{ uint64 v; uint32 p[2]; } ui64_s; and: typedef unsigned long long int uint64; typedef unsigned long int uint32; typedef unsigned short int uint16; In order to