-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
RP2350 support #24187
Comments
P.S. seems PX4 is booting up already, but still need to debug more what's happening there (no USB serial/mavlink yet): https://blog.flyuav.lt/raspberry-pico-2-a-cheap-flight-controller/ |
I am crossing my fingers till you finish 👍 |
btw, meanwhile, I'm listing a few less clear points - @akhodeir do you or someone else have any clue about these (preliminarily it seems it kinda works when SMP disabled):
for now, I probably, temporarily, hacked it like that (will need further fixes/cleanup I guess): IRQ/SMP/CURRENT_REGSdiff --git a/arch/arm/src/rp23xx/rp23xx_irq.c b/arch/arm/src/rp23xx/rp23xx_irq.c
index a3baff0d6c..e8a66ede85 100644
--- a/arch/arm/src/rp23xx/rp23xx_irq.c
+++ b/arch/arm/src/rp23xx/rp23xx_irq.c
+#ifndef CONFIG_SMP
+// FIXME nasty hack: make it compile if CONFIG_SMP is disabled
+// FIXME: in case SMP disabled, what should be the value here? {0}?
+volatile uint32_t *g_current_regs[CONFIG_SMP_NCPUS] = {0};
+#endif
+
#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
/* In the SMP configuration, we will need custom interrupt stacks.
* These definitions provide the aligned stack allocations.
@@ -76,6 +81,12 @@ const uint32_t g_cpu_intstack_top[CONFIG_SMP_NCPUS] =
};
#endif /* defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7 */
+/* This is the address of the exception vector table (determined by the
+ * linker script).
+ */
+
+extern uint32_t _vectors[];
+ diff --git a/arch/arm/include/irq.h b/arch/arm/include/irq.h
index 1fac0e1e55..2508a36b15 100644
--- a/arch/arm/include/irq.h
+++ b/arch/arm/include/irq.h
@@ -89,10 +89,16 @@ extern "C"
/* For the case of architectures with multiple CPUs, then there must be one
* such value for each processor that can receive an interrupt.
*/
-
+//#ifdef CONFIG_SMP
EXTERN volatile uint32_t *g_current_regs[CONFIG_SMP_NCPUS];
#define CURRENT_REGS (g_current_regs[up_cpu_index()])
+//#else
+// FIXME: when CONFIG_SMP not defined, I commented/disabled these lines out, as:
+// up_cpu_index() macro was conflicting with up_cpu_index() in nuttx/arch/arm/src/rp23xx/rp23xx_cpuindex.c
+//and maybe something g_current_regs defined /arch/arm/src/rp23xx/rp23xx_irq.c
+//volatile FAR uint32_t **g_current_regs;
+//#define CURRENT_REGS (g_current_regs[up_cpu_index()])
+//#endif
+
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
@@ -116,7 +122,8 @@ EXTERN volatile uint32_t *g_current_regs[CONFIG_SMP_NCPUS];
#ifdef CONFIG_SMP
int up_cpu_index(void);
#else
-# define up_cpu_index() (0)
+int up_cpu_index(void);
+// define up_cpu_index() (0)
#endif LD / Linker script:+++ b/arch/arm/src/rp23xx/rp23xx_cpuindex.c
@@ -30,11 +30,9 @@
#include "hardware/rp23xx_sio.h"
#ifdef CONFIG_ARCH_HAVE_MULTICPU
...
int up_cpu_index(void)
{
return getreg32(RP23XX_SIO_CPUID);
}
+// !!! NOTE/FIXE: this looks fishy because:
+// - ifdef CONFIG_ARCH_HAVE_MULTICPU
+// - and closing comment mentions CONFIG_SMP
#endif /* CONFIG_SMP */ Linkerscript: memory_map.ld or also called script.ld/flash.ld:...
MEMORY
{
FLASH(rx) : ORIGIN = 0x10000000, LENGTH = 4096k
RAM(rwx) : ORIGIN = 0x20000000, LENGTH = 512k
SCRATCH_X(rwx) : ORIGIN = 0x20080000, LENGTH = 4k
SCRATCH_Y(rwx) : ORIGIN = 0x20081000, LENGTH = 4k
}
+/* added EXTERN */
+EXTERN(_vectors)
ENTRY(_stext)
+/* where is _entry_point defined in ? what's the difference from _stext? */
-/*ENTRY(_entry_point)*/
+/*EXTERN(bootStr)*/
SECTIONS
{
.flash_begin : {
__flash_binary_start = .;
} > FLASH
...
.text : {
__logical_binary_start = .;
_stext = ABSOLUTE(.);
KEEP (*(.vectors))
LONG(0xffffded3)
LONG(0x10210142)
LONG(0x000001ff)
LONG(0x00000000)
LONG(0xab123579)
KEEP (*(.binary_info_header))
...
. = ALIGN(4);
/* init data */
+ /* vidma: added _sinit */
+ _sinit = ABSOLUTE(.);
PROVIDE_HIDDEN (__init_array_start = .);
KEEP(*(SORT(.init_array.*)))
KEEP(*(.init_array))
PROVIDE_HIDDEN (__init_array_end = .);
+ /* vidma: added _einit */
+ _einit = ABSOLUTE(.);
...
} > FLASH
... |
those are really advanced questions. I advise you to ask here : https://forums.raspberrypi.com/viewforum.php?f=143&sid=291ab055d458508bb26aadeb341f19da |
Describe problem solved by the proposed feature
Raspberry Pico 2 seem to be very good/performant, popular, simple (need very few external PCB components) and cheap CPU
Describe your preferred solution
10.3.2+
PX4/NuttX branchDescribe possible alternatives
Additional context
continuation of #18083
The text was updated successfully, but these errors were encountered: