Skip to content

Remove IAR toolchain support from make build system#3563

Merged
hathach merged 1 commit intomasterfrom
remove-iar-make-support
Apr 6, 2026
Merged

Remove IAR toolchain support from make build system#3563
hathach merged 1 commit intomasterfrom
remove-iar-make-support

Conversation

@hathach
Copy link
Copy Markdown
Owner

@hathach hathach commented Mar 19, 2026

Summary

  • Remove IAR toolchain files (arm_iar.mk, iar_rules.mk) from make build system
  • Remove all SRC_S_IAR and LD_FILE_IAR variables from family.mk and board.mk files
  • Remove IAR toolchain detection (iccarm) from family_support.mk
  • Simplify FreeRTOS portable path to always use GCC
  • Fix GET_SECTOR_COUNT truncation bug in msc_file_explorer (WORD→DWORD cast)
  • Fix broken line formatting in stm32f7/family.c board_uart_write

IAR remains supported via CMake only.

Test plan

  • Make build verified with stm32f407disco and stm32f072disco
  • CMake build verified for multiple boards
  • HIL tests pass on all available boards

🤖 Generated with Claude Code

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 19, 2026

Size Difference Report

Because TinyUSB code size varies by port and configuration, the metrics below represent the averaged totals across all example builds.

Note: If there is no change, only one value is shown.

Changes >1% in size

No entries.

Changes <1% in size

No entries.

No changes
file .text .rodata .data .bss size % diff
audio_device.c 2897 0 1260 1627 4518 +0.0%
cdc_device.c 1252 16 1106 684 1935 +0.0%
cdc_host.c 6381 487 15 985 7579 +0.0%
dcd_ch32_usbfs.c 1473 0 0 2444 3917 +0.0%
dcd_ch32_usbhs.c 1469 0 0 448 1917 +0.0%
dcd_ci_fs.c 1925 0 0 1290 3215 +0.0%
dcd_ci_hs.c 1759 0 0 1344 2538 +0.0%
dcd_da146xx.c 3067 0 0 144 3211 +0.0%
dcd_dwc2.c 4210 25 0 265 4500 +0.0%
dcd_eptri.c 2271 0 0 259 2530 +0.0%
dcd_ft9xx.c 3276 0 0 172 3448 +0.0%
dcd_khci.c 1953 0 0 1290 3243 +0.0%
dcd_lpc17_40.c 1474 0 0 648 1798 +0.0%
dcd_lpc_ip3511.c 1463 0 0 264 1683 +0.0%
dcd_mm32f327x_otg.c 1478 0 0 1290 2768 +0.0%
dcd_msp430x5xx.c 1798 0 0 176 1974 +0.0%
dcd_musb.c 2445 0 0 160 2605 +0.0%
dcd_nrf5x.c 2918 0 0 292 3210 +0.0%
dcd_nuc120.c 1094 0 0 78 1172 +0.0%
dcd_nuc121.c 1168 0 0 101 1269 +0.0%
dcd_nuc505.c 0 0 1531 157 1688 +0.0%
dcd_rp2040.c 838 0 764 655 2257 +0.0%
dcd_rusb2.c 2919 0 0 156 3075 +0.0%
dcd_samd.c 1034 0 0 266 1300 +0.0%
dcd_samg.c 1320 0 0 72 1392 +0.0%
dcd_stm32_fsdev.c 2558 0 0 291 2849 +0.0%
dfu_device.c 777 28 712 140 916 +0.0%
dfu_rt_device.c 157 0 134 0 157 +0.0%
dwc2_common.c 602 30 0 0 618 +0.0%
ecm_rndis_device.c 1037 0 1 2858 3896 +0.0%
ehci.c 2763 0 0 6043 7597 +0.0%
fsdev_common.c 180 0 0 0 180 +0.0%
hcd_ch32_usbfs.c 2485 0 0 498 2983 +0.0%
hcd_ci_hs.c 184 0 0 0 184 +0.0%
hcd_dwc2.c 4994 33 1 513 5540 +0.0%
hcd_khci.c 2442 0 0 449 2891 +0.0%
hcd_musb.c 3073 0 0 157 3230 +0.0%
hcd_pio_usb.c 262 0 240 0 502 +0.0%
hcd_rp2040.c 2000 17 4 321 2342 +0.0%
hcd_rusb2.c 2923 0 0 245 3168 +0.0%
hcd_samd.c 2220 0 0 324 2544 +0.0%
hcd_stm32_fsdev.c 3287 0 1 420 3708 +0.0%
hid_device.c 1125 44 997 119 1244 +0.0%
hid_host.c 1240 0 0 1251 2491 +0.0%
hub.c 1384 8 8 30 1418 +0.0%
midi_device.c 1151 0 1007 623 1772 +0.0%
midi_host.c 1341 7 7 3635 4979 +0.0%
msc_device.c 2525 108 2286 547 3071 +0.0%
msc_host.c 1587 0 0 394 1982 +0.0%
mtp_device.c 1696 22 735 588 2292 +0.0%
ncm_device.c 1538 28 718 5843 7395 +0.0%
ohci.c 1940 0 0 2414 4353 +0.0%
printer_device.c 830 0 706 566 1394 +0.0%
rp2040_usb.c 382 35 625 11 1053 +0.0%
rusb2_common.c 160 0 16 0 176 +0.0%
tusb.c 451 0 383 3 453 +0.0%
tusb_fifo.c 846 0 480 0 841 +0.0%
typec_stm32.c 820 8 2 12 842 +0.0%
usbc.c 420 2 20 166 608 +0.0%
usbd.c 3224 57 88 275 3564 +0.0%
usbd_control.c 538 0 484 79 616 +0.0%
usbh.c 4652 55 99 1034 5807 +0.0%
usbtmc_device.c 2196 24 68 316 2544 +0.0%
vendor_device.c 641 0 534 565 1204 +0.0%
video_device.c 4443 5 1235 479 4914 +0.0%
TOTAL 118956 1039 16267 46476 167060 +0.0%

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 19, 2026

