Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mbed-os-to-arduino-macos build failure #1005

Open
dirkvdb opened this issue Dec 21, 2024 · 3 comments
Open

mbed-os-to-arduino-macos build failure #1005

dirkvdb opened this issue Dec 21, 2024 · 3 comments

Comments

@dirkvdb
Copy link

dirkvdb commented Dec 21, 2024

I'm trying to build the code because I modified my board configuration to support more sockets.
The build fails however, any ideas what can be the cause of this? I'm using the gcc-arm-embedded toolchain from homebrew

bash-5.2$ cd ~/.platformio/packages/framework-arduino-mbed/ && bash ./mbed-os-to-arduino-macos -r ~/Projects/mbed-os -a OPTA:OPTA

MBED_CLEAN=0
MBED_UPDATE=0
APPLY_PATCHES=1
RESTORE_GDB_INFO=0
LOCAL_REPO=/Users/dirk/Projects/mbed-os
REMOTE_BRANCH=
MBED_CORE_LOCATION=/Users/dirk/.platformio/packages/framework-arduino-mbed

VARIANT=OPTA BOARD=OPTA
Checking for prerequisites... done.
Creating MbedOS Application... done.
Checking out preferred 'mbed-os' version... Linking local repo /Users/dirk/Projects/mbed-os... done.
Setting up Mbed Application...[mbed] Working path "/private/tmp/mbed-os-program" (program)
[mbed] OPTA now set as default target in program "mbed-os-program"
[mbed] Working path "/private/tmp/mbed-os-program" (program)
[mbed] GCC_ARM now set as default toolchain in program "mbed-os-program"
 done.
