Skip to content

STM32G0B1CBT6 - FLASH_BANK_2 larger than 8bit #44

Description

@lbFakier

#if defined FLASH_BANK_2
ee_handle.bank_number = FLASH_BANK_2;

causing
'stm32g0b1xx.h:4003:48: warning: conversion from 'long unsigned int' to 'uint8_t' {aka 'unsigned char'} changes value from '32768' to '0' [-Woverflow]'

because

../Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_flash.h:265:41: note: in expansion of macro 'FLASH_CR_MER2'
265 | #define FLASH_BANK_2 FLASH_CR_MER2 /*!< Bank 2 */

../Drivers/CMSIS/Device/ST/STM32G0xx/Include/stm32g0b1xx.h:4004:48: note: in expansion of macro 'FLASH_CR_MER2_Msk'
4004 | #define FLASH_CR_MER2 FLASH_CR_MER2_Msk

../Drivers/CMSIS/Device/ST/STM32G0xx/Include/stm32g0b1xx.h:4003:48: warning: conversion from 'long unsigned int' to 'uint8_t' {aka 'unsigned char'} changes value from '32768' to '0' [-Woverflow]
4003 | #define FLASH_CR_MER2_Msk (0x1UL << FLASH_CR_MER2_Pos) /*!< 0x00008000 */

and

/* Handle struct of EEPROM */
typedef struct
{
uint8_t *data;
uint32_t size;
uint32_t page_sector_size;
uint32_t address;
uint8_t page_sector_number;
#if (defined FLASH_BANK_1) || (defined FLASH_BANK_2)
uint8_t bank_number;
#endif

} ee_t;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions