You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "comejv (via GitHub)" <gi...@apache.org> on 2025/07/24 16:32:11 UTC

[I] [HELP] Timer capture on nucleo stm32h743zi [nuttx]

comejv opened a new issue, #16762:
URL: https://github.com/apache/nuttx/issues/16762

   ### Description
   
   Hello, I need to use timer capture on my nucleo-stm32h743zi. I haven't found anything related to it in the sources, but there are lower half drivers for capture in the stm32/ folder (for f boards).
   
   Does that mean timer capture has not been implemented for this architecture?
   
   Would there be a small patch that would enable it?
   
   ### Verification
   
   - [x] I have verified before submitting the report.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [HELP] Timer capture on nucleo stm32h743zi [nuttx]

Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on issue #16762:
URL: https://github.com/apache/nuttx/issues/16762#issuecomment-3152527171

   @comejv each PINFUNCTION_n (n = 1, 2, 3, ...) means an alternative pin for a function. For example a GPIO_SPI1_MISO could be in differents pins of the chip, you need to look at arch/arm/src/familyname/hardware/pinmap.h to understand what is the physical pin you want to use to GPIO_SPI1_MISO function. After you understand that logic it is very simple


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [HELP] Timer capture on nucleo stm32h743zi [nuttx]

Posted by "comejv (via GitHub)" <gi...@apache.org>.
comejv commented on issue #16762:
URL: https://github.com/apache/nuttx/issues/16762#issuecomment-3151257359

   I got it to work, I still have to figure out how to capture multiple channels with one timer. Any reference for that? I think the stm32 driver was designed for PWM measurement, so one pair of channels per timer, now 4 independant capture. Do you think I should try to extend the driver or do it another way?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [HELP] Timer capture on nucleo stm32h743zi [nuttx]

Posted by "comejv (via GitHub)" <gi...@apache.org>.
comejv commented on issue #16762:
URL: https://github.com/apache/nuttx/issues/16762#issuecomment-3137643257

   To be able to include the source files I just added:
   ```cmake
       INCLUDE_DIRECTORIES
       ${NUTTX_DIR}/arch/arm/src/stm32h7/)
   ```
   to the CMakeLists of my app.
   
   Using gpio interrupt I seem to be limited by the resolution of the system clock when using `clock_gettime(CLOCK_MONOTONIC, &now)`, which caps me at 100Hz. How can I fix that? Increasing system clock? Going tickless? Using another timer?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [HELP] Timer capture on nucleo stm32h743zi [nuttx]

Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on issue #16762:
URL: https://github.com/apache/nuttx/issues/16762#issuecomment-3145432218

   Hi @comejv nice finding, yes the FIX needs to be fixed. Probably the timer capture driver should be very similar to others STM32, I will ping the original author to see if the has the board side example


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [HELP] Timer capture on nucleo stm32h743zi [nuttx]

Posted by "comejv (via GitHub)" <gi...@apache.org>.
comejv commented on issue #16762:
URL: https://github.com/apache/nuttx/issues/16762#issuecomment-3155874333

   Ok so I think I found an issue with the driver, whatever I was doing timer 2 channel 1 would stay on PA0 which is GPIO_TIM2_CH1IN_1. Then I found out that in `stm32_cap_initialize` called by `bringup` we call `stm32_cap_init`:
   ```c
   struct stm32_cap_dev_s *stm32_cap_init(int timer)
   {
     const struct stm32_cap_priv_s *priv = stm32_cap_get_priv(timer);
     uint32_t gpio;
   
     if (priv)
       {
         stm32_cap_set_rcc(priv, true);
   
         gpio = stm32_cap_gpio(priv, STM32_CAP_CHANNEL_COUNTER);
         if (gpio)
           {
             stm32_configgpio(gpio);
           }
   
         /* Disable timer while is not configured */
   
         stm32_modifyreg16(priv, STM32_BTIM_CR1_OFFSET, ATIM_CR1_CEN, 0);
       }
   
     return (struct stm32_cap_dev_s *)priv;
   }
   ```
   
   The issue seems to be with `STM32_CAP_CHANNEL_COUNTER`. Instead of being the number of the channel we want to use with the timer (between 1 and 4 usually) it's defined as 0 in `arch/arm/src/stm32h7/stm32_capture.h`. If I replace the macro with a hardcoded 1 I suddenly see the right alternate pin being used. What is this value?
   
   It seems like `stm32_cap_gpio` should be called with the channel that we want to use for this timer as second argument, not a hardcoded 0.
   
   Any idea?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [HELP] Timer capture on nucleo stm32h743zi - Driver port [nuttx]

Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis closed issue #16762: [HELP] Timer capture on nucleo stm32h743zi - Driver port
URL: https://github.com/apache/nuttx/issues/16762


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [HELP] Timer capture on nucleo stm32h743zi [nuttx]