MemBrowse Memory Report

Top 10 targets by memory change (%) (out of 2156 targets) View Project Dashboard →

target .text .rodata .data .bss total % diff
frdm_rw612/msc_file_explorer 40,480 → 40,472 (-8) 40,496 → 40,488 (-8) -0.0%
raspberry_pi_pico/msc_file_explorer 44,056 → 44,048 (-8) 47,960 → 47,952 (-8) -0.0%
hpm6750evk2/msc_file_explorer 48,576 → 48,568 (-8) 48,728 → 48,720 (-8) -0.0%
lpcxpresso1769/msc_file_explorer 32,508 → 32,504 (-4) 32,888 → 32,884 (-4) -0.0%
frdm_kl25z/msc_file_explorer 34,844 → 34,840 (-4) 34,844 → 34,840 (-4) -0.0%
lpcxpresso18s37/msc_file_explorer 34,740 → 34,736 (-4) 35,186 → 35,182 (-4) -0.0%
portenta_c33/msc_file_explorer 35,433 → 35,429 (-4) 35,433 → 35,429 (-4) -0.0%
metro_m7_1011/msc_file_explorer 37,368 → 37,364 (-4) 37,376 → 37,372 (-4) -0.0%
double_m33_express/msc_file_explorer 37,520 → 37,516 (-4) 37,528 → 37,524 (-4) -0.0%
stm32c071nucleo/msc_file_explorer 35,204 → 35,200 (-4) 38,756 → 38,752 (-4) -0.0%

@hathach hathach force-pushed the remove-iar-make-support branch 2 times, most recently from 44c0add to c53dc85 Compare March 20, 2026 04:49
@hathach hathach marked this pull request as ready for review April 5, 2026 12:08
Copilot AI review requested due to automatic review settings April 5, 2026 12:08
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1293317765

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread hw/bsp/stm32f7/family.c

#include "board.h"

#ifdef UART_ID
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Guard STM32F7 UART code with the board macro

