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

up_mdelay multiple definitions #475

Closed
robin-raymond opened this issue Mar 7, 2020 · 3 comments
Closed

up_mdelay multiple definitions #475

robin-raymond opened this issue Mar 7, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@robin-raymond
Copy link

In file:
nuttx/arch/arm/src/common/up_mdelay.c

void up_mdelay(unsigned int milliseconds)
{
  volatile unsigned int i;
  volatile unsigned int j;

  for (i = 0; i < milliseconds; i++)
    {
      for (j = 0; j < CONFIG_BOARD_LOOPSPERMSEC; j++)
        {
        }
    }
}

is defined. But if you enable the timer driver you get:

void up_mdelay(unsigned int milliseconds)
{
  up_udelay(USEC_PER_MSEC * milliseconds);
}

in file nuttx/drivers/timers/arch_timer.c

And thus the compiler error becomes:

nuttx/nuttx/staging/libdrivers.a(arch_timer.o): In function `up_mdelay':
arch_timer.c:(.text+0x208): multiple definition of `up_mdelay'
nuttx/nuttx/staging/libkarch.a(up_mdelay.o):up_mdelay.c:(.text+0x0): first defined here
@xiaoxiang781216
Copy link
Contributor

xiaoxiang781216 commented Mar 7, 2020

@robin-raymond you shouldn't do these two things at the same time:
1.Include up_mdelay.c in your CSRCS
2.Enable CONFIG_ARCH_TIMER in your defconfig
Please see the detailed discussion here:
#353
You can remove up_mdelay.c from CSRCS, because the implemenation in arch_timer.c is more accurate.

@patacongo
Copy link
Contributor

patacongo commented Mar 7, 2020 via email

@robin-raymond
Copy link
Author

Thank you for the help! I disabled Timer Arch Implementation (TIMER_ARCH) and the problem stopped. I do think that either 1 or 2 should be done though. I do agree there should be some coordination though between the timer arch and the system. I'm less confident on the code just yet to submit a patch (still learning but enthusiastic).

@patacongo patacongo added bug Something isn't working enhancement New feature or request and removed enhancement New feature or request labels Mar 7, 2020
cwespressif pushed a commit to cwespressif/incubator-nuttx that referenced this issue Apr 3, 2024
…dc-iperf-test

[T3PW] ESP32s3 t3pw-dev enable sdc iperf test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants