[DEV] RP2040 support

This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome. This forum is NOT for support.
hanya
Posts: 7
Joined: Mon Aug 09, 2021 2:14 pm
Been thanked: 3 times

Re: [DEV] RP2040 support

Postby hanya » Fri Sep 17, 2021 12:49 pm

I tried to link boot_double_tap_check function from pico-sdk which allow us to enter bootloader by double push the reset button.
The function has __attribute__((constructor)) attribute, so it called before main function.
In the case of pico-sdk based program, runtime_init function is called before main function is called to set up some state including clocks.
But in the case of ChibiOS based program, clocks are set up in halInit function called in main function.
As a result, boot_double_tap_check function can not work with ChibiOS startup program.

User avatar
Giovanni
Site Admin
Posts: 13751
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 922 times
Been thanked: 787 times
Contact:

Re: [DEV] RP2040 support

Postby Giovanni » Fri Sep 17, 2021 2:23 pm

hanya wrote:Please add structure definition for PWM register.

Code: Select all

diff --git a/os/common/ext/RP/RP2040/rp2040.h b/os/common/ext/RP/RP2040/rp2040.h
index 01c911d..7423d88 100644
--- a/os/common/ext/RP/RP2040/rp2040.h
+++ b/os/common/ext/RP/RP2040/rp2040.h
@@ -896,6 +896,67 @@ struct {
   } CLR;
 } ADC_TypeDef;


Hi,

Forgot about this, committed.

Giovanni

User avatar
Giovanni
Site Admin
Posts: 13751
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 922 times
Been thanked: 787 times
Contact:

Re: [DEV] RP2040 support

Postby Giovanni » Fri Sep 17, 2021 2:24 pm

hanya wrote:I tried to link boot_double_tap_check function from pico-sdk which allow us to enter bootloader by double push the reset button.
The function has __attribute__((constructor)) attribute, so it called before main function.
In the case of pico-sdk based program, runtime_init function is called before main function is called to set up some state including clocks.
But in the case of ChibiOS based program, clocks are set up in halInit function called in main function.
As a result, boot_double_tap_check function can not work with ChibiOS startup program.


I expect many more incompatibilities with the SDK, please feel free to make suggestions on the various topics.

Giovanni


Return to “Development and Feedback”

Who is online

Users browsing this forum: No registered users and 5 guests