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

fix(CMSIS): Fix zephyr build issues #1030

Merged
merged 2 commits into from
Jun 3, 2024
Merged

fix(CMSIS): Fix zephyr build issues #1030

merged 2 commits into from
Jun 3, 2024

Conversation

ozersa
Copy link
Contributor

@ozersa ozersa commented Jun 3, 2024

This PR updates requires to peripheral drivers being used on zephyr side.
There are two commits one for MAX32662 being build, second for building zephyr with newlib.

MAX32662 build issue
image

Newlib buld issue: zephyrproject-rtos/zephyr#73606

[168/173] Linking CXX executable zephyr/zephyr_pre0.elf
FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map /Users/luisubieda/zephyrproject/zephyr/twister-out/max32690evkit_max32690_m4/tests/lib/cpp/cxx/cpp.main.newlib/zephyr/zephyr_pre0.map 
: && ccache /Users/luisubieda/zephyr-sdk-0.16.5-1/arm-zephyr-eabi/bin/arm-zephyr-eabi-g++  -gdwarf-4 zephyr/CMakeFiles/zephyr_pre0.dir/misc/empty_file.c.obj -o zephyr/zephyr_pre0.elf  zephyr/CMakeFiles/offsets.dir/./arch/arm/core/offsets/offsets.c.obj  -fuse-ld=bfd  -T  zephyr/linker_zephyr_pre0.cmd  -Wl,-Map=/Users/luisubieda/zephyrproject/zephyr/twister-out/max32690evkit_max32690_m4/tests/lib/cpp/cxx/cpp.main.newlib/zephyr/zephyr_pre0.map  -Wl,--whole-archive  app/libapp.a  zephyr/libzephyr.a  zephyr/arch/common/libarch__common.a  zephyr/arch/arch/arm/core/libarch__arm__core.a  zephyr/arch/arch/arm/core/cortex_m/libarch__arm__core__cortex_m.a  zephyr/lib/libc/newlib/liblib__libc__newlib.a  zephyr/lib/libc/common/liblib__libc__common.a  zephyr/subsys/rtio/libsubsys__rtio.a  zephyr/subsys/testsuite/ztest/libsubsys__testsuite__ztest.a  zephyr/subsys/net/libsubsys__net.a  zephyr/drivers/clock_control/libdrivers__clock_control.a  zephyr/drivers/console/libdrivers__console.a  zephyr/drivers/gpio/libdrivers__gpio.a  zephyr/drivers/pinctrl/libdrivers__pinctrl.a  zephyr/drivers/serial/libdrivers__serial.a  zephyr/drivers/timer/libdrivers__timer.a  -Wl,--no-whole-archive  zephyr/kernel/libkernel.a  -L"/Users/luisubieda/zephyr-sdk-0.16.5-1/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/thumb/v7e-m/nofp"  -L/Users/luisubieda/zephyrproject/zephyr/twister-out/max32690evkit_max32690_m4/tests/lib/cpp/cxx/cpp.main.newlib/zephyr  -lgcc  zephyr/arch/common/libisr_tables.a  -Wl,--fatal-warnings  -mcpu=cortex-m4  -mthumb  -mabi=aapcs  -mfp16-format=ieee  -Wl,--gc-sections  -Wl,--build-id=none  -Wl,--sort-common=descending  -Wl,--sort-section=alignment  -Wl,-u,_OffsetAbsSyms  -Wl,-u,_ConfigAbsSyms  -nostdlib  -static  -Wl,-X  -Wl,-N  -Wl,--orphan-handling=warn  -Wl,-no-pie  -lm  -Wl,-lc  -L"/Users/luisubieda/zephyr-sdk-0.16.5-1/arm-zephyr-eabi/arm-zephyr-eabi"/lib/thumb/v7e-m/nofp  -Wl,-lgcc  -lc && cd /Users/luisubieda/zephyrproject/zephyr/twister-out/max32690evkit_max32690_m4/tests/lib/cpp/cxx/cpp.main.newlib/zephyr && /opt/homebrew/Cellar/cmake/3.25.1/bin/cmake -E true
/Users/luisubieda/zephyr-sdk-0.16.5-1/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/lib/libc/newlib/liblib__libc__newlib.a(libc-hooks.c.obj): in function `_kill':
/Users/luisubieda/zephyrproject/zephyr/lib/libc/newlib/libc-hooks.c:261: multiple definition of `_kill'; zephyr/libzephyr.a(system_max32690.c.obj):/Users/luisubieda/zephyrproject/modules/hal/adi/MAX/Libraries/CMSIS/Device/Maxim/MAX32690/Source/system_max32690.c:44: first defined here
/Users/luisubieda/zephyr-sdk-0.16.5-1/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/lib/libc/newlib/liblib__libc__newlib.a(libc-hooks.c.obj): in function `_getpid':
/Users/luisubieda/zephyrproject/zephyr/lib/libc/newlib/libc-hooks.c:267: multiple definition of `_getpid'; zephyr/libzephyr.a(system_max32690.c.obj):/Users/luisubieda/zephyrproject/modules/hal/adi/MAX/Libraries/CMSIS/Device/Maxim/MAX32690/Source/system_max32690.c:42: first defined here
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