Posted by "raiden00pl (via GitHub)" <gi...@apache.org>.
raiden00pl commented on issue #16762:
URL: https://github.com/apache/nuttx/issues/16762#issuecomment-3144571306

   I haven't used TIM capture with NuttX yet, so I can't help. The timers in the stm32 and stm32h7 are basically the same, so the port should be a simple copy-paste from these files:
   
   - arch/arm/src/stm32/stm32_capture.c
   - arch/arm/src/stm32/stm32_capture_lowerhalf.c
   - boards/arm/stm32/stm32f4discovery/src/stm32_capture.c
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [HELP] Timer capture on nucleo stm32h743zi [nuttx]

Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on issue #16762:
URL: https://github.com/apache/nuttx/issues/16762#issuecomment-3152584962

   > I got it to work, I still have to figure out how to capture multiple channels with one timer. Any reference for that? I think the stm32 driver was designed for PWM measurement, so one pair of channels per timer, not 4 independant capture. Do you think I should try to extend the driver or do it another way?
   
   Yes, I think makes sense to extend it to support normal pulse measurement (that I think is a common usage). @raiden00pl some recommendation?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [HELP] Timer capture on nucleo stm32h743zi [nuttx]

Posted by "comejv (via GitHub)" <gi...@apache.org>.
comejv commented on issue #16762:
URL: https://github.com/apache/nuttx/issues/16762#issuecomment-3151470110

   Other question, how do I know what version of the pins is used? the pinout lists multiple options. I have looked at the mb1364 manual but it doesn't seem to contain all the info I need.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [HELP] Timer capture on nucleo stm32h743zi [nuttx]

Posted by "comejv (via GitHub)" <gi...@apache.org>.
comejv commented on issue #16762:
URL: https://github.com/apache/nuttx/issues/16762#issuecomment-3155415542

   I found the right datasheet, thanks. The NuttX pinout has definitions that use specific Alternate Functions, how was the AF number chosen?
   
   For example here we have CH1IN for timer 13, using AF9.
   ```c
   #define GPIO_TIM13_CH1IN_1        (GPIO_ALT|GPIO_AF9|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN6)
   ``` 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [HELP] Timer capture on nucleo stm32h743zi [nuttx]

Posted by "raiden00pl (via GitHub)" <gi...@apache.org>.
raiden00pl commented on issue #16762:
URL: https://github.com/apache/nuttx/issues/16762#issuecomment-3155438012

   Alternate functions are defined in `Table 8. STM32H730xB pin alternate functions`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [HELP] Timer capture on nucleo stm32h743zi [nuttx]

