Storing Data on mDot Internal Flash using MBED Flash API.

Home Forums mDot/xDot Storing Data on mDot Internal Flash using MBED Flash API.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #32264
    Ajay K
    Participant

    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,
    Ajay

    #32270
    Jason Reiss
    Keymaster

    Once 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.

    #32271
    Ajay K
    Participant

    Thanks 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,
    Ajay

    #32272
    Ajay K
    Participant

    I 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,
    Ajay

    #32274
    Ajay K
    Participant

    any thoughts multitech team?

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.