Applying patches... done.
Compiling Mbed Application...Compile [  0.1%]: RTX_Config.c
Compile [  0.2%]: irq_cm4f.S
Compile [  0.3%]: cmsis_os1.c
Compile [  0.4%]: rtx_delay.c
Compile [  0.5%]: rtx_lib.c
Compile [  0.7%]: rtx_evr.c
Compile [  0.8%]: rtx_evflags.c
Compile [  0.9%]: rtx_memory.c
Compile [  1.0%]: rtx_kernel.c
Compile [  1.1%]: rtx_mempool.c
Compile [  1.2%]: rtx_mutex.c
Compile [  1.3%]: rtx_msgqueue.c
Compile [  1.4%]: rtx_system.c
Compile [  1.5%]: rtx_semaphore.c
Compile [  1.6%]: os_systick.c
Compile [  1.8%]: mbed_tz_context.c
Compile [  1.9%]: rtx_timer.c
Compile [  2.0%]: rtx_thread.c
Compile [  2.1%]: os_tick_ptim.c
Compile [  2.2%]: mbed_boot_gcc_arm.c
Compile [  2.3%]: mbed_rtos_rtx.c
Compile [  2.4%]: hci_core.c
Compile [  2.5%]: mbed_boot.c
Compile [  2.6%]: main.cpp
Compile [  2.7%]: hci_cmd_bis.c
Compile [  2.9%]: hci_cmd.c
Compile [  3.0%]: hci_cmd_cis.c
Compile [  3.1%]: hci_cmd_ae.c
Compile [  3.2%]: hci_cmd_cte.c
Compile [  3.3%]: mbed_rtx_handlers.c
Compile [  3.4%]: hci_cmd_phy.c
Compile [  3.5%]: hci_cmd_past.c
Compile [  3.6%]: hci_cmd_iso.c
Compile [  3.7%]: hci_vs_ae.c
Compile [  3.8%]: hci_core_ps.c
Compile [  4.0%]: sec_aes.c
Compile [  4.1%]: sec_aes_rev.c
Compile [  4.2%]: sec_ecc_debug.c
Compile [  4.3%]: sec_cmac_hci.c
Compile [  4.4%]: sec_ccm_hci.c
Compile [  4.5%]: sec_ecc_hci.c
Compile [  4.6%]: hci_evt.c
Compile [  4.7%]: sec_main.c
Compile [  4.8%]: att_uuid.c
Compile [  4.9%]: att_main.c
Compile [  5.1%]: att_eatt.c
Compile [  5.2%]: attc_eatt.c
Compile [  5.3%]: attc_disc.c
Compile [  5.4%]: mbed_rtx_idle.cpp
Compile [  5.5%]: attc_main.c
Compile [  5.6%]: attc_read.c
Compile [  5.7%]: attc_proc.c
Compile [  5.8%]: attc_sign.c
Compile [  5.9%]: attc_write.c
Compile [  6.0%]: atts_ccc.c
Compile [  6.2%]: atts_csf.c
Compile [  6.3%]: atts_dyn.c
Compile [  6.4%]: atts_eatt.c
Compile [  6.5%]: atts_ind.c
Compile [  6.6%]: atts_main.c
Compile [  6.7%]: atts_sign.c
Compile [  6.8%]: cfg_stack.c
Compile [  6.9%]: atts_proc.c
Compile [  7.0%]: atts_write.c
Compile [  7.1%]: atts_read.c
Compile [  7.3%]: dm_adv.c
Compile [  7.4%]: dm_adv_leg.c
Compile [  7.5%]: dm_bis_master.c
Compile [  7.6%]: dm_bis_slave.c
Compile [  7.7%]: dm_cis.c
Compile [  7.8%]: dm_cis_slave.c
Compile [  7.9%]: dm_cis_sm.c
Compile [  8.0%]: dm_adv_ae.c
Compile [  8.1%]: dm_cis_master.c
Compile [  8.2%]: dm_conn_master.c
Compile [  8.4%]: dm_conn_master_ae.c
Compile [  8.5%]: dm_conn_master_leg.c
Compile [  8.6%]: dm_conn_cte.c
Compile [  8.7%]: dm_conn_slave_ae.c
Compile [  8.8%]: dm_conn_slave.c
Compile [  8.9%]: dm_conn_slave_leg.c
Compile [  9.0%]: dm_conn_sm.c
Compile [  9.1%]: dm_dev.c
Compile [  9.2%]: dm_conn.c
Compile [  9.3%]: dm_main.c
Compile [  9.5%]: dm_dev_priv.c
Compile [  9.6%]: dm_iso.c
Compile [  9.7%]: dm_phy.c
Compile [  9.8%]: dm_past.c
Compile [  9.9%]: dm_scan.c
Compile [ 10.0%]: dm_priv.c
Compile [ 10.1%]: dm_scan_leg.c
Compile [ 10.2%]: dm_scan_ae.c
Compile [ 10.3%]: dm_sec_lesc.c
Compile [ 10.4%]: dm_sec.c
Compile [ 10.5%]: dm_sec_slave.c
Compile [ 10.7%]: hci_main.c
Compile [ 10.8%]: dm_sec_master.c
Compile [ 10.9%]: l2c_main.c
Compile [ 11.0%]: l2c_master.c
Compile [ 11.1%]: dm_sync_ae.c
Compile [ 11.2%]: l2c_slave.c
Compile [ 11.3%]: smp_act.c
Compile [ 11.4%]: smp_db.c
Compile [ 11.5%]: smp_non.c
Compile [ 11.6%]: smp_main.c
Compile [ 11.8%]: smp_sc_act.c
Compile [ 11.9%]: smpi_sc_sm.c
Compile [ 12.0%]: smpi_act.c
Compile [ 12.1%]: smp_sc_main.c
Compile [ 12.2%]: smpi_sc_act.c
Compile [ 12.3%]: l2c_coc.c
Compile [ 12.4%]: smpi_sm.c
Compile [ 12.5%]: smpr_sm.c
Compile [ 12.6%]: smpr_sc_sm.c
Compile [ 12.7%]: wsf_assert.c
Compile [ 12.9%]: wsf_detoken.c
Compile [ 13.0%]: smpr_act.c
Compile [ 13.1%]: wsf_buf.c
Compile [ 13.2%]: smpr_sc_act.c
Compile [ 13.3%]: wsf_heap.c
Compile [ 13.4%]: wsf_bufio.c
Compile [ 13.5%]: wsf_msg.c
Compile [ 13.6%]: wsf_queue.c
Compile [ 13.7%]: wsf_trace.c
Compile [ 13.8%]: wsf_timer.c
Compile [ 14.0%]: bstream.c
Compile [ 14.1%]: wsf_efs.c
Compile [ 14.2%]: bda.c
Compile [ 14.3%]: crc32.c
Compile [ 14.4%]: calc128.c
Compile [ 14.5%]: fcs.c
Compile [ 14.6%]: prand.c
Compile [ 14.7%]: print.c
Compile [ 14.8%]: wstr.c
Compile [ 14.9%]: terminal.c
Compile [ 15.1%]: BLE.cpp
Compile [ 15.2%]: GattServer.cpp
Compile [ 15.3%]: GattClient.cpp
Compile [ 15.4%]: ble_trace_helpers.cpp
Compile [ 15.5%]: SecurityManager.cpp
Compile [ 15.6%]: Gap.cpp
Compile [ 15.7%]: CordioHCIDriver.cpp
Compile [ 15.8%]: CordioHCITransportDriver.cpp
Compile [ 15.9%]: H4TransportDriver.cpp
Compile [ 16.0%]: PalEventQueueImpl.cpp
Compile [ 16.2%]: BLEInstanceBaseImpl.cpp
Compile [ 16.3%]: PalGenericAccessServiceImpl.cpp
Compile [ 16.4%]: PalGapImpl.cpp
Compile [ 16.5%]: hci_tr.c
Compile [ 16.6%]: mbed_wsf_trace.c
Compile [ 16.7%]: hci_vs.c
Compile [ 16.8%]: wsf_cs.c
Compile [ 16.9%]: wsf_mbed_os_adaptation.c
Compile [ 17.0%]: PalAttClientImpl.cpp
Compile [ 17.1%]: wsf_os.c
Compile [ 17.3%]: GattServerImpl.cpp
Compile [ 17.4%]: PalPrivateAddressControllerImpl.cpp
Compile [ 17.5%]: pal_mbed_os_adaptation.cpp
Compile [ 17.6%]: PalSecurityManagerImpl.cpp
Compile [ 17.7%]: AdvertisingParameters.cpp
Compile [ 17.8%]: AdvertisingDataBuilder.cpp
Compile [ 17.9%]: KVStoreSecurityDb.cpp
Compile [ 18.0%]: ConnectionParameters.cpp
Compile [ 18.1%]: DiscoveredCharacteristic.cpp
Compile [ 18.2%]: FileSecurityDb.cpp
Compile [ 18.4%]: MemorySecurityDb.cpp
Compile [ 18.5%]: SecurityDb.cpp
Compile [ 18.6%]: GattClientImpl.cpp
Compile [ 18.7%]: PrivateAddressController.cpp
Compile [ 18.8%]: PalAttClientToGattClient.cpp
Compile [ 18.9%]: GapImpl.cpp
Compile [ 19.0%]: AT_CellularSMS.cpp
Compile [ 19.1%]: SecurityManagerImpl.cpp
Compile [ 19.2%]: AT_CellularDevice.cpp
Compile [ 19.3%]: APN_db.cpp
Compile [ 19.5%]: AT_CellularContext.cpp
Compile [ 19.6%]: CellularLog.cpp
Compile [ 19.7%]: AT_CellularInformation.cpp
Compile [ 19.8%]: CellularUtil.cpp
Compile [ 19.9%]: AT_CellularNetwork.cpp
Compile [ 20.0%]: AT_CellularStack.cpp
Compile [ 20.1%]: NanostackRfPhyAT86RF215.cpp
Compile [ 20.2%]: NanostackRfPhyAtmel.cpp
Compile [ 20.3%]: AT_ControlPlane_netif.cpp
Compile [ 20.4%]: MCR20Drv.c
Compile [ 20.5%]: NanostackRfPhyMcr20a.cpp
Compile [ 20.7%]: NanostackRfPhys2lp.cpp
Compile [ 20.8%]: CellularContext.cpp
Compile [ 20.9%]: rf_configuration.c
Compile [ 21.0%]: at24mac_s2lp.cpp
Compile [ 21.1%]: CellularDevice.cpp
Compile [ 21.2%]: ATHandler.cpp
Compile [ 21.3%]: CellularStateMachine.cpp
Compile [ 21.4%]: at24mac.cpp
Compile [ 21.5%]: CyH4TransportDriver.cpp
Compile [ 21.6%]: HCIDriver.cpp
Compile [ 21.8%]: ALT1250_PPP.cpp
Compile [ 21.9%]: ALT1250_PPP_CellularContext.cpp
Compile [ 22.0%]: ALT1250_PPP_CellularNetwork.cpp
Compile [ 22.1%]: GEMALTO_CINTERION.cpp
Compile [ 22.2%]: GEMALTO_CINTERION_CellularContext.cpp
Compile [ 22.3%]: GEMALTO_CINTERION_CellularInformation.cpp
Compile [ 22.4%]: GEMALTO_CINTERION_CellularNetwork.cpp
Compile [ 22.5%]: GEMALTO_CINTERION_CellularStack.cpp
Compile [ 22.6%]: GENERIC_AT3GPP.cpp
Compile [ 22.7%]: SARA4_PPP.cpp
Compile [ 22.9%]: SARA4_PPP_CellularNetwork.cpp
Compile [ 23.0%]: QUECTEL_BC95.cpp
Compile [ 23.1%]: QUECTEL_BC95_CellularContext.cpp
Compile [ 23.2%]: QUECTEL_BC95_CellularInformation.cpp
Compile [ 23.3%]: QUECTEL_BC95_CellularNetwork.cpp
Compile [ 23.4%]: QUECTEL_BC95_CellularStack.cpp
Compile [ 23.5%]: QUECTEL_BG96_CellularInformation.cpp
Compile [ 23.6%]: QUECTEL_BG96.cpp
Compile [ 23.7%]: QUECTEL_BG96_CellularContext.cpp
Compile [ 23.8%]: QUECTEL_BG96_CellularNetwork.cpp
Compile [ 24.0%]: QUECTEL_BG96_ControlPlane_netif.cpp
Compile [ 24.1%]: QUECTEL_BG96_CellularStack.cpp
Compile [ 24.2%]: QUECTEL_EC2X.cpp
Compile [ 24.3%]: QUECTEL_M26_CellularContext.cpp
Compile [ 24.4%]: QUECTEL_M26.cpp
Compile [ 24.5%]: QUECTEL_M26_CellularInformation.cpp
Compile [ 24.6%]: QUECTEL_UG96.cpp
Compile [ 24.7%]: QUECTEL_M26_CellularStack.cpp
Compile [ 24.8%]: QUECTEL_UG96_CellularContext.cpp
Compile [ 24.9%]: RM1000_AT.cpp
Compile [ 25.1%]: RM1000_AT_CellularContext.cpp
Compile [ 25.2%]: RM1000_AT_CellularNetwork.cpp
Compile [ 25.3%]: TELIT_HE910.cpp
Compile [ 25.4%]: RM1000_AT_CellularStack.cpp
Compile [ 25.5%]: TELIT_ME310_CellularNetwork.cpp
Compile [ 25.6%]: TELIT_ME310_CellularContext.cpp
Compile [ 25.7%]: TELIT_ME310.cpp
Compile [ 25.8%]: TELIT_ME910_CellularContext.cpp
Compile [ 25.9%]: TELIT_ME910.cpp
Compile [ 26.0%]: TELIT_ME310_CellularStack.cpp
Compile [ 26.2%]: TELIT_ME910_CellularNetwork.cpp
Compile [ 26.3%]: UBLOX_AT.cpp
Compile [ 26.4%]: UBLOX_AT_CellularContext.cpp
Compile [ 26.5%]: UBLOX_N2XX_CellularSMS.cpp
Compile [ 26.6%]: UBLOX_AT_CellularNetwork.cpp
Compile [ 26.7%]: UBLOX_N2XX.cpp
Compile [ 26.8%]: UBLOX_AT_CellularStack.cpp
Compile [ 26.9%]: WhdAccessPoint.cpp
Compile [ 27.0%]: UBLOX_N2XX_CellularNetwork.cpp
Compile [ 27.1%]: UBLOX_N2XX_CellularContext.cpp
Compile [ 27.3%]: UBLOX_N2XX_CellularStack.cpp
Compile [ 27.4%]: UBLOX_PPP.cpp
Compile [ 27.5%]: CyDhcpServer.cpp
Compile [ 27.6%]: cynetwork_utils.c
Compile [ 27.7%]: stm32h7_eth_init.c
[mbed] ERROR: "/Users/dirk/Projects/mbed_env/.pixi/envs/default/bin/python3.13" returned error.
       Code: 1
       Path: "/private/tmp/mbed-os-program"
       Command: "/Users/dirk/Projects/mbed_env/.pixi/envs/default/bin/python3.13 -u /private/tmp/mbed-os-program/mbed-os/tools/make.py -t GCC_ARM -m OPTA --source . --build ./BUILD/OPTA/GCC_ARM -v"