The UART implementation is now compiled only when UART_ID is defined, but STM32F7 board headers still define UART_DEV (for example hw/bsp/stm32f7/boards/stm32f746disco/board.h). That means board_init() skips UART setup and board_uart_write()/board_uart_read() fall back to the no-UART stubs for every STM32F7 board, so stdio/log output silently stops working on those targets. Please keep compatibility with UART_DEV (or update all STM32F7 board headers in the same change).

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes IAR toolchain support from the make build system by consolidating toolchain-specific variables into generic ones, deleting IAR make toolchain files, and updating family/board makefiles accordingly. Also includes a small MSC file explorer fix and STM32F7 UART formatting/logic changes.

Changes:

  • Remove IAR make toolchain integration (deleted arm_iar.mk / iar_rules.mk, removed IAR selection paths in make CPU/toolchain logic).
  • Update BSP family/board makefiles to use generic CFLAGS/LDFLAGS/SRC_S/LD_FILE variables (dropping *_GCC and *_IAR variants).
  • Fix MSC GET_SECTOR_COUNT truncation cast and refactor STM32F7 UART handling.

Reviewed changes

Copilot reviewed 143 out of 143 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
hw/bsp/tm4c/family.mk Switch GCC-only linker flags to generic LDFLAGS.
hw/bsp/tm4c/boards/ek_tm4c1294xl/board.mk Replace LD_FILE_GCC/LD_FILE_IAR with unified LD_FILE.
hw/bsp/stm32wba/family.mk Consolidate GCC/IAR flags and startup/linker selection into generic variables.
hw/bsp/stm32wb/family.mk Consolidate GCC/IAR flags and startup/linker selection into generic variables.
hw/bsp/stm32u5/family.mk Consolidate GCC/IAR flags and startup selection; remove IAR linker var.
hw/bsp/stm32u0/family.mk Consolidate GCC/IAR flags and startup selection; remove IAR linker var.
hw/bsp/stm32n6/family.mk Consolidate GCC/IAR flags and startup/linker selection into generic variables.
hw/bsp/stm32n6/boards/stm32n657nucleo/board.mk Replace LD_FILE_GCC with unified LD_FILE.
hw/bsp/stm32n6/boards/stm32n6570dk/board.mk Replace LD_FILE_GCC with unified LD_FILE.
hw/bsp/stm32l4/family.mk Consolidate GCC-only flags into generic CFLAGS/LDFLAGS.
hw/bsp/stm32l4/boards/stm32l4r5nucleo/board.mk Replace GCC/IAR startup+linker vars with unified SRC_S/LD_FILE.
hw/bsp/stm32l4/boards/stm32l4p5nucleo/board.mk Replace GCC/IAR startup+linker vars with unified SRC_S/LD_FILE.
hw/bsp/stm32l4/boards/stm32l496nucleo/board.mk Replace GCC/IAR startup+linker vars with unified SRC_S/LD_FILE.
hw/bsp/stm32l4/boards/stm32l476disco/board.mk Replace GCC/IAR startup+linker vars with unified SRC_S/LD_FILE.
hw/bsp/stm32l4/boards/stm32l412nucleo/board.mk Replace GCC/IAR startup+linker vars with unified SRC_S/LD_FILE.
hw/bsp/stm32l0/family.mk Consolidate GCC/IAR startup selection into generic SRC_S.
hw/bsp/stm32h7rs/family.mk Consolidate GCC/IAR flags and startup/linker selection into generic variables.
hw/bsp/stm32h7/family.mk Consolidate GCC/IAR flags and startup selection into generic variables.
hw/bsp/stm32h7/boards/waveshare_openh743i/board.mk Replace LD_FILE_GCC with unified LD_FILE.
hw/bsp/stm32h7/boards/stm32h750bdk/board.mk Replace LD_FILE_GCC with unified LD_FILE.
hw/bsp/stm32h7/boards/stm32h750_weact/board.mk Replace LD_FILE_GCC with unified LD_FILE.
hw/bsp/stm32h7/boards/stm32h747disco/board.mk Replace GCC/IAR linker vars with unified LD_FILE.
hw/bsp/stm32h7/boards/stm32h745disco/board.mk Replace GCC/IAR linker vars with unified LD_FILE.
hw/bsp/stm32h7/boards/stm32h743nucleo/board.mk Replace LD_FILE_GCC with unified LD_FILE.
hw/bsp/stm32h7/boards/stm32h743eval/board.mk Replace LD_FILE_GCC with unified LD_FILE.
hw/bsp/stm32h7/boards/stm32h723nucleo/board.mk Replace LD_FILE_GCC with unified LD_FILE.
hw/bsp/stm32h7/boards/daisyseed/board.mk Replace LD_FILE_GCC with unified LD_FILE.
hw/bsp/stm32h5/family.mk Consolidate GCC/IAR flags and startup/linker selection into generic variables.
hw/bsp/stm32g4/family.mk Consolidate GCC/IAR flags and startup selection into generic variables.
hw/bsp/stm32g4/boards/stm32g491nucleo/board.mk Replace LD_FILE_GCC with unified LD_FILE.
hw/bsp/stm32g4/boards/stm32g474nucleo/board.mk Replace LD_FILE_GCC with unified LD_FILE.
hw/bsp/stm32g4/boards/b_g474e_dpow1/board.mk Replace LD_FILE_GCC with unified LD_FILE.
hw/bsp/stm32g0/family.mk Consolidate GCC-only flags into generic CFLAGS/LDFLAGS.
hw/bsp/stm32g0/boards/stm32g0b1nucleo/board.mk Replace GCC/IAR startup+linker vars with unified SRC_S/LD_FILE.
hw/bsp/stm32f7/family.mk Consolidate GCC/IAR flags and startup selection into generic variables.
hw/bsp/stm32f7/family.c Refactor UART handling and code formatting; add FIFO-based RX path.
hw/bsp/stm32f7/boards/stm32f769disco/board.mk Replace LD_FILE_GCC with unified LD_FILE.
hw/bsp/stm32f7/boards/stm32f767nucleo/board.mk Replace LD_FILE_GCC with unified LD_FILE.
hw/bsp/stm32f7/boards/stm32f746nucleo/board.mk Replace LD_FILE_GCC with unified LD_FILE.
hw/bsp/stm32f7/boards/stm32f746disco/board.mk Replace LD_FILE_GCC with unified LD_FILE.
hw/bsp/stm32f7/boards/stm32f723disco/board.mk Replace LD_FILE_GCC with unified LD_FILE.
hw/bsp/stm32f7/boards/stlinkv3mini/board.mk Replace LD_FILE_GCC with unified LD_FILE.
hw/bsp/stm32f4/family.mk Consolidate GCC-only flags into generic CFLAGS/LDFLAGS.
hw/bsp/stm32f4/boards/stm32f439nucleo/board.mk Replace GCC/IAR startup+linker vars with unified SRC_S/LD_FILE.
hw/bsp/stm32f4/boards/stm32f412nucleo/board.mk Replace GCC/IAR startup+linker vars with unified SRC_S/LD_FILE.
hw/bsp/stm32f4/boards/stm32f412disco/board.mk Replace GCC/IAR startup+linker vars with unified SRC_S/LD_FILE.
hw/bsp/stm32f4/boards/stm32f411disco/board.mk Replace GCC/IAR startup+linker vars with unified SRC_S/LD_FILE.
hw/bsp/stm32f4/boards/stm32f411blackpill/board.mk Replace GCC/IAR startup+linker vars with unified SRC_S/LD_FILE.
hw/bsp/stm32f4/boards/stm32f407disco/board.mk Replace GCC/IAR startup+linker vars with unified SRC_S/LD_FILE.
hw/bsp/stm32f4/boards/stm32f407blackvet/board.mk Replace GCC/IAR startup+linker vars with unified SRC_S/LD_FILE.
hw/bsp/stm32f4/boards/stm32f401blackpill/board.mk Replace GCC/IAR startup+linker vars with unified SRC_S/LD_FILE.
hw/bsp/stm32f4/boards/pyboardv11/board.mk Replace GCC/IAR startup+linker vars with unified SRC_S/LD_FILE.
hw/bsp/stm32f4/boards/feather_stm32f405/board.mk Replace GCC/IAR startup+linker vars with unified SRC_S/LD_FILE.
hw/bsp/stm32f3/family.mk Consolidate GCC/IAR startup selection into generic SRC_S.
hw/bsp/stm32f2/family.mk Consolidate GCC/IAR startup selection into generic SRC_S.
hw/bsp/stm32f1/family.mk Consolidate GCC/IAR startup selection into generic SRC_S.
hw/bsp/stm32f1/boards/stm32f103ze_iar/board.mk Replace GCC/IAR linker vars with unified LD_FILE.
hw/bsp/stm32f1/boards/stm32f103_mini_2/board.mk Replace GCC/IAR linker vars with unified LD_FILE.
hw/bsp/stm32f1/boards/stm32f103_bluepill/board.mk Replace GCC/IAR linker vars with unified LD_FILE.
hw/bsp/stm32f0/family.mk Consolidate GCC/IAR flags and startup selection into generic variables.
hw/bsp/stm32f0/boards/stm32f072eval/board.mk Replace LD_FILE_GCC with unified LD_FILE.
hw/bsp/stm32f0/boards/stm32f072disco/board.mk Replace LD_FILE_GCC with unified LD_FILE.
hw/bsp/stm32f0/boards/stm32f070rbnucleo/board.mk Replace LD_FILE_GCC with unified LD_FILE.
hw/bsp/stm32c0/family.mk Consolidate GCC-only flags into generic CFLAGS/LDFLAGS.
hw/bsp/stm32c0/boards/stm32c071nucleo/board.mk Replace GCC/IAR startup+linker vars with unified SRC_S/LD_FILE.
hw/bsp/samg/family.mk Switch GCC-only linker flags to generic LDFLAGS.
hw/bsp/same7x/family.mk Switch GCC-only linker flags to generic LDFLAGS.
hw/bsp/samd5x_e5x/family.mk Switch GCC-only linker flags to generic LDFLAGS.
hw/bsp/samd2x_l2x/family.mk Switch GCC-only linker flags to generic LDFLAGS.
hw/bsp/samd11/family.mk Switch GCC-only linker flags to generic LDFLAGS.
hw/bsp/rx/family.mk Switch GCC-only linker flags to generic LDFLAGS.
hw/bsp/rw61x/family.mk Switch GCC-only linker flags to generic LDFLAGS.
hw/bsp/ra/family.mk Consolidate GCC-only flags into generic CFLAGS/LDFLAGS.
hw/bsp/nuc505/family.mk Switch GCC-only linker flags to generic LDFLAGS.
hw/bsp/nuc126/family.mk Switch GCC-only linker flags to generic LDFLAGS.
hw/bsp/nuc121_125/family.mk Switch GCC-only linker flags to generic LDFLAGS.
hw/bsp/nuc100_120/family.mk Switch GCC-only linker flags to generic LDFLAGS.
hw/bsp/nrf/family.mk Consolidate GCC-only flags into generic CFLAGS/LDFLAGS.
hw/bsp/msp432e4/family.mk Switch GCC-only linker flags to generic LDFLAGS.
hw/bsp/mm32/family.mk Switch GCC-only linker flags to generic LDFLAGS.
hw/bsp/mcx/family.mk Switch GCC-only linker flags to generic LDFLAGS.
hw/bsp/maxim/family.mk Consolidate GCC-only flags/startup/linker selection into generic variables.
hw/bsp/lpc55/family.mk Switch GCC-only linker flags to generic LDFLAGS.
hw/bsp/lpc54/family.mk Switch GCC-only linker flags to generic LDFLAGS.
hw/bsp/lpc51/family.mk Switch GCC-only linker flags to generic LDFLAGS.
hw/bsp/lpc43/family.mk Consolidate GCC-only flags into generic CFLAGS/LDFLAGS.
hw/bsp/lpc40/family.mk Consolidate GCC-only flags into generic CFLAGS/LDFLAGS.
hw/bsp/lpc18/family.mk Consolidate GCC-only flags into generic CFLAGS/LDFLAGS.
hw/bsp/lpc17/family.mk Consolidate GCC-only flags into generic CFLAGS/LDFLAGS.
hw/bsp/lpc15/family.mk Consolidate GCC-only flags into generic CFLAGS/LDFLAGS.
hw/bsp/lpc13/family.mk Switch GCC-only linker flags to generic LDFLAGS.
hw/bsp/lpc11/family.mk Switch GCC-only linker flags to generic LDFLAGS.
hw/bsp/kinetis_kl/family.mk Switch GCC-only linker flags to generic LDFLAGS.
hw/bsp/kinetis_k32l/family.mk Switch GCC-only linker flags to generic LDFLAGS.
hw/bsp/kinetis_k32l/boards/frdm_k32l2a4s/board.mk Consolidate GCC-only CFLAGS into generic CFLAGS.
hw/bsp/kinetis_k/family.mk Switch GCC-only linker flags to generic LDFLAGS.
hw/bsp/imxrt/family.mk Switch GCC-only linker flags to generic LDFLAGS.
hw/bsp/hpmicro/family.mk Switch GCC-only linker flags to generic LDFLAGS.
hw/bsp/fomu/family.mk Switch GCC-only linker flags to generic LDFLAGS.
hw/bsp/family_support.mk Remove IAR toolchain detection; force FreeRTOS portable path to GCC; consolidate *_GCC suppressions into generic flags.
hw/bsp/efm32/family.mk Switch GCC-only linker flags to generic LDFLAGS.
hw/bsp/da1469x/family.mk Switch GCC-only linker flags to generic LDFLAGS.
hw/bsp/cxd56/family.mk Switch GCC-only linker flags to generic LDFLAGS.
hw/bsp/ch32v30x/family.mk Switch GCC-only linker flags to generic LDFLAGS.
hw/bsp/ch32v20x/family.mk Switch GCC-only linker flags to generic LDFLAGS.
hw/bsp/ch32v10x/family.mk Switch GCC-only linker flags to generic LDFLAGS.
hw/bsp/broadcom_64bit/family.mk Consolidate GCC-only CFLAGS into generic CFLAGS.
hw/bsp/broadcom_32bit/family.mk Consolidate GCC-only CFLAGS into generic CFLAGS.
hw/bsp/at32f45x/family.mk Consolidate GCC/IAR startup/linker vars into generic SRC_S/LD_FILE and flags into generic vars.
hw/bsp/at32f435_437/family.mk Consolidate GCC/IAR startup/linker vars into generic SRC_S/LD_FILE and flags into generic vars.
hw/bsp/at32f425/family.mk Consolidate GCC/IAR startup/linker vars into generic SRC_S/LD_FILE and flags into generic vars.
hw/bsp/at32f423/family.mk Consolidate GCC/IAR startup/linker vars into generic SRC_S/LD_FILE and flags into generic vars.
hw/bsp/at32f415/family.mk Consolidate GCC/IAR startup/linker vars into generic SRC_S/LD_FILE and flags into generic vars.
hw/bsp/at32f413/family.mk Consolidate GCC/IAR startup/linker vars into generic SRC_S/LD_FILE and flags into generic vars.
hw/bsp/at32f403a_407/family.mk Consolidate GCC/IAR startup/linker vars into generic SRC_S/LD_FILE and flags into generic vars.
hw/bsp/at32f402_405/family.mk Consolidate GCC/IAR startup/linker vars into generic SRC_S/LD_FILE and flags into generic vars.
examples/host/msc_file_explorer/src/msc_app.c Fix GET_SECTOR_COUNT truncation by casting to DWORD.
examples/host/msc_file_explorer/Makefile Move GCC-only warning suppression to generic CFLAGS.
examples/dual/host_info_to_device_cdc/Makefile Move GCC-only warning suppression to generic CFLAGS.
examples/dual/host_hid_to_device_cdc/Makefile Move GCC-only warning suppression to generic CFLAGS.
examples/device/net_lwip_webserver/Makefile Move GCC-only warning suppression to generic CFLAGS.
examples/build_system/make/toolchain/iar_rules.mk Remove IAR-specific build rules (file deleted).
examples/build_system/make/toolchain/gcc_rules.mk Remove legacy *_GCC variable wiring; simplify link flag assembly and LD script selection.
examples/build_system/make/toolchain/arm_iar.mk Remove IAR toolchain definition (file deleted).
examples/build_system/make/cpu/rv32imac-ilp32.mk Remove IAR toolchain branch.
examples/build_system/make/cpu/rv32i-ilp32.mk Remove IAR toolchain branch.
examples/build_system/make/cpu/msp430.mk Remove IAR toolchain branch.
examples/build_system/make/cpu/cortex-m85.mk Remove IAR-specific CPU/FPU flags.
examples/build_system/make/cpu/cortex-m7.mk Remove IAR-specific CPU/FPU flags.
examples/build_system/make/cpu/cortex-m7-fpsp.mk Remove IAR-specific CPU/FPU flags.
examples/build_system/make/cpu/cortex-m55.mk Remove IAR-specific CPU/FPU flags.
examples/build_system/make/cpu/cortex-m4.mk Remove IAR-specific CPU/FPU flags.
examples/build_system/make/cpu/cortex-m4-nofpu.mk Remove IAR-specific CPU/FPU flags.
examples/build_system/make/cpu/cortex-m33.mk Remove IAR-specific CPU/FPU flags.
examples/build_system/make/cpu/cortex-m33-nodsp-nofp.mk Remove IAR-specific CPU flags.
examples/build_system/make/cpu/cortex-m3.mk Remove IAR-specific CPU flags.
examples/build_system/make/cpu/cortex-m23.mk Remove IAR-specific CPU flags.
examples/build_system/make/cpu/cortex-m0plus.mk Remove IAR-specific CPU flags.
examples/build_system/make/cpu/cortex-m0.mk Remove IAR-specific CPU flags.
examples/build_system/make/cpu/cortex-a72.mk Remove IAR-specific CPU flags.
examples/build_system/make/cpu/cortex-a53.mk Remove IAR-specific CPU flags.
examples/build_system/make/cpu/arm926ej-s.mk Remove IAR-specific commented flags.
examples/build_system/make/cpu/arm1176jzf-s.mk Remove IAR-specific commented flags.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread hw/bsp/stm32f7/family.c
Comment on lines +45 to +67
#ifdef UART_ID
#if UART_ID == 1
#define USARTn USART1
#define USARTn_IRQn USART1_IRQn
#define USARTn_IRQHandler USART1_IRQHandler
#define UARTn_CLK_ENABLE __HAL_RCC_USART1_CLK_ENABLE
#elif UART_ID == 2
#define USARTn USART2
#define USARTn_IRQn USART2_IRQn
#define USARTn_IRQHandler USART2_IRQHandler
#define UARTn_CLK_ENABLE __HAL_RCC_USART2_CLK_ENABLE
#elif UART_ID == 3
#define USARTn USART3
#define USARTn_IRQn USART3_IRQn
#define USARTn_IRQHandler USART3_IRQHandler
#define UARTn_CLK_ENABLE __HAL_RCC_USART3_CLK_ENABLE
#elif UART_ID == 6
#define USARTn USART6
#define USARTn_IRQn USART6_IRQn
#define USARTn_IRQHandler USART6_IRQHandler
#define UARTn_CLK_ENABLE __HAL_RCC_USART6_CLK_ENABLE
#endif
#endif
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

