Repository navigation
Build SITL and RP2350 with their flash size, and fail the build when a target has none - #12282
sensei-hacker wants to merge 1 commit into
Conversation
…a target has none common.h turns features on and off by MCU_FLASH_SIZE. SITL defined it in target.h, which platform.h includes after common.h, and RP2350 only had an unused TARGET_FLASH_SIZE. The preprocessor reads an undefined macro as 0, so both were built as 512 KB boards: SITL had no CLI help text, 34 channels, MAVLink or auto transition. cmake now passes MCU_FLASH_SIZE for SITL (2048) and RP2350 (4096), as it does for every other MCU, and common.h stops the build if a target has none. The unit tests keep the 512 KB feature set they were built with. With the flash size right, SITL and RP2350 get USE_HOTT_TEXTMODE but not HoTT telemetry, which text mode is part of; HoTT text mode is now dropped for any target without HoTT telemetry.
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
PR Summary by QodoBuild SITL and RP2350 with their flash size; fail build when missing
AI Description
Merge Risk
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can start a comment with 'qodo' or '@qodo' to chat about any finding |
This is the maintenance-10.x version of #12281 (release/9.1). It also fixes RP2350.
Problem
target/common.hturns features on and off with#if (MCU_FLASH_SIZE > 512)and#if (MCU_FLASH_SIZE <= 512). Two targets on this branch don't defineMCU_FLASH_SIZEin time:MCU_FLASH_SIZE 2048intarget.h, butplatform.hincludestarget/common.hfirst, so the define comes too late.TARGET_FLASH_SIZE 4096, which nothing reads.The preprocessor treats an undefined macro as 0, so both have been built as 512 KB boards, with no warning.
target.halready re-enables mixer profiles, geozones and MAVLink by hand, which are workarounds for this same problem.Changes
MCU_FLASH_SIZEfor SITL (2048) and RP2350 (4096), the same way it does for every STM32 and AT32 MCU. The two definitions that had no effect are removed fromtarget.h.target/common.h: now fails with#errorwhenMCU_FLASH_SIZEis not defined, so a target can no longer be built as a 512 KB board by accident.target/common_post.h: turns offUSE_HOTT_TEXTMODEon any target withoutUSE_TELEMETRY_HOTT, because text mode is part of HoTT telemetry. SITL and RP2350 both turn off HoTT telemetry, so once they had their real flash size they got text mode without it, and the link failed.src/test/unit/platform.hdefinesMCU_FLASH_SIZE 512. That keeps the feature set the unit tests were already built with.RP2350 reviewers: this turns on the >512 KB feature set for RP2350. The build uses about 135 KB of the 520 KB RAM (
.data+.bss) and about 600 KB of the 4 MB flash.MAX_MIXER_PROFILE_COUNTgoes from 1 to 2, which changes the mixer profile parameter group, so settings saved on an RP2350 board may be reset to defaults after updating.Testing
make checkpasses 635 of 635.helpnow prints each command's description, for exampleaux - configure modes. The build without this change prints only the command names.target/common.hwithoutMCU_FLASH_SIZEstops at the new#error.