Storing Data on mDot Internal Flash using MBED Flash API.
Tagged: MBED Flash IAP, mDot Internal Flash
- This topic has 4 replies, 2 voices, and was last updated 2 years, 10 months ago by Ajay K.
-
AuthorPosts
-
December 23, 2021 at 11:28 am #32264Ajay KParticipant
I saw a comment in the MDot Datasheet which is as mentioned below. Most of the 400kb would be used to store the custom application firmware, however I was wondering if there is an address space within the internal flash that can be used to store data. I have increasingly found the external flash to be un-reliable over time. I was hoping to use the MBED’s Flash IAP API to write and read from the internal flash and was wondering if there is an address space within the internal flash that can be used to store a small amount of data for ex: about 42 – 50 bytes, without hindering the mDot functionality.
Flash Memory 512 KB (400 KB customer usable)
Thanks,
AjayDecember 29, 2021 at 9:21 am #32270Jason ReissKeymasterOnce the firmware is programmed into the internal flash it will not be modified by libmDot during normal operation. During FOTA the image will be overwritten of course.
Writing to the end of flash should be possible, we have done this on another system where there was no external NVM to save configurations.
December 29, 2021 at 10:14 pm #32271Ajay KParticipantThanks Jason for taking the time to respond. I was wondering if you can let me know the address range of the flash, where the data can be written?
Also I know the MBED FlashIAP object provides the size of the data in bytes that can be written at any given time and also the sector size while erasing data. if already have that information can you provide that?
Thanks,
AjayDecember 30, 2021 at 12:37 am #32272Ajay KParticipantI had to add component “FlashIAP” and also device has “Flash” capability in mbed_app.json in order to even attempt to use the FlashIAP Driver. However I ran into error when compiling the “flash_api.c” under the folder “\mbed-os\targets\TARGET_STM\TARGET_STM32F4”. Its looking for a header file called “flash_data.h”, which is present under the “TARGET_MTS_DRAGONFLY_F411RE” target, but not present for the target “TARGET_MTS_MDOT_F411RE”. So the contents of the file flash_data.h is as given below. How do I modify this file to work for the MDot target?
#ifndef MBED_FLASH_DATA_H #define MBED_FLASH_DATA_H #include "device.h" #include <stdint.h> #if DEVICE_FLASH /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ /* Exported macro ------------------------------------------------------------*/ /* FLASH SIZE */ #define FLASH_SIZE (uint32_t) 0x80000 /* Base address of the Flash sectors Bank 1 */ #define ADDR_FLASH_SECTOR_0 ((uint32_t)0x08000000) /* Base @ of Sector 0, 16 Kbytes */ #define ADDR_FLASH_SECTOR_1 ((uint32_t)0x08004000) /* Base @ of Sector 1, 16 Kbytes */ #define ADDR_FLASH_SECTOR_2 ((uint32_t)0x08008000) /* Base @ of Sector 2, 16 Kbytes */ #define ADDR_FLASH_SECTOR_3 ((uint32_t)0x0800C000) /* Base @ of Sector 3, 16 Kbytes */ #define ADDR_FLASH_SECTOR_4 ((uint32_t)0x08010000) /* Base @ of Sector 4, 64 Kbytes */ #define ADDR_FLASH_SECTOR_5 ((uint32_t)0x08020000) /* Base @ of Sector 5, 128 Kbytes */ #define ADDR_FLASH_SECTOR_6 ((uint32_t)0x08040000) /* Base @ of Sector 6, 128 Kbytes */ #define ADDR_FLASH_SECTOR_7 ((uint32_t)0x08060000) /* Base @ of Sector 7, 128 Kbytes */ #endif #endif
Thanks,
AjayDecember 30, 2021 at 1:30 pm #32274Ajay KParticipantany thoughts multitech team?
-
AuthorPosts
- You must be logged in to reply to this topic.