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

adding in support for DSP functionality, #626

Closed
wants to merge 5 commits into from

Conversation

LokiMetaSmith
Copy link

it works but isn't the right way to do it.

This worked for my implementation and is similar to how CMSIS is used in the nRF52 package, the samd implementation adds it under tools, but I wasn't able to get that to work.

adafruit/ArduinoCore-samd#271

Signed-off-by: lawrence kincheloe [email protected]

lawrence kincheloe added 2 commits March 25, 2021 15:31
Copy link
Member

@hathach hathach left a comment

Choose a reason for hiding this comment

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

Thank you for your PR. Yeah, you are right, we should better move this to tools like samd. It is much cleaner and easier to update the CMSIS package in the future. I will do the tool configuration with BSP release. To ease the odds, I will separate it into 2 smaller release

  • first : migrate current cmsis to tools one like samd
  • next: will make use of the dsp and math lib. (you could help with this one after the first release came out).

For now, I will mark this PR as draft as reference for future Note: this can take a bit of time, since I am not focusing on nrf at the moment. Meanwhile please try go on with your fork as walkaround.

@hathach hathach marked this pull request as draft April 2, 2021 12:31
@hathach hathach added the ToDo label Apr 2, 2021
@hathach
Copy link
Member

hathach commented Apr 2, 2021

note to my self: adafruit/arduino-board-index#69 add cmsis v5 support for SAMD, nRF BSP can re-use this as well.

@hathach
Copy link
Member

hathach commented May 26, 2021

once 0.22.1 is released, the core will use the cmsis 5.4 from package tool which also include dsp library. However, the ld flags to link libmath haven't enabled just yet, since I think we need to have some testing time before making it to the public.

https://github.com/adafruit/Adafruit_nRF52_Arduino/blob/master/platform.txt#L77

Since I don't use dsp much, please help to enable the ld flag then make an PR when you think it is stable after a period of testing.

@LokiMetaSmith
Copy link
Author

got it to compile, I had to include libarm_cortexM4lf_math.a specifically to get it to be linked in. going to work on narrowing down how and why it works next week.

@@ -65,11 +65,11 @@ build.flags.usb= -DUSBCON -DUSE_TINYUSB -DUSB_VID={build.vid} -DUSB_PID={build.p
compiler.c.extra_flags=
compiler.c.elf.extra_flags=
compiler.cpp.extra_flags=
compiler.S.extra_flags=
compiler.ar.extra_flags=
-compiler.libraries.ldflags=
+compiler.libraries.ldflags={runtime.tools.CMSIS-5.4.0.path}/CMSIS/Lib/GCC/libarm_cortexM4lf_math.a
compiler.elf2bin.extra_flags=
compiler.elf2hex.extra_flags=

compiler.arm.cmsis.c.flags="-I{runtime.tools.CMSIS-5.4.0.path}/CMSIS/Core/Include/" "-I{runtime.tools.CMSIS-5.4.0.path}/CMSIS/DSP/Include/"

@@ -80,11 +80,11 @@ compiler.arm.cmsis.ldflags="-L{runtime.tools.CMSIS-5.4.0.path}/CMSIS/Lib/GCC/" -
rtos.path={build.core.path}/freertos
nordic.path={build.core.path}/nordic

build.logger_flags and build.sysview_flags are intentionally empty,

to allow modification via a user's own boards.local.txt or platform.local.txt files.

-build.flags.nrf= -DSOFTDEVICE_PRESENT -DARDUINO_NRF52_ADAFRUIT -DNRF52_SERIES -DDX_CC_TEE -DLFS_NAME_MAX=64 {compiler.optimization_flag} {build.debug_flags} {build.logger_flags} {build.sysview_flags} {compiler.arm.cmsis.c.flags} "-I{nordic.path}" "-I{nordic.path}/nrfx" "-I{nordic.path}/nrfx/hal" "-I{nordic.path}/nrfx/mdk" "-I{nordic.path}/nrfx/soc" "-I{nordic.path}/nrfx/drivers/include" "-I{nordic.path}/nrfx/drivers/src" "-I{nordic.path}/softdevice/{build.sd_name}nrf52{build.sd_version}_API/include" "-I{nordic.path}/softdevice/{build.sd_name}nrf52{build.sd_version}_API/include/nrf52" "-I{rtos.path}/Source/include" "-I{rtos.path}/config" "-I{rtos.path}/portable/GCC/nrf52" "-I{rtos.path}/portable/CMSIS/nrf52" "-I{build.core.path}/sysview/SEGGER" "-I{build.core.path}/sysview/Config" "-I{runtime.platform.path}/libraries/Adafruit_TinyUSB_Arduino/src/arduino"
+build.flags.nrf= -DSOFTDEVICE_PRESENT -DARDUINO_NRF52_ADAFRUIT -DNRF52_SERIES -DDX_CC_TEE -DLFS_NAME_MAX=64 {compiler.optimization_flag} {build.debug_flags} {build.logger_flags} {build.sysview_flags} {compiler.arm.cmsis.c.flags} {compiler.arm.cmsis.ldflags} "-I{nordic.path}" "-I{nordic.path}/nrfx" "-I{nordic.path}/nrfx/hal" "-I{nordic.path}/nrfx/mdk" "-I{nordic.path}/nrfx/soc" "-I{nordic.path}/nrfx/drivers/include" "-I{nordic.path}/nrfx/drivers/src" "-I{nordic.path}/softdevice/{build.sd_name}nrf52{build.sd_version}_API/include" "-I{nordic.path}/softdevice/{build.sd_name}nrf52{build.sd_version}_API/include/nrf52" "-I{rtos.path}/Source/include" "-I{rtos.path}/config" "-I{rtos.path}/portable/GCC/nrf52" "-I{rtos.path}/portable/CMSIS/nrf52" "-I{build.core.path}/sysview/SEGGER" "-I{build.core.path}/sysview/Config" "-I{runtime.platform.path}/libraries/Adafruit_TinyUSB_Arduino/src/arduino"

Compile patterns

----------------

Compile c files

@hathach
Copy link
Member

hathach commented Jun 9, 2021

will be implemented as part of #658

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants