Coder Social home page Coder Social logo

Trying to run the Timer example about nuttx-apps HOT 2 OPEN

apache avatar apache commented on May 30, 2024
Trying to run the Timer example

from nuttx-apps.

Comments (2)

saramonteiro avatar saramonteiro commented on May 30, 2024

Hi @eden-desta!

You're not seeing it on your /dev dir because the board bringup function of this board is not calling the function that register the timer drivers.
See your board bringup: https://github.com/apache/incubator-nuttx/blob/master/boards/arm/stm32h7/nucleo-h743zi2/src/stm32_bringup.c
Take this bringup on ESP32 as an example: https://github.com/apache/incubator-nuttx/blob/master/boards/xtensa/esp32/esp32-devkitc/src/esp32_bringup.c#L227-L249
In your case you should call stm32_timer_initialize to register it.

from nuttx-apps.

eden-desta avatar eden-desta commented on May 30, 2024

Hi @saramonteiro thank you for your response! I appreciate you!

Okay, so I have made some updates to the stm32_bringup.c file:

#ifdef CONFIG_TIMER
#include <stm32_tim.h>
#endif

....

#ifdef CONFIG_TIMER
  ret = stm32_timer_initialize("/dev/timer0", 0);
  if (ret < 0) {
    syslog(LOG_ERR, "ERROR: Failed to initialize timer driver: %d\n", ret);
  }
#endif

And i get the following error:

/home/eden/nuttx/nuttx/boards/arm/stm32h7/nucleo-h743zi2/src/stm32_bringup.c:185: undefined reference to `stm32_timer_initialize'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:156: nuttx] Error 1
make[1]: Leaving directory '/home/eden/nuttx/nuttx/arch/arm/src'
make: *** [tools/Makefile.unix:422: nuttx] Error 2

I noticed that the esp32_bringup.c includes #include <esp32_tim_lowerhalf.h> which is not available for the stm32 boards. So in an effort to see if perhaps this can be something I can work around, i imitated that esp32_tim_lowerhalf.h file and made an stm32_tim_lowerhalf.h file that I included in the bringup instead. I removed the stm32_timer_initialize function from the stm32_tim.h file and moved it to the new lowerhalf. When i built it, it said that the stm32_tim_lowerhalf.h files does not exist.

stm32_bringup.c:43:10: fatal error: stm32_tim_lowerhalf.h: No such file or directory
   43 | #include "stm32_tim_lowerhalf.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [/home/eden/nuttx/nuttx/boards/Board.mk:103: stm32_bringup.o] Error 1
make[2]: Leaving directory '/home/eden/nuttx/nuttx/boards/arm/stm32h7/nucleo-h743zi2/src'
make[1]: *** [Makefile:152: board/libboard.a] Error 2
make[1]: Leaving directory '/home/eden/nuttx/nuttx/arch/arm/src'
make: *** [tools/Makefile.unix:422: nuttx] Error 2

So stuck on two avenues with a little bit of uncertainty which way is the right way to go about moving forward

from nuttx-apps.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.