Skip to content

fix(mbedtls): 修复 TLS 编译告警并隔离 include(esp32p4) - #126

Closed
ez-xu wants to merge 7 commits into
open-vela:dev-ai-contest-2026from
ez-xu:contest-psram-fix
Closed

ez-xu wants to merge 7 commits into
open-vela:dev-ai-contest-2026from
ez-xu:contest-psram-fix

Conversation

@ez-xu

@ez-xu ez-xu commented Sep 7, 2026

Copy link
Copy Markdown

Summary

修复 mbedTLS 在 esp32p4(openvela dev-ai-contest-2026)上的编译告警与 include 冲突,使 TLS(ai_agent → MiMo API)可正常构建。

Features

  • mbedtls_config.h:DES/MD5/SHA1 等裁剪后未定义的可选宏改为按 CONFIG_MBEDTLS_* 条件定义,消除 -Wundef -Werror 构建失败
  • CMakeLists.txt:不再向全局 NUTTX_INCLUDE_DIRECTORIES 注入 mbedtls include 目录——避免泄漏到每个 arch 编译单元(如 esp-hal bootloader_sha.c)与 ESP-HAL 自带 mbedtls 副本冲突(MBEDTLS_PRIVATE redefined / check_config 失败);mbedtls 库自身编译加 -Wno-undef
  • Kconfig:补充 DES/MD5 等裁剪配置项

Files

文件 说明
crypto/mbedtls/CMakeLists.txt include 隔离 + -Wno-undef
crypto/mbedtls/Kconfig 补充裁剪配置项
crypto/mbedtls/include/mbedtls/mbedtls_config.h DES/MD5/SHA1 条件编译保护

Testing

  • esp32p4-function-ev-board nsh 配置完整构建通过(含 mbedtls + esp-hal + ai_agent)
  • 未改变任何 mbedtls 运行时行为(纯编译期修复)

openvela-robot and others added 7 commits May 11, 2026 14:54
Sync from GitHub for branch consistency. Gitee does not enforce CODEOWNERS.
The Check workflow was inherited from apache/nuttx-apps with hardcoded
repository references to apache/nuttx and apache/nuttx-apps. The
original intent was to align with upstream check rules, but since
open-vela has diverged and not kept in sync, the base.sha in every PR
refers to a commit that does not exist in apache repos, causing
'fatal: Invalid revision range' (exit 128).

Fix by pointing nuttx checkout to open-vela/nuttx and removing the
hardcoded repository for apps (defaults to current repo).

Signed-off-by: zhangning21 <zhangning21@xiaomi.com>
Override .github / .gitee directory contents with the version from
dev-backup-20260509 branch to fix incorrect content. The contest-specific
.github/CODEOWNERS on dev-ai-contest-2026 is preserved.

Source: open-vela/nuttx-apps@dev-backup-20260509
Append @open-vela/openvela-reviewer so the team can review PRs.
apps/graphics/lvgl/CMakeLists.txt collects LVGL sources with
GLOB_RECURSE over ${LVGL_DIR}/src/*.[Sc,cpp], which unconditionally
picks up every hardware-accelerated draw backend and every arch-specific
asm file, regardless of whether the current target actually enables or
supports them.

Concretely this breaks non-ARMv7 builds:

  * src/draw/sw/blend/neon/lv_blend_neon.S is ARMv7 (AArch32) assembly.
    It uses r0-r15 register names, cpsr, and 'pop {r4-r11, pc}', none
    of which exist in the AArch64 assembler. Building goldfish-arm64
    (or any non-ARMv7 target) fails with:
      Error: expected a register or register list at operand 1
      Error: unknown mnemonic 'pop' -- 'pop {r4-r11,pc}'

  * src/draw/sunxi_g2d/*.c include <g2d_driver.h> and <hal_cache.h>,
    which only exist in the Allwinner BSP. On goldfish, qemu, sim,
    STM32, etc. the build fails with:
      fatal error: g2d_driver.h: No such file or directory

  * src/draw/vg_lite/*, src/draw/nxp/vglite/*, src/draw/nxp/pxp/*
    have similar issues on platforms that don't provide the underlying
    GPU driver headers.

Filter the SRCS list after the GLOB so that arch-specific asm is only
compiled for ARMv7/M/R/8M/8R, and hardware-accelerated draw backends
are only compiled when the corresponding LV_USE_DRAW_* Kconfig option
is enabled. LV_DRAW_SW_ASM_NEON already selects the correct ARM subset
via Kconfig, and the LV_USE_DRAW_G2D / LV_USE_DRAW_VG_LITE / LV_USE_DRAW_VGLITE
switches are already used elsewhere in this file (target_include_directories,
target_link_libraries).

Signed-off-by: v-yanxingyu <v-yanxingyu@xiaomi.com>
- mbedtls_config.h: DES/MD5/SHA1 等按 CONFIG 条件编译(防 -Wundef)
- CMakeLists.txt: 不向全局注入 mbedtls include(防与 esp-hal 冲突),
  库自身加 -Wno-undef
- Kconfig: 补充对应裁剪配置项
@ez-xu
ez-xu requested review from a team as code owners September 7, 2026 01:52
@ez-xu

ez-xu commented Sep 7, 2026

Copy link
Copy Markdown
Author

改动已改为并入作品仓 contest2026_342_ezdezhandui 统一提交(PR: open-vela/contest2026_342_ezdezhandui#6),不再走 nuttx-apps 上游 PR 路线,故关闭本 PR。

@ez-xu ez-xu closed this Sep 7, 2026
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.

5 participants