---
 done.
Generating defines... done.
Generating includes... copying to destination... /tmp/mbed-os-program
 done.
Generating libs..../mbed-os-to-arduino-macos: line 274: ./BUILD/OPTA/GCC_ARM/.link_options.txt: No such file or directory
gcp: cannot stat './BUILD/mbed-core-OPTA.a': No such file or directory

This is the output of /Users/dirk/Projects/mbed_env/.pixi/envs/default/bin/python3.13 -u /private/tmp/mbed-os-program/mbed-os/tools/make.py -t GCC_ARM -m OPTA --source . --build ./BUILD/OPTA/GCC_ARM -v

/Users/dirk/Projects/mbed_env/.pixi/envs/default/bin/python3.13 -u /private/tmp/mbed-os-program/mbed-os/tools/make.py -t GCC_ARM -m OPTA --source . --build ./BUILD/OPTA/GCC_ARM -v
[Warning] @,: Compiler version mismatch: Have 14.2.1; expected version >= 9.0.0 and < 10.0.0
Building project framework-arduino-mbed (OPTA, GCC_ARM)
Scan: framework-arduino-mbed
Using ROM region application in this build.
  Region application: size 0x200000, offset 0x8000000
Using RAM region application_ram in this build.
  Region application_ram: size 0x80000, offset 0x24000000
