Build Compile Warning - PICO_FLASH_SIZE_BYTES redefined when setting this value in a board definition file. #134

Closed
opened 2021-02-15 14:57:25 -06:00 by ghost · 2 comments
ghost commented 2021-02-15 14:57:25 -06:00 (Migrated from github.com)

Our rp2040 boards have 16MB on-board Flash, and we are defining this value in the board definition include file via the PICO_FLASH_SIZE_BYTES macro.
i.e:
// board has 16M onboard flash
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)

But when building a project, this board definition conflicts the value being set in:
../src/rp2040/hardware/regs/platform_defs.h

The pre-processor spits out a warning: "note: this is the location of the previous definition"

Which has the value set to:
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024)
#endif

This seems like a bug, OR we're using this #define incorrectly in our board definition.

Note - not a critical issue - everything still works, just an annoying message during project build.

Our rp2040 boards have 16MB on-board Flash, and we are defining this value in the board definition include file via the PICO_FLASH_SIZE_BYTES macro. i.e: // board has 16M onboard flash #define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024) But when building a project, this board definition conflicts the value being set in: ../src/rp2040/hardware/regs/platform_defs.h The pre-processor spits out a warning: "note: this is the location of the previous definition" Which has the value set to: #ifndef PICO_FLASH_SIZE_BYTES #define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024) #endif This seems like a bug, OR we're using this #define incorrectly in our board definition. Note - not a critical issue - everything still works, just an annoying message during project build.
kilograham commented 2021-02-15 15:23:06 -06:00 (Migrated from github.com)

yes that is a bug; it should not be set before the user/board configuration includes!

yes that is a bug; it should not be set before the user/board configuration includes!
lurch commented 2021-03-03 06:06:38 -06:00 (Migrated from github.com)

Fixed in #159 , so this issue can be closed.

Fixed in #159 , so this issue can be closed.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-raspberrypi/pico-sdk#134
No description provided.