family.c switched UART enable path from UART_DEV (as provided by STM32F7 board headers) to a new UART_ID macro, but none of the STM32F7 board headers define UART_ID (they define UART_DEV/UART_CLK_EN). As a result, UART initialization and the IRQ handler are compiled out and UART logging/IO silently stops working on existing STM32F7 boards. Consider reverting to UART_DEV (or supporting both macros), or updating all STM32F7 board headers/build flags to define UART_ID consistently.

Copilot uses AI. Check for mistakes.
Comment thread hw/bsp/stm32f7/family.c
Comment on lines 334 to 361
int board_uart_read(uint8_t *buf, int len) {
#ifdef UART_DEV
int count = 0;
// clear overrun error if any
if (__HAL_UART_GET_FLAG(&UartHandle, UART_FLAG_ORE)) {
__HAL_UART_CLEAR_FLAG(&UartHandle, UART_CLEAR_OREF);
}
for (int i = 0; i < len; i++) {
if (__HAL_UART_GET_FLAG(&UartHandle, UART_FLAG_RXNE)) {
buf[i] = (uint8_t) UartHandle.Instance->RDR;
#ifdef UART_ID
return (int)tu_fifo_read_n(&uart_rx_ff, buf, (uint16_t)len);
#else
(void)buf;
(void)len;
return 0;
#endif
}

int board_uart_write(const void *buf, int len) {
#ifdef UART_ID
const uint8_t *p = (const uint8_t *)buf;
int count = 0;
while (count < len) {
if (__HAL_UART_GET_FLAG(&UartHandle, UART_FLAG_TXE)) {
UartHandle.Instance->TDR = p[count];
count++;
} else {
break;
}
}
return count;
#else
(void) buf; (void) len;
(void)buf;
(void)len;
return 0;
#endif
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With UART_ID undefined for STM32F7 boards, board_uart_read()/board_uart_write() now always return 0 even when the board provides UART_DEV. This is a behavioral regression compared to the previous HAL_UART_Transmit()-based implementation and will break UART-based logging. Align the UART feature-guard with the board contract (e.g., #ifdef UART_DEV) or ensure UART_ID is provided for all boards that expect UART.

Copilot uses AI. Check for mistakes.
Comment thread hw/bsp/stm32f7/family.mk
Comment on lines +59 to 67
CFLAGS += \
-flto \

# mcu driver cause following warnings
CFLAGS_GCC += -Wno-error=cast-align
CFLAGS += -Wno-error=cast-align

LDFLAGS_GCC += \
LDFLAGS += \
-nostdlib -nostartfiles \
--specs=nosys.specs --specs=nano.specs
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--specs=nosys.specs/--specs=nano.specs are GCC driver options; moving them into unconditional LDFLAGS means they will also be passed when building with the make arm_clang toolchain (examples/build_system/make/toolchain/arm_clang.mk), where clang typically rejects --specs. To keep clang builds working, gate these flags behind ifeq ($(TOOLCHAIN),gcc) (or move them into the GCC toolchain makefile) and provide a clang-compatible alternative if needed.

Copilot uses AI. Check for mistakes.
Comment on lines +10 to 11
CFLAGS += -MD

Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-MD is already added in examples/build_system/make/toolchain/gcc_common.mk (CFLAGS baseline). Adding it again here is redundant and makes it harder to reason about the final flag set. Consider removing this extra CFLAGS += -MD line and rely on gcc_common.mk for dependency generation.

Suggested change
CFLAGS += -MD

Copilot uses AI. Check for mistakes.
IAR is only supported with CMake. Remove all IAR-specific references
from the Make build system including toolchain files, SRC_S_IAR,
LD_FILE_IAR variables, and IAR toolchain detection.

Also fix GET_SECTOR_COUNT truncation in msc_file_explorer and
broken formatting in stm32f7 board_uart_write.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@hathach hathach force-pushed the remove-iar-make-support branch from 1293317 to 4c7a9fe Compare April 6, 2026 04:17
@hathach hathach merged commit 7c3f597 into master Apr 6, 2026
310 of 311 checks passed
@hathach hathach deleted the remove-iar-make-support branch April 6, 2026 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants