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

[Gen3] Replace PLATFORM_ID checks with HAL macros in dynalib #2500

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

keeramis
Copy link
Contributor

@keeramis keeramis commented Aug 4, 2022

Problem

Replace PLATFORM_ID checks in dynalib header files with HAL macros for compactness

Solution

Define a new macro based on the functionality and include it to the relevant header files through the respective makefiles

Steps to Test

Example App

Build using new platform and test with trackerm hardware:

modules$ make clean all PLATFORM=p2 MODULAR=y

References

N/A


Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA (Info here)
  • Problem and Solution clearly stated
  • Run unit/integration/application tests on device
  • Added documentation
  • Added to CHANGELOG.md after merging (add links to docs and issues)

@keeramis keeramis mentioned this pull request Aug 4, 2022
6 tasks
@@ -2,6 +2,9 @@
TARGET_SPARK_SERVICES_PATH=$(SERVICES_MODULE_PATH)

INCLUDE_DIRS += $(TARGET_SPARK_SERVICES_PATH)/inc
INCLUDE_DIRS += $(PROJECT_ROOT)/hal/src/$(PLATFORM_DYNALIB_MODULES)
Copy link
Member

Choose a reason for hiding this comment

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

Let's better use same pattern as below for nanopb:

include $(PROJECT_ROOT)/hal/import.mk

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If I am including this in the makefile itself, I am running into multiple definition problem -

../../../build/arm/startup/startup_rtl872x.S: Assembler messages:
../../../build/arm/startup/startup_rtl872x.S:160: Warning: ignoring changed section attributes for .text
/usr/local/gcc-arm/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: ../../../build/target/lwip/platform-32-m//liblwip.a(init.o): in function `lwip_init':
/Users/keerthyamisagadda/code/device-os/third_party/lwip/lwip/src/core/init.c:333: multiple definition of `lwip_init'; ../../../build/target/lwip/platform-32-m//liblwip.a(init.o):/Users/keerthyamisagadda/code/device-os/third_party/lwip/lwip/src/core/init.c:333: first defined here
/usr/local/gcc-arm/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: ../../../build/target/lwip/platform-32-m//liblwip.a(def.o): in function `lwip_htons':
/Users/keerthyamisagadda/code/device-os/third_party/lwip/lwip/src/core/def.c:78: multiple definition of `lwip_htons'; ../../../build/target/lwip/platform-32-m//liblwip.a(def.o):/Users/keerthyamisagadda/code/device-os/third_party/lwip/lwip/src/core/def.c:78: first defined here
/usr/local/gcc-arm/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: ../../../build/target/lwip/platform-32-m//liblwip.a(def.o): in function `lwip_htonl':
/Users/keerthyamisagadda/code/device-os/third_party/lwip/lwip/src/core/def.c:93: multiple definition of `lwip_htonl'; ../../../build/target/lwip/platform-32-m//liblwip.a(def.o):/Users/keerthyamisagadda/code/device-os/third_party/lwip/lwip/src/core/def.c:93: first defined here
/usr/local/gcc-arm/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: ../../../build/target/lwip/platform-32-m//liblwip.a(def.o): in function `lwip_strnstr':

@@ -513,4 +513,8 @@
#define HAL_PLATFORM_CELLULAR_MODEM_VOLTAGE_TRANSLATOR (1)
#endif // HAL_PLATFORM_CELLULAR_MODEM_VOLTAGE_TRANSLATOR

#ifndef HAL_PLAFORM_DYNALIB_DYNAMIC_LOCATION
#define HAL_PLAFORM_DYNALIB_DYNAMIC_LOCATION (0)
#endif // HAL_PLAFORM_DYNALIB_DYNAMIC_LOCATION
Copy link
Member

Choose a reason for hiding this comment

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

spelling nit: missing a t in platform?

@technobly technobly added this to the 5.0.0 milestone Aug 15, 2022
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.

4 participants