Giter Site home page Giter Site logo

Comments (23)

rsta2 avatar rsta2 commented on August 15, 2024 1

That should be OK. I did a quick test on a RPi 5 with your code, and it works! Perhaps your wiring is not OK? Also the GPIO interrupt is triggered immediately, because you are using GPIOInterruptOnRisingEdge. Perhaps GPIOInterruptOnFallingEdge would be better. But this shouldn't be the problem here. Which RPi model are you using?

from circle.

rsta2 avatar rsta2 commented on August 15, 2024 1

from circle.

rsta2 avatar rsta2 commented on August 15, 2024 1

from circle.

dirkarnez avatar dirkarnez commented on August 15, 2024

Thanks @rsta2 , i am using raspberry pi 4b, the circuit is this. no preference on GPIOInterruptOnRisingEdge or GPIOInterruptOnFallingEdge, but it seems mine does not work (even i short circuit the GPIO 17 and GND to mimic pressed buttion.
image

Or should i give 3v3 to GPIO 17?

from circle.

rsta2 avatar rsta2 commented on August 15, 2024

from circle.

dirkarnez avatar dirkarnez commented on August 15, 2024

Thx, i tried three other pins still not working, i am using headless mode, does it affect the GPIO? Did you have special settings in for example cmdline.txt, config.txt ?

from circle.

rsta2 avatar rsta2 commented on August 15, 2024

from circle.

dirkarnez avatar dirkarnez commented on August 15, 2024

image
It is:

logger: Circle 46 started on Raspberry Pi 4 Model B 4GB (AArch64)
logger: Revision code is c03111, compiler has been GCC 13.2.1

Is it possible that my compiler (on Windows) may do something differently? this is the zip of my sd card contents sdcard.zip, does it work for you too (GPIO18)? Thanks!

from circle.

rsta2 avatar rsta2 commented on August 15, 2024

You have the same revision of the RPi 4B like me, but 4GB RAM. I have only 2GB, but this shouldn't make a difference. I tried your SD card contents, and I got the same behavior like you. The GPIO interrupt does not work. But interrupts generally work, because the timer can calculate the SpeedFactor.

The recommended toolchain for Circle builds can be downloaded here. You should still use the GNU C 12.2.Rel1 based toolchain (see more at the bottom of the page). I think this is the right download for you.

With the Linux version of this toolchain I build the attached kernel8-rpi4.img. Can you please extract it from the .zip archive and put it on the same SD card for a test? It does work here (with GPIO18).

kernel8-rpi4.zip

from circle.

dirkarnez avatar dirkarnez commented on August 15, 2024

Thanks for the patience, i have tried your binary and also my build using your recommended toolchain. Both does not work, i wonder if it is firmware mismatch (using tag "Step46") or my configure being wrong (./configure --raspberrypi 4 --realtime --prefix aarch64-none-elf- --multicore --c++17 )🤣🤣

from circle.

dirkarnez avatar dirkarnez commented on August 15, 2024

thx, i see, after removed --realtime and rebuilt everything, it does not work. I am not a ARM guy but would like to curiously ask: Is it possible for RPi 4B in different RAM to have different internal structure like GPIO address mapping?

from circle.

rsta2 avatar rsta2 commented on August 15, 2024

from circle.

dirkarnez avatar dirkarnez commented on August 15, 2024

i deleted the circle repo, redo git clone circle, reconfigure and recompile everything

from circle.

rsta2 avatar rsta2 commented on August 15, 2024

that should be sufficient

from circle.

dirkarnez avatar dirkarnez commented on August 15, 2024

Could you please recommend some software / hardware tricks to check if the pins or the Pi itself is really broken so i can save money to buy another one 🤣🤣. Apparently it looks good since the RX / TX pins are working for serial print, and i am desperate for using circle in my final year project 🤣🤣

from circle.

dirkarnez avatar dirkarnez commented on August 15, 2024

Wow thanks, going to flash the OS and try!

from circle.

dirkarnez avatar dirkarnez commented on August 15, 2024

@rsta2 my bad bro. It is my power supply not having enough current to drive all GPIOs. Official power supply rated 3A, i was using power from computer usb port😬😬.

However, i see the interrupt working, but in unexpected way: it seems the interrupt and the SimpleMsDelay in while true loop are having racing condition?

from circle.

rsta2 avatar rsta2 commented on August 15, 2024

from circle.

dirkarnez avatar dirkarnez commented on August 15, 2024

When i pressed the button for interrupt, the "Hello UART!\n"; may not be printed, "in the loop!\n"; keeps printing per period of time. But "Hello UART!\n"; may appear multiple times later like they are from the queue.

To keep the button working more responsively, i have to press the button in high speed. Doesn't interrupt mechanism debounce the button signal?

from circle.

rsta2 avatar rsta2 commented on August 15, 2024

from circle.

dirkarnez avatar dirkarnez commented on August 15, 2024

@rsta2 i see and thx so much bro! Let me close this

from circle.

dirkarnez avatar dirkarnez commented on August 15, 2024

image
image
Finally it works perfectly! I use my own debounced button connected to 3.3V with rising edge and pulled down interrupt GPIO 18

from circle.

rsta2 avatar rsta2 commented on August 15, 2024

from circle.

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.