No Linker Script found

Could not compile for OPTA: No Linker Script found
@pennam
Copy link
Contributor

pennam commented Dec 23, 2024

Hi @dirkvdb if you move to /tmp/mbed-os-program and type mbed compile you should get a more detailed error

@dirkvdb
Copy link
Author

dirkvdb commented Dec 23, 2024

This is the output of mbed compile in /tmp/mbed-os-program

(mbed_env) bash-5.2$ mbed compile
[mbed] Working path "/private/tmp/mbed-os-program" (program)
[Warning] @,: Compiler version mismatch: Have 14.2.1; expected version >= 9.0.0 and < 10.0.0
Building project mbed-os-program (OPTA, GCC_ARM)
Scan: mbed-os-program
Using ROM region application in this build.
  Region application: size 0x1c0000, offset 0x8040000
Using RAM region application_ram in this build.
  Region application_ram: size 0x80000, offset 0x24000000
Compile [ 29.1%]: sha256_alt.cpp
Compile [ 29.2%]: pn512_irq.c
Compile [ 29.3%]: pn512_hw.c
Compile [ 29.5%]: pn512_cmd.c
Compile [ 29.6%]: PN512TransportDriver.cpp
Compile [ 29.7%]: pn512.c
Compile [ 29.8%]: pn512_registers.c
Compile [ 29.9%]: pn512_timer.c
Compile [ 30.0%]: pn512_poll.c
Compile [ 30.1%]: pn512_rf.c
Compile [ 30.2%]: pn512_transceive.c
Compile [ 30.3%]: stm32h7_eth_init.c
[Error] stm32h7_eth_init.c@69,9: implicit declaration of function 'core_util_critical_section_enter' [-Wimplicit-function-declaration]
[Error] stm32h7_eth_init.c@72,9: implicit declaration of function 'core_util_critical_section_exit' [-Wimplicit-function-declaration]
[ERROR] ./mbed-os/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_OPTA/stm32h7_eth_init.c: In function 'HAL_ETH_MspInit':
./mbed-os/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_OPTA/stm32h7_eth_init.c:69:9: error: implicit declaration of function 'core_util_critical_section_enter' [-Wimplicit-function-declaration]
   69 |         core_util_critical_section_enter();
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./mbed-os/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_OPTA/stm32h7_eth_init.c:72:9: error: implicit declaration of function 'core_util_critical_section_exit' [-Wimplicit-function-declaration]
   72 |         core_util_critical_section_exit();
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[mbed] ERROR: "/Users/dirk/Projects/mbed_env/bin/python3.11" returned error.
       Code: 1
       Path: "/private/tmp/mbed-os-program"
       Command: "/Users/dirk/Projects/mbed_env/bin/python3.11 -u /private/tmp/mbed-os-program/mbed-os/tools/make.py -t GCC_ARM -m OPTA --source . --build ./BUILD/OPTA/GCC_ARM"
       Tip: You could retry the last command with "-v" flag for verbose output
---
(mbed_env) bash-5.2$

@dirkvdb
Copy link
Author

dirkvdb commented Jan 2, 2025

These are the changes I needed to apply on top of the extrapatches-6.17.0 branch of mbed-os to get it to compile

mbed-os.patch

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

No branches or pull requests

2 participants