Posted by "comejv (via GitHub)" <gi...@apache.org>.
comejv commented on issue #16762:
URL: https://github.com/apache/nuttx/issues/16762#issuecomment-3140216326

   Hey, thank you I did try a free runner and it's working great, I can measure rising edges up to a MHz. I will probably stick with this because I'm not confident I could port the timer capture driver myself.
   
   Here's how I did it for anyone having the same issue:
   [](https://gist.github.com/comejv/271d396c770a2f9a3e478a3f5ea7899a)
   
   I'll be closing this issue but if you have suggestions about how I did it or updates on timer capture on the H7 please tag me!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [HELP] Timer capture on nucleo stm32h743zi [nuttx]

Posted by "comejv (via GitHub)" <gi...@apache.org>.
comejv commented on issue #16762:
URL: https://github.com/apache/nuttx/issues/16762#issuecomment-3141304605

   Noted, I'll give try to do it like you suggest if we find that basic gpio interrupts do not fit our usecase. Thank you for your help!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [HELP] Timer capture on nucleo stm32h743zi [nuttx]

Posted by "comejv (via GitHub)" <gi...@apache.org>.
comejv commented on issue #16762:
URL: https://github.com/apache/nuttx/issues/16762#issuecomment-3114179848

   My goal is timer capture on four inputs. With HAL i can do it with HAL_TIM_IC_Start_IT and HAL_TIM_IC_ConfigChannel on all 4 channels of timer 4, can I use different channels for one timer in NuttX too or should I use different timers?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [HELP] Timer capture on nucleo stm32h743zi [nuttx]

Posted by "comejv (via GitHub)" <gi...@apache.org>.
comejv commented on issue #16762:
URL: https://github.com/apache/nuttx/issues/16762#issuecomment-3154966410

   > @comejv each PINFUNCTION_n (n = 1, 2, 3, ...) means an alternative pin for a function. For example a GPIO_SPI1_MISO could be in differents pins of the chip, you need to look at arch/arm/src/familyname/hardware/pinmap.h to understand what is the physical pin you want to use to GPIO_SPI1_MISO function. After you understand that logic it is very simple
   
   Yes bit how do I find out what alternate pin is used except by testing all combinations? 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [HELP] Timer capture on nucleo stm32h743zi [nuttx]

Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on issue #16762:
URL: https://github.com/apache/nuttx/issues/16762#issuecomment-3114991478

   @comejv I think he have example support only for Espressif chip. @raiden00pl did you get it working on STM32?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [HELP] Timer capture on nucleo stm32h743zi [nuttx]

Posted by "comejv (via GitHub)" <gi...@apache.org>.
comejv commented on issue #16762:
URL: https://github.com/apache/nuttx/issues/16762#issuecomment-3151270737

   I'll probably just push the driver as is and drive the timer directly, bypassing the ioctl and lowerhalf driver that are designed for PWM.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [HELP] Timer capture on nucleo stm32h743zi - Driver port [nuttx]

Posted by "comejv (via GitHub)" <gi...@apache.org>.
comejv commented on issue #16762:
URL: https://github.com/apache/nuttx/issues/16762#issuecomment-3161520338

   I've got it working how I want by bypassing the stm32_capture_lowerhalf.c driver. Here's what I'm doing to get timer capture on 4 channels of timer 4:
   
   ```c
   /* Per-channel state */
   struct chstate {
     volatile uint32_t last;
     volatile uint32_t delta;
   };
   
   /* Global state for our 4-channel capture */
   static struct {
     struct stm32_cap_dev_s *dev;
     struct chstate cs[CH_COUNT];
   } gcap4;
   
   /* Single ISR to handle all four CCx interrupts */
   static int capture4_isr(int irq, void *context, void *arg) {
     uint32_t flags = STM32_CAP_GETFLAGS(gcap4.dev);
   
     /* Acknowledge *all* CCxIF bits */
     STM32_CAP_ACKFLAGS(gcap4.dev, flags);
   
     for (int i = 0; i < CH_COUNT; i++) {
       uint8_t ch = i + 1;
       uint32_t mask = STM32_CAP_FLAG_IRQ_CH(ch);
   
       if (flags & mask) {
         uint32_t now = STM32_CAP_GETCAPTURE(gcap4.dev, ch);
         uint32_t diff = (now - gcap4.cs[i].last) & CAP_MAXCNT;
         gcap4.cs[i].last = now;
         gcap4.cs[i].delta = diff;
       }
     }
   
     return OK;
   }
   
   int capture4_init(void) {
     struct stm32_cap_dev_s *dev;
     int ch, ret;
   
     /* 1)  Bring up TIM4, channel=1 is only used to select the peripheral. */
     dev = stm32_cap_init(CAP_TIMER, 1);
     if (!dev) {
       syslog(LOG_ERR, "capture4: stm32_cap_init failed");
       return -ENODEV;
     }
   
     /* 2)  Free‐running internal clock, no prescaler */
     STM32_CAP_SETSMC(dev, STM32_CAP_SMS_INT);
     ret = STM32_CAP_SETCLOCK(dev, CAP_CLOCK_HZ, CAP_MAXCNT);
     if (ret < 0) {
       syslog(LOG_ERR, "capture4: setclock failed: %d", ret);
       return ret;
     }
   
     /* 3)  Configure CC1..CC4 → TI1, rising‐edge, no filter, no prescale */
     for (ch = 1; ch <= CH_COUNT; ch++) {
       stm32_cap_ch_cfg_t cfg = STM32_CAP_MAPPED_TI1  //
                                | STM32_CAP_INPSC_NO  //
                                | STM32_CAP_FILTER_NO //
                                | STM32_CAP_EDGE_RISING;
   
       ret = STM32_CAP_SETCHANNEL(dev, ch, cfg);
       if (ret < 0) {
         syslog(LOG_ERR, "capture4: SETCHANNEL ch=%d failed: %d (check GPIO_TIM4_CH%dIN)", ch, ret,
                ch);
       }
     }
   
     /* 4)  Hook our single ISR and enable all 4 CCx interrupts */
     ret = STM32_CAP_SETISR(dev, capture4_isr, NULL);
     if (ret < 0) {
       syslog(LOG_ERR, "capture4: SETISR failed: %d", ret);
     }
   
     STM32_CAP_ENABLEINT(dev,
                         STM32_CAP_FLAG_IRQ_CH(1) | STM32_CAP_FLAG_IRQ_CH(2) |
                             STM32_CAP_FLAG_IRQ_CH(3) | STM32_CAP_FLAG_IRQ_CH(4),
                         true);
   
     gcap4.dev = dev;
   
     return OK;
   }
   ```
   
   The only modification I needed in the existing driver that I ported (currently in #16809) was this patch in `arch/arm/src/stm32h7/stm32_capture.c` to initialize the channel properly:
   ```patch
   @@ -1539,7 +1575,7 @@ static inline const struct stm32_cap_priv_s * stm32_cap_get_priv(int timer)
     * Public Function - Initialization
     ****************************************************************************/
    
   -struct stm32_cap_dev_s *stm32_cap_init(int timer)
   +struct stm32_cap_dev_s *stm32_cap_init(int timer, uint8_t channel)
    {
      const struct stm32_cap_priv_s *priv = stm32_cap_get_priv(timer);
      uint32_t gpio;
   @@ -1548,7 +1584,7 @@ struct stm32_cap_dev_s *stm32_cap_init(int timer)
        {
          stm32_cap_set_rcc(priv, true);
    
   -      gpio = stm32_cap_gpio(priv, STM32_CAP_CHANNEL_COUNTER);
   +      gpio = stm32_cap_gpio(priv, channel);
          if (gpio)
            {
              stm32_configgpio(gpio);
   @@ -1562,7 +1598,7 @@ struct stm32_cap_dev_s *stm32_cap_init(int timer)
      return (struct stm32_cap_dev_s *)priv;
    }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [HELP] Timer capture on nucleo stm32h743zi [nuttx]

Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on issue #16762:
URL: https://github.com/apache/nuttx/issues/16762#issuecomment-3141292526

   @comejv this code is not portable, you are accessing the MCU registers from application side. Also it only will work in FLAT mode, it you try in PROTECTED mode or KERNEL mode it will not work. This is why I suggest you to use the HC-SR04 driver as reference.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [HELP] Timer capture on nucleo stm32h743zi - Driver port [nuttx]

Posted by "comejv (via GitHub)" <gi...@apache.org>.
comejv commented on issue #16762:
URL: https://github.com/apache/nuttx/issues/16762#issuecomment-3156109940

   @juniskane I know it's been a really long time (7 years!) but you're the one who authored that part, could you help me understand it?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [HELP] Timer capture on nucleo stm32h743zi [nuttx]

Posted by "comejv (via GitHub)" <gi...@apache.org>.
comejv commented on issue #16762:
URL: https://github.com/apache/nuttx/issues/16762#issuecomment-3155418756

   @raiden00pl 
   > [@comejv](https://github.com/comejv) you need a datasheet for a given chip ("Pin descriptions" section). You can find it on the ST website https://www.st.com/en/microcontrollers-microprocessors/stm32h7-series/documentation.html -> Datasheet -> look at the file name (e.g. https://www.st.com/resource/en/datasheet/stm32h730ab.pdf)
   
   I found the right datasheet, thanks. The NuttX pinout has definitions that use specific Alternate Functions, how was the AF number chosen?
   
   For example here we have CH1IN for timer 13, using AF9.
   ```c
   #define GPIO_TIM13_CH1IN_1        (GPIO_ALT|GPIO_AF9|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN6)
   ``` 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [HELP] Timer capture on nucleo stm32h743zi [nuttx]

Posted by "comejv (via GitHub)" <gi...@apache.org>.
comejv commented on issue #16762:
URL: https://github.com/apache/nuttx/issues/16762#issuecomment-3137134931

   Hello again, I'm trying to set up gpio interrupts in place of the non existant timer capture driver, I have had success with `ioctl(fd, GPIOC_REGISTER, (unsigned long)&sev);` on `/dev/gpio2` but now I'd like to have multiple gpios sending me interrupts/signals.
   
   In `boards/arm/.../src/stm32_gpio.c` I see that the only GPIO registered for interrupt is :
   ```c
   static const uint32_t g_gpiointinputs[BOARD_NGPIOINT] =
   {
     GPIO_INT1,
   };
   ```
   Which is defined in `nucleo-h743zi.h` as `(GPIO_INPUT | GPIO_FLOAT | GPIO_PORTE | GPIO_PIN5)`.
   
   In my app I am now trying to run stm32_configgpio to add more gpios to the interrupts, the issue is that I don't know how to include `external/nuttx/arch/arm/src/stm32h7/stm32_gpio.h`?
   
   Should I even try to do it in user code or should I modify NuttX source code?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [HELP] Timer capture on nucleo stm32h743zi [nuttx]

Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on issue #16762:
URL: https://github.com/apache/nuttx/issues/16762#issuecomment-3139664118

   @comejv so you are trying to measure the pulse length using an ordinary GPIO pin instead of using the timer capture? Well, I think the best approach is figuring out how to get the timer capture working, maybe @raiden00pl have found his example. Or you can study esp32 capture driver/app and adapt it to stm32. BTW, if you want to go this way using GPIO, you can use a free running timer to count the time, like I did in the HC-SR04: https://acassis.wordpress.com/2017/08/19/creating-hc-sr04-driver-for-nuttx/


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [HELP] Timer capture on nucleo stm32h743zi [nuttx]

Posted by "comejv (via GitHub)" <gi...@apache.org>.
comejv commented on issue #16762:
URL: https://github.com/apache/nuttx/issues/16762#issuecomment-3145388073

   I'm currently looking at porting them rn, not exactly a copy paste but I'm giving it a try. It's mostly defining new macros like in board.h: 
   ```c
   #define GPIO_TIM1_CH1IN   (GPIO_TIM1_CH1IN_1)   /* PE9  (AF1) - D6 */
   ```
   And fixing the driver to use `STM32H7` instead of `STM32`, using APB H and L properly (STM32 doesn't have that).
   
   I've noticed a typo in `external/nuttx/arch/arm/src/stm32f7/stm32_capture.c`:
   ```c
   #define USE_ADVENCED_TIM 1
   ```
   
   Advance spelled the wrong way. No bug from it because it's consistent in the file. I'll probably do a small PR to fix it next week.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [HELP] Timer capture on nucleo stm32h743zi [nuttx]

Posted by "comejv (via GitHub)" <gi...@apache.org>.
comejv closed issue #16762: [HELP] Timer capture on nucleo stm32h743zi
URL: https://github.com/apache/nuttx/issues/16762


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [HELP] Timer capture on nucleo stm32h743zi - Driver port [nuttx]

Posted by "comejv (via GitHub)" <gi...@apache.org>.
comejv commented on issue #16762:
URL: https://github.com/apache/nuttx/issues/16762#issuecomment-3161523434

   I would like advice on if and how to extend the lowerhalf to be able to do 4 channel capture.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [HELP] Timer capture on nucleo stm32h743zi [nuttx]

Posted by "raiden00pl (via GitHub)" <gi...@apache.org>.
raiden00pl commented on issue #16762:
URL: https://github.com/apache/nuttx/issues/16762#issuecomment-3154987885

   @comejv you need a datasheet for a given chip ("Pin descriptions" section). You can find it on the ST website https://www.st.com/en/microcontrollers-microprocessors/stm32h7-series/documentation.html


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org