-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
Support for RP2040 MCU #18083
Support for RP2040 MCU #18083
Conversation
…y the necessary info in there to begin developing the px4 base layer
…chip subdiretory in cmake
…ining instruction on how to add support for a new chip
… a CMakeLists.txt file in there
…o that libarch.a can be compiled
…ntent from nuttx's board.h file
…mpilation error of library -larch_hrt not found
…ons to deal with non-existing uuid register
…nctions to look similar to ones in nuttx's boards/raspberrypi-pico folder
…ard_critmon folder from stm32f3 to rp2040 because rp2040 doesn't have support for it
…blem with _wq_manager_should_exit needs to be resolved.
…es pin number instead of interrupt vector number.
…io interrupt at a time.
…he linker script. Finish testing pwm implementation.
93fbc71
to
46942e0
Compare
- delete unused - update copyright headers - make I2C_RESET optional - make SPI buses external (probe optional drivers)
/** | ||
* Fetch a never-wrapping absolute time value in microseconds from | ||
* some arbitrary epoch shortly after system start. | ||
*/ | ||
hrt_abstime hrt_absolute_time(void) | ||
{ | ||
/* Taken from rp2040 datasheet pg. 558 */ | ||
uint32_t hi = rTIMERAWH; | ||
uint32_t lo; | ||
|
||
do { | ||
lo = rTIMERAWL; | ||
uint32_t next_hi = rTIMERAWH; | ||
|
||
if (hi == next_hi) { break; } | ||
|
||
hi = next_hi; | ||
} while (true); | ||
|
||
return ((uint64_t) hi << 32) | lo; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So cool that you literally had to implement the hrt_absoluate_time
function haha @vxj9800
I was going through the PR as I was watching your talk on Youtube, super cool!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@junwoo091400 This was a great relief when I started working on this since the RP2040 has a dedicated 64-bit real-time timer. It made my life much easier.
This is the continuation of the original pr #17966 because GitHub was not allowing to reopen the pr. The current branch is rebased to PX4/PX4-Autopilot:master as asked by the maintainers.
Describe problem solved by this pull request
Add PX4 base layer support for RP2040 MCU
Describe your solution
A good amount of base layer functions are almost ready. Timers are for buzzer, pwm in, rc in, etc. will be implemented soon.
Test data / coverage
Testing needs to be done to make current implementation bug free. Timers will be implemented after that.