RP2040 ram and rom usage?

For general Flowcode discussion that does not belong in the other sections.
Chadb
Posts: 63
http://meble-kuchenne.info.pl
Joined: Fri Dec 18, 2020 1:15 pm
Has thanked: 24 times

Re: RP2040 ram and rom usage?

Post 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.

LeighM
Valued Contributor
Posts: 401
Joined: Mon Dec 07, 2020 1:00 pm
Has thanked: 73 times
Been thanked: 218 times

Re: RP2040 ram and rom usage?

Post 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:

chipfryer27
Valued Contributor
Posts: 1203
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 289 times
Been thanked: 424 times

Re: RP2040 ram and rom usage?

Post 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 701 times

Chadb
Posts: 63
Joined: Fri Dec 18, 2020 1:15 pm
Has thanked: 24 times

Re: RP2040 ram and rom usage?

Post by Chadb »

That's great! I'll give it a whirl a little later.

Thanks,

Chad

*Edit: Works! Thank you.

Post Reply