8 years, 10 months ago.

FLASH_TYPEPROGRAM_BYTE for STM32F0xxx

Hi,

I've been trying to port this flash storage library for the STM32F4xxx to the STM32F042K6 but I've found a puzzling roadblock: I cannot write more than a single byte into the flash memory. Now the SOF library writes to flash one char at a time, so as I was investigating I looked up the corresponding stm32f0xx_hal_flash.h for the STM32F042K6 I noticed the following:

/** @defgroup FLASH_Type_Program FLASH Type Program
  * @{
  */ 
#define TYPEPROGRAM_HALFWORD   ((uint32_t)0x01)  /*!<Program a half-word (16-bit) at a specified address.*/
#define TYPEPROGRAM_WORD       ((uint32_t)0x02)  /*!<Program a word (32-bit) at a specified address.*/
#define TYPEPROGRAM_DOUBLEWORD ((uint32_t)0x03)  /*!<Program a double word (64-bit) at a specified address*/

Compared to the STM32f4xx_hal_flash.h for the STM32F401RE:

/** @defgroup FLASH_Type_Program FLASH Type Program
  * @{
  */ 
#define FLASH_TYPEPROGRAM_BYTE        ((uint32_t)0x00)  /*!< Program byte (8-bit) at a specified address           */
#define FLASH_TYPEPROGRAM_HALFWORD    ((uint32_t)0x01)  /*!< Program a half-word (16-bit) at a specified address   */
#define FLASH_TYPEPROGRAM_WORD        ((uint32_t)0x02)  /*!< Program a word (32-bit) at a specified address        */
#define FLASH_TYPEPROGRAM_DOUBLEWORD  ((uint32_t)0x03)  /*!< Program a double word (64-bit) at a specified address */

Why does the STM32F0xxx family not have the program byte definition? Can anyone shed some light on the difference between these two families in regards to this?

Thanks, K

Be the first to answer this question.