Checklist Before Requesting Review

  • PR Title follows correct guidelines.
  • Description of changes and all other relevant information.
  • (Optional) Link any related GitHub issues using a keyword
  • (Optional) Provide info on any relevant functional testing/validation. For API changes or significant features, this is not optional.

ozersa and others added 2 commits June 3, 2024 09:54
The .shared and .mailbox sections are for the dual-core parts and
don’t exist for the MAX32662

Signed-off-by: Sadik Ozer <[email protected]>
Declares _getpid() and _kill() function stubs as weak to avoid
conflicting with similar function stubs defined in zephyr libc-hooks.
This fixes linker errors when building zephyr with newlib on max32
boards.

Signed-off-by: Maureen Helm <[email protected]>
@github-actions github-actions bot added MAX32520 Related to the MAX32520 (ES17) MAX32570 Related to the MAX32570 (ME13) MAX32650 Related to the MAX32650 (ME10) MAX32655 Related to the MAX32655 (ME17) MAX32660 Related to the MAX32660 (ME11) MAX32665 Related to the MAX32665 (ME14) MAX32670 Related to the MAX32670 (ME15) MAX32672 Related to the MAX32672 (ME21) MAX32675 Related to the MAX32675 (ME16) MAX32680 Related to the MAX32680 (ME20) MAX32690 Related to the MAX32690 (ME18) MAX78000 Related to the MAX78000 (AI85) MAX78002 Related to the MAX78002 (AI87) MAX32662 Related to the MAX32662 (ME12) MAX32572 Related to the MAX32572 (ME55) labels Jun 3, 2024
@Jake-Carter Jake-Carter merged commit daa71f8 into main Jun 3, 2024
12 checks passed
@Jake-Carter Jake-Carter deleted the fix-zephyr-issues branch June 3, 2024 22:04
EricB-ADI pushed a commit that referenced this pull request Aug 21, 2024
Signed-off-by: Sadik Ozer <[email protected]>
Signed-off-by: Maureen Helm <[email protected]>
Co-authored-by: Maureen Helm <[email protected]>
EricB-ADI pushed a commit that referenced this pull request Aug 21, 2024
Signed-off-by: Sadik Ozer <[email protected]>
Signed-off-by: Maureen Helm <[email protected]>
Co-authored-by: Maureen Helm <[email protected]>
EricB-ADI pushed a commit that referenced this pull request Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MAX32520 Related to the MAX32520 (ES17) MAX32570 Related to the MAX32570 (ME13) MAX32572 Related to the MAX32572 (ME55) MAX32650 Related to the MAX32650 (ME10) MAX32655 Related to the MAX32655 (ME17) MAX32660 Related to the MAX32660 (ME11) MAX32662 Related to the MAX32662 (ME12) MAX32665 Related to the MAX32665 (ME14) MAX32670 Related to the MAX32670 (ME15) MAX32672 Related to the MAX32672 (ME21) MAX32675 Related to the MAX32675 (ME16) MAX32680 Related to the MAX32680 (ME20) MAX32690 Related to the MAX32690 (ME18) MAX78000 Related to the MAX78000 (AI85) MAX78002 Related to the MAX78002 (AI87)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants