Skip to content

Incorrect use of __attribute__((weak)) in flash_hal #8883

Closed
@ErikBogg

Description

@ErikBogg

Basic Infos

  • This issue complies with the issue POLICY doc.
  • I have read the documentation at readthedocs and the issue is not addressed there.
  • I have tested that the issue is present in current master branch (aka latest git).
  • I have searched the issue tracker for a similar issue.
  • If there is a stack dump, I have decoded it.
  • I have filled out all fields below.

Platform

  • Hardware: other
  • Core Version: 3.1.1
  • Development Env: Arduino IDE
  • Operating System: Windows

Settings in IDE

  • Module: Generic ESP8266 Module

Problem Description

When adding the line:
FLASH_MAP_SETUP_CONFIG(FLASH_MAP_MAX_FS)
in my sketch, I get a "multiple definition of `__flashdesc';"

The problem is that the assignment of __flashdesc on line 46 in flash_hal.h does not contain the 'attr' argument passed to the macro. So when the line 75 in flash_hal.cpp:
FLASH_MAP_SETUP_CONFIG_ATTR(__attribute__((weak)), FLASH_MAP_OTA_FS)
assigns __flashdesc to FLASH_MAP_OTA_FS, there is no weak assignment which makes it impossible override in user application.

Work-around until it is solved

Remove line 75 in flash_hal.cpp

Links to similar topics

https://forum.arduino.cc/t/multiple-definition-of-flashdesc-when-using-flash-map-setup-config/1098083/1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions