Page 3 of 3

Re: RP2040 ram and rom usage?

Posted: Mon Jul 24, 2023 7:51 pm
by Chadb
Oh, and pin25 isn't defined in the PICO file. So I don't think that will work either. It would in the rp2040.

Re: RP2040 ram and rom usage?

Posted: Wed Jul 26, 2023 2:53 pm
by LeighM
Hi Chad,
I now have this working (again) :D

The missing link is ...
Step 1
Add pico_multicore to target_link_libraries in CMakeLists.txt
C:\ProgramData\MatrixTSL\FlowcodeV10\FCD\PICO\batch

Code: Select all

target_link_libraries(flowcode pico_stdlib hardware_adc hardware_spi hardware_pwm hardware_i2c pico_multicore)
Step 2
In your project "Supplementary code" -> "Definitions" add the following (Ben: could probably go in the FCDs)

Code: Select all

#include "pico/multicore.h"
Step 3
Put the code that you want to run in the second core into a Flowcode macro, e.g. CORE2
Launch it from the following C code icon in the Main macro

Code: Select all

multicore_launch_core1(FCM_CORE2);
All done, delete any pre-existing build directory and recompile.

btw. (Using target Pi Pico) For the onboard LED you can use the following in a Calculation icon

Code: Select all

$PORTA.25 = 1

edit: Ah, and last but not least, be careful with using two cores, functions aren't necessarily thread safe :roll:

Re: RP2040 ram and rom usage?

Posted: Wed Jul 26, 2023 5:32 pm
by chipfryer27
Hi Leigh

Huge thanks for this, works a treat.

With this extra power surely my world domination is a few steps closer :)

Best regards

PS
Pico Dual Core.jpg
Pico Dual Core.jpg (41.5 KiB) Viewed 843 times

Re: RP2040 ram and rom usage?

Posted: Wed Jul 26, 2023 6:27 pm
by Chadb
That's great! I'll give it a whirl a little later.

Thanks,

Chad

*Edit: Works! Thank you.