Skip to content

Conversation

multiplemonomials
Copy link
Collaborator

@multiplemonomials multiplemonomials commented Aug 25, 2025

Summary of changes

I noticed while doing other testing that code did not run on the Apollo3 when Mbed was configured in Release mode (worked fine in Develop). After a bit of digging, I realized that this was happening because some of the am3 HAL calls weren't being executed. This, in turn, was happening because they were wrapped in MBED_ASSERT() expressions, and everything inside MBED_ASSERT is compiled out in Release mode. Apparently the people who developed the HAL layer for this target (including me 😢 ) didn't realize this.

To fix this, I added a new macro called MBED_CHECK_AM_HAL_CALL which performs a similar function to the asserts, but always evaluates its arguments. Then I used a regex to replace all of the assert calls with this macro.

Impact of changes

  • Code now runs on Apollo3 in Release mode.

Migration actions required

Documentation

None


Pull request type

[X] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[] Covered by existing mbed-os tests (Greentea or Unittest)
[X] Tests / results supplied as part of this PR

Now able to execute code in Release profile!


@multiplemonomials multiplemonomials merged commit 0c2a163 into master Aug 26, 2025
52 checks passed
@multiplemonomials multiplemonomials deleted the feature/apollo3-fix-release-mode branch August 26, 2025 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants