Giter VIP home page Giter VIP logo

Comments (1)

nielsheirman avatar nielsheirman commented on August 18, 2024

The issue seems to be caused by the gpio_int_callback instm32_common_gpio.c starting an atomic section (and thus disabling all interrupts).

The complete flow causing the bug would be as follows:

  1. drive_output_high_task is scheduled on the timer
  2. the hw timer is configured so it will fire after 0.5 * TIMER_TICKS_PER_SEC
  3. The scheduler will then schedule __feed_watchdog_task on the timer (which will stay in the timer queue)
  4. Timer fires after 0.5 * TIMER_TICKS_PER_SEC
  5. drive_output_high_task is scheduled in the scheduler to be executed as the next task
  6. the hw timer is configured to fire for the next task of the timer queue, which at this point is the __feed_watchdog_task. Doing this will set cmp_reg_write_pending to true. This value is set to false again by the timer interrupt (thus indicating the hw timer cmp reg is set properly)
  7. drive_output_high_task is executed by the scheduler
  8. drive_output_high_task will set the gpio pin high
  9. The GPIO interrupt fires
  10. gpio_int_callback will start an atomic section (disabling all interrupts!) and calls drive_output_low_ISR
  11. drive_output_low_ISR will schedule drive_output_low_task on the timer
  12. As drive_output_low_ISR would need to be executed before __feed_watchdog_task, the hwtimer is configured
  13. as the timer interrupt has not yet fired at this point to indicate the cmp reg was set successfully, the processor will hang on while(cmp_reg_write_pending)
  14. As we are in an atomic section, interrupts are disabled and the timer interrupt will never fire

from sub-iot-